Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #111122

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
178f7bb
Correctly convert an NT path to a Win32 path
ChrisDenton Feb 12, 2023
1a7132d
rustdoc-search: fix incorrect doc comment
notriddle Apr 14, 2023
4c11822
rustdoc: restructure type search engine to pick-and-use IDs
notriddle Apr 15, 2023
1ece1ea
Stablize raw-dylib, link_ordinal and -Cdlltool
dpaoliello Mar 27, 2023
b6f81e0
rustdoc-search: give longer notification for type corrections
notriddle Apr 19, 2023
e0a7462
rustdoc-search: clean up `checkIfInGenerics` call at end of `checkType`
notriddle Apr 20, 2023
7529d87
rustdoc-search: make type name correction choice deterministic
notriddle Apr 20, 2023
395840c
rustdoc-search: use more descriptive "x not found; y instead" message
notriddle Apr 20, 2023
d5e7ac5
avoid duplicating TLS state between test std and realstd
RalfJung Apr 28, 2023
ed468ee
Encode def span for foreign RPITITs
compiler-errors Apr 30, 2023
bc68de9
remove pointless `FIXME` in `bootstrap::download`
onur-ozkan May 1, 2023
6197e4d
Don't `use RibKind::*`
WaffleLapkin May 1, 2023
0fa5920
Remove "RibKind" suffix from `RibKind` variants
WaffleLapkin May 1, 2023
6edb4ca
Don't print backtrace on ICEs in `issue-86800.rs`.
nnethercote May 1, 2023
5f45c69
Improve filtering in `default-backtrace-ice.rs`.
nnethercote May 1, 2023
6af761a
Add some triagebot notifications for nnethercote.
nnethercote May 2, 2023
51b9f78
Amend the triagebot comment for `Cargo.lock` changes.
nnethercote May 2, 2023
02d8fa7
Rollup merge of #107978 - ChrisDenton:nt-to-win32, r=m-ou-se
Dylan-DPC May 3, 2023
dc18d08
Rollup merge of #109677 - dpaoliello:rawdylib, r=michaelwoerister,wes…
Dylan-DPC May 3, 2023
36b6954
Rollup merge of #110371 - notriddle:notriddle/search-corrections, r=G…
Dylan-DPC May 3, 2023
e36e2d3
Rollup merge of #110946 - RalfJung:tls-realstd, r=m-ou-se
Dylan-DPC May 3, 2023
af116c8
Rollup merge of #111039 - compiler-errors:foreign-span-rpitit, r=tmiasko
Dylan-DPC May 3, 2023
fe9e1e9
Rollup merge of #111052 - nnethercote:fix-ice-test, r=Nilstrieb
Dylan-DPC May 3, 2023
c5a4b40
Rollup merge of #111069 - ozkanonur:remove-pointless-fixme, r=albertl…
Dylan-DPC May 3, 2023
785e513
Rollup merge of #111070 - WaffleLapkin:break_ribs, r=lcnr
Dylan-DPC May 3, 2023
739fc4f
Rollup merge of #111112 - nnethercote:triagebot, r=compiler-errors
Dylan-DPC May 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ codegen_llvm_error_writing_def_file =
Error writing .DEF file: {$error}

codegen_llvm_error_calling_dlltool =
Error calling dlltool: {$error}
Error calling dlltool '{$dlltool_path}': {$error}

