Skip to content

Commit 2ce130d

Browse files
committed
Auto merge of rust-lang#128411 - matthiaskrgr:rollup-7oesxfs, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - rust-lang#127830 (When an archive fails to build, print the path) - rust-lang#128151 (Structured suggestion for `extern crate foo` when `foo` isn't resolved in import) - rust-lang#128161 (nested aux-build in tests/rustdoc/ tests) - rust-lang#128387 (More detailed note to deprecate ONCE_INIT) - rust-lang#128388 (Match LLVM ABI in `extern "C"` functions for `f128` on Windows) - rust-lang#128402 (Attribute checking simplifications) r? `@ghost` `@rustbot` modify labels: rollup
2 parents f8060d2 + 069962a commit 2ce130d

File tree

74 files changed

+748
-476
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+748
-476
lines changed

compiler/rustc_codegen_llvm/src/back/archive.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ impl<'a> ArchiveBuilder for LlvmArchiveBuilder<'a> {
9797
fn build(mut self: Box<Self>, output: &Path) -> bool {
9898
match self.build_with_llvm(output) {
9999
Ok(any_members) => any_members,
100-
Err(e) => self.sess.dcx().emit_fatal(ArchiveBuildFailure { error: e }),
100+
Err(error) => {
101+
self.sess.dcx().emit_fatal(ArchiveBuildFailure { path: output.to_owned(), error })
102+
}
101103
}
102104
}
103105
}

compiler/rustc_codegen_ssa/messages.ftl

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ codegen_ssa_add_native_library = failed to add native library {$library_path}: {
44
55
codegen_ssa_apple_sdk_error_sdk_path = failed to get {$sdk_name} SDK path: {$error}
66
7-
codegen_ssa_archive_build_failure =
8-
failed to build archive: {$error}
7+
codegen_ssa_archive_build_failure = failed to build archive at `{$path}`: {$error}
98
109
codegen_ssa_atomic_compare_exchange = Atomic compare-exchange intrinsic missing failure memory ordering
1110
@@ -198,7 +197,7 @@ codegen_ssa_read_file = failed to read file: {$message}
198197
199198
codegen_ssa_repair_vs_build_tools = the Visual Studio build tools may need to be repaired using the Visual Studio installer
200199
201-
codegen_ssa_rlib_archive_build_failure = failed to build archive from rlib: {$error}
200+
codegen_ssa_rlib_archive_build_failure = failed to build archive from rlib at `{$path}`: {$error}
202201
203202
codegen_ssa_rlib_incompatible_dependency_formats = `{$ty1}` and `{$ty2}` do not have equivalent dependency formats (`{$list1}` vs `{$list2}`)
204203

compiler/rustc_codegen_ssa/src/back/archive.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ impl<'a> ArchiveBuilder for ArArchiveBuilder<'a> {
207207
let sess = self.sess;
208208
match self.build_inner(output) {
209209
Ok(any_members) => any_members,
210-
Err(e) => sess.dcx().emit_fatal(ArchiveBuildFailure { error: e }),
210+
Err(error) => {
211+
sess.dcx().emit_fatal(ArchiveBuildFailure { path: output.to_owned(), error })
212+
}
211213
}
212214
}
213215
}

compiler/rustc_codegen_ssa/src/back/link.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2911,7 +2911,8 @@ fn add_static_crate(
29112911
false
29122912
}),
29132913
) {
2914-
sess.dcx().emit_fatal(errors::RlibArchiveBuildFailure { error });
2914+
sess.dcx()
2915+
.emit_fatal(errors::RlibArchiveBuildFailure { path: cratepath.clone(), error });
29152916
}
29162917
if archive.build(&dst) {
29172918
link_upstream(&dst);

compiler/rustc_codegen_ssa/src/errors.rs

+2
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ pub struct UnableToWriteDebuggerVisualizer {
500500
#[derive(Diagnostic)]
501501
#[diag(codegen_ssa_rlib_archive_build_failure)]
502502
pub struct RlibArchiveBuildFailure {
503+
pub path: PathBuf,
503504
pub error: Error,
504505
}
505506

@@ -557,6 +558,7 @@ pub struct UnsupportedLinkSelfContained;
557558
#[diag(codegen_ssa_archive_build_failure)]
558559
// Public for rustc_codegen_llvm::back::archive
559560
pub struct ArchiveBuildFailure {
561+
pub path: PathBuf,
560562
pub error: std::io::Error,
561563
}
562564

compiler/rustc_interface/src/passes.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,13 @@ fn resolver_for_lowering_raw<'tcx>(
544544
let arenas = Resolver::arenas();
545545
let _ = tcx.registered_tools(()); // Uses `crate_for_resolver`.
546546
let (krate, pre_configured_attrs) = tcx.crate_for_resolver(()).steal();
547-
let mut resolver = Resolver::new(tcx, &pre_configured_attrs, krate.spans.inner_span, &arenas);
547+
let mut resolver = Resolver::new(
548+
tcx,
549+
&pre_configured_attrs,
550+
krate.spans.inner_span,
551+
krate.spans.inject_use_span,
552+
&arenas,
553+
);
548554
let krate = configure_and_expand(krate, &pre_configured_attrs, &mut resolver);
549555

550556
// Make sure we don't mutate the cstore from here on.

0 commit comments

Comments
 (0)