codegen_llvm_dlltool_fail_import_library =
Dlltool could not create import library: {$stdout}
Expand Down
12 changes: 8 additions & 4 deletions compiler/rustc_codegen_llvm/src/back/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
"arm" => ("arm", "--32"),
_ => panic!("unsupported arch {}", sess.target.arch),
};
let result = std::process::Command::new(dlltool)
let result = std::process::Command::new(&dlltool)
.args([
"-d",
def_file_path.to_str().unwrap(),
Expand All @@ -218,9 +218,13 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {

match result {
Err(e) => {
sess.emit_fatal(ErrorCallingDllTool { error: e });
sess.emit_fatal(ErrorCallingDllTool {
dlltool_path: dlltool.to_string_lossy(),
error: e,
});
}
Ok(output) if !output.status.success() => {
// dlltool returns '0' on failure, so check for error output instead.
Ok(output) if !output.stderr.is_empty() => {
sess.emit_fatal(DlltoolFailImportLibrary {
stdout: String::from_utf8_lossy(&output.stdout),
stderr: String::from_utf8_lossy(&output.stderr),
Expand Down Expand Up @@ -431,7 +435,7 @@ fn string_to_io_error(s: String) -> io::Error {

fn find_binutils_dlltool(sess: &Session) -> OsString {
assert!(sess.target.options.is_like_windows && !sess.target.options.is_like_msvc);
if let Some(dlltool_path) = &sess.opts.unstable_opts.dlltool {
if let Some(dlltool_path) = &sess.opts.cg.dlltool {
return dlltool_path.clone().into_os_string();
}

Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_codegen_llvm/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ pub(crate) struct ErrorWritingDEFFile {

#[derive(Diagnostic)]
#[diag(codegen_llvm_error_calling_dlltool)]
pub(crate) struct ErrorCallingDllTool {
pub(crate) struct ErrorCallingDllTool<'a> {
pub dlltool_path: Cow<'a, str>,
pub error: std::io::Error,
}

Expand Down
9 changes: 0 additions & 9 deletions compiler/rustc_codegen_ssa/src/codegen_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,15 +592,6 @@ fn should_inherit_track_caller(tcx: TyCtxt<'_>, def_id: DefId) -> bool {

fn check_link_ordinal(tcx: TyCtxt<'_>, attr: &ast::Attribute) -> Option<u16> {
use rustc_ast::{LitIntType, LitKind, MetaItemLit};
if !tcx.features().raw_dylib && tcx.sess.target.arch == "x86" {
feature_err(
&tcx.sess.parse_sess,
sym::raw_dylib,
attr.span,
"`#[link_ordinal]` is unstable on x86",
)
.emit();
}
let meta_item_list = attr.meta_item_list();
let meta_item_list = meta_item_list.as_deref();
let sole_meta_list = match meta_item_list {
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/accepted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ declare_features! (
(accepted, pub_restricted, "1.18.0", Some(32409), None),
/// Allows use of the postfix `?` operator in expressions.
(accepted, question_mark, "1.13.0", Some(31436), None),
/// Allows the use of raw-dylibs (RFC 2627).
(accepted, raw_dylib, "CURRENT_RUSTC_VERSION", Some(58713), None),
/// Allows keywords to be escaped for use as identifiers.
(accepted, raw_identifiers, "1.30.0", Some(48589), None),
/// Allows relaxing the coherence rules such that
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_feature/src/active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,6 @@ declare_features! (
(active, precise_pointer_size_matching, "1.32.0", Some(56354), None),
/// Allows macro attributes on expressions, statements and non-inline modules.
(active, proc_macro_hygiene, "1.30.0", Some(54727), None),
/// Allows the use of raw-dylibs (RFC 2627).
(active, raw_dylib, "1.65.0", Some(58713), None),
/// Allows `&raw const $place_expr` and `&raw mut $place_expr` expressions.
(active, raw_ref_op, "1.41.0", Some(64490), None),
/// Allows using the `#[register_tool]` attribute.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_interface/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ fn test_codegen_options_tracking_hash() {
untracked!(ar, String::from("abc"));
untracked!(codegen_units, Some(42));
untracked!(default_linker_libraries, true);
untracked!(dlltool, Some(PathBuf::from("custom_dlltool.exe")));
untracked!(extra_filename, String::from("extra-filename"));
untracked!(incremental, Some(String::from("abc")));
// `link_arg` is omitted because it just forwards to `link_args`.
Expand Down Expand Up @@ -651,7 +652,6 @@ fn test_unstable_options_tracking_hash() {
untracked!(assert_incr_state, Some(String::from("loaded")));
untracked!(deduplicate_diagnostics, false);
untracked!(dep_tasks, true);
untracked!(dlltool, Some(PathBuf::from("custom_dlltool.exe")));
untracked!(dont_buffer_diagnostics, true);
untracked!(dump_dep_graph, true);
untracked!(dump_drop_tracking_cfg, Some("cfg.dot".to_string()));
Expand Down
18 changes: 0 additions & 18 deletions compiler/rustc_metadata/src/native_libs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,6 @@ impl<'tcx> Collector<'tcx> {
"raw-dylib" => {
if !sess.target.is_like_windows {
sess.emit_err(errors::FrameworkOnlyWindows { span });
} else if !features.raw_dylib && sess.target.arch == "x86" {
feature_err(
&sess.parse_sess,
sym::raw_dylib,
span,
"link kind `raw-dylib` is unstable on x86",
)
.emit();
}
NativeLibKind::RawDylib
}
Expand Down Expand Up @@ -251,16 +243,6 @@ impl<'tcx> Collector<'tcx> {
continue;
}
};
if !features.raw_dylib {
let span = item.name_value_literal_span().unwrap();
feature_err(
&sess.parse_sess,
sym::raw_dylib,
span,
"import name type is unstable",
)
.emit();
}
import_name_type = Some((link_import_name_type, item.span()));
}
_ => {
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_metadata/src/rmeta/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -837,11 +837,12 @@ fn should_encode_span(def_kind: DefKind) -> bool {
| DefKind::AnonConst
| DefKind::InlineConst
| DefKind::OpaqueTy
| DefKind::ImplTraitPlaceholder
| DefKind::Field
| DefKind::Impl { .. }
| DefKind::Closure
| DefKind::Generator => true,
DefKind::ForeignMod | DefKind::ImplTraitPlaceholder | DefKind::GlobalAsm => false,
DefKind::ForeignMod | DefKind::GlobalAsm => false,
}
}

Expand Down
67 changes: 33 additions & 34 deletions compiler/rustc_resolve/src/ident.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use crate::{ResolutionError, Resolver, Scope, ScopeSet, Segment, ToNameBinding,

use Determinacy::*;
use Namespace::*;
use RibKind::*;

type Visibility = ty::Visibility<LocalDefId>;

Expand Down Expand Up @@ -324,8 +323,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
}

module = match ribs[i].kind {
ModuleRibKind(module) => module,
MacroDefinition(def) if def == self.macro_def(ident.span.ctxt()) => {
RibKind::Module(module) => module,
RibKind::MacroDefinition(def) if def == self.macro_def(ident.span.ctxt()) => {
// If an invocation of this macro created `ident`, give up on `ident`
// and switch to `ident`'s source from the macro definition.
ident.span.remove_mark();
Expand Down Expand Up @@ -1084,7 +1083,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
let ribs = &all_ribs[rib_index + 1..];

// An invalid forward use of a generic parameter from a previous default.
if let ForwardGenericParamBanRibKind = all_ribs[rib_index].kind {
if let RibKind::ForwardGenericParamBan = all_ribs[rib_index].kind {
if let Some(span) = finalize {
let res_error = if rib_ident.name == kw::SelfUpper {
ResolutionError::SelfInGenericParamDefault
Expand All @@ -1104,14 +1103,14 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {

for rib in ribs {
match rib.kind {
NormalRibKind
| ClosureOrAsyncRibKind
| ModuleRibKind(..)
| MacroDefinition(..)
| ForwardGenericParamBanRibKind => {
RibKind::Normal
| RibKind::ClosureOrAsync
| RibKind::Module(..)
| RibKind::MacroDefinition(..)
| RibKind::ForwardGenericParamBan => {
// Nothing to do. Continue.
}
ItemRibKind(_) | AssocItemRibKind => {
RibKind::Item(_) | RibKind::AssocItem => {
// This was an attempt to access an upvar inside a
// named function item. This is not allowed, so we
// report an error.
Expand All @@ -1123,7 +1122,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
res_err = Some((span, CannotCaptureDynamicEnvironmentInFnItem));
}
}
ConstantItemRibKind(_, item) => {
RibKind::ConstantItem(_, item) => {
// Still doesn't deal with upvars
if let Some(span) = finalize {
let (span, resolution_error) =
Expand Down Expand Up @@ -1152,13 +1151,13 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
}
return Res::Err;
}
ConstParamTyRibKind => {
RibKind::ConstParamTy => {
if let Some(span) = finalize {
self.report_error(span, ParamInTyOfConstParam(rib_ident.name));
}
return Res::Err;
}
InlineAsmSymRibKind => {
RibKind::InlineAsmSym => {
if let Some(span) = finalize {
self.report_error(span, InvalidAsmSym);
}
Expand All @@ -1174,18 +1173,18 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
Res::Def(DefKind::TyParam, _) | Res::SelfTyParam { .. } | Res::SelfTyAlias { .. } => {
for rib in ribs {
let has_generic_params: HasGenericParams = match rib.kind {
NormalRibKind
| ClosureOrAsyncRibKind
| ModuleRibKind(..)
| MacroDefinition(..)
| InlineAsmSymRibKind
| AssocItemRibKind
| ForwardGenericParamBanRibKind => {
RibKind::Normal
| RibKind::ClosureOrAsync
| RibKind::Module(..)
| RibKind::MacroDefinition(..)
| RibKind::InlineAsmSym
| RibKind::AssocItem
| RibKind::ForwardGenericParamBan => {
// Nothing to do. Continue.
continue;
}

ConstantItemRibKind(trivial, _) => {
RibKind::ConstantItem(trivial, _) => {
let features = self.tcx.sess.features_untracked();
// HACK(min_const_generics): We currently only allow `N` or `{ N }`.
if !(trivial == ConstantHasGenerics::Yes
Expand Down Expand Up @@ -1226,8 +1225,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
}

// This was an attempt to use a type parameter outside its scope.
ItemRibKind(has_generic_params) => has_generic_params,
ConstParamTyRibKind => {
RibKind::Item(has_generic_params) => has_generic_params,
RibKind::ConstParamTy => {
if let Some(span) = finalize {
self.report_error(
span,
Expand All @@ -1253,15 +1252,15 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
Res::Def(DefKind::ConstParam, _) => {
for rib in ribs {
let has_generic_params = match rib.kind {
NormalRibKind
| ClosureOrAsyncRibKind
| ModuleRibKind(..)
| MacroDefinition(..)
| InlineAsmSymRibKind
| AssocItemRibKind
| ForwardGenericParamBanRibKind => continue,

ConstantItemRibKind(trivial, _) => {
RibKind::Normal
| RibKind::ClosureOrAsync
| RibKind::Module(..)
| RibKind::MacroDefinition(..)
| RibKind::InlineAsmSym
| RibKind::AssocItem
| RibKind::ForwardGenericParamBan => continue,

RibKind::ConstantItem(trivial, _) => {
let features = self.tcx.sess.features_untracked();
// HACK(min_const_generics): We currently only allow `N` or `{ N }`.
if !(trivial == ConstantHasGenerics::Yes
Expand All @@ -1284,8 +1283,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
continue;
}

ItemRibKind(has_generic_params) => has_generic_params,
ConstParamTyRibKind => {
RibKind::Item(has_generic_params) => has_generic_params,
RibKind::ConstParamTy => {
if let Some(span) = finalize {
self.report_error(
span,
Expand Down
Loading