Skip to content

Commit

Permalink
Auto merge of rust-lang#128411 - matthiaskrgr:rollup-7oesxfs, r=matth…
Browse files Browse the repository at this point in the history
…iaskrgr

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
  • Loading branch information
bors committed Jul 30, 2024
2 parents f8060d2 + 069962a commit 2ce130d
Show file tree
Hide file tree
Showing 74 changed files with 748 additions and 476 deletions.
4 changes: 3 additions & 1 deletion compiler/rustc_codegen_llvm/src/back/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ impl<'a> ArchiveBuilder for LlvmArchiveBuilder<'a> {
fn build(mut self: Box<Self>, output: &Path) -> bool {
match self.build_with_llvm(output) {
Ok(any_members) => any_members,
Err(e) => self.sess.dcx().emit_fatal(ArchiveBuildFailure { error: e }),
Err(error) => {
self.sess.dcx().emit_fatal(ArchiveBuildFailure { path: output.to_owned(), error })
}
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_codegen_ssa/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ codegen_ssa_add_native_library = failed to add native library {$library_path}: {
codegen_ssa_apple_sdk_error_sdk_path = failed to get {$sdk_name} SDK path: {$error}
codegen_ssa_archive_build_failure =
failed to build archive: {$error}
codegen_ssa_archive_build_failure = failed to build archive at `{$path}`: {$error}
codegen_ssa_atomic_compare_exchange = Atomic compare-exchange intrinsic missing failure memory ordering
Expand Down Expand Up @@ -198,7 +197,7 @@ codegen_ssa_read_file = failed to read file: {$message}
codegen_ssa_repair_vs_build_tools = the Visual Studio build tools may need to be repaired using the Visual Studio installer
codegen_ssa_rlib_archive_build_failure = failed to build archive from rlib: {$error}
codegen_ssa_rlib_archive_build_failure = failed to build archive from rlib at `{$path}`: {$error}
codegen_ssa_rlib_incompatible_dependency_formats = `{$ty1}` and `{$ty2}` do not have equivalent dependency formats (`{$list1}` vs `{$list2}`)
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_codegen_ssa/src/back/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ impl<'a> ArchiveBuilder for ArArchiveBuilder<'a> {
let sess = self.sess;
match self.build_inner(output) {
Ok(any_members) => any_members,
Err(e) => sess.dcx().emit_fatal(ArchiveBuildFailure { error: e }),
Err(error) => {
sess.dcx().emit_fatal(ArchiveBuildFailure { path: output.to_owned(), error })
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2911,7 +2911,8 @@ fn add_static_crate(
false
}),
) {
sess.dcx().emit_fatal(errors::RlibArchiveBuildFailure { error });
sess.dcx()
.emit_fatal(errors::RlibArchiveBuildFailure { path: cratepath.clone(), error });
}
if archive.build(&dst) {
link_upstream(&dst);
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_codegen_ssa/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ pub struct UnableToWriteDebuggerVisualizer {
#[derive(Diagnostic)]
#[diag(codegen_ssa_rlib_archive_build_failure)]
pub struct RlibArchiveBuildFailure {
pub path: PathBuf,
pub error: Error,
}

Expand Down Expand Up @@ -557,6 +558,7 @@ pub struct UnsupportedLinkSelfContained;
#[diag(codegen_ssa_archive_build_failure)]
// Public for rustc_codegen_llvm::back::archive
pub struct ArchiveBuildFailure {
pub path: PathBuf,
pub error: std::io::Error,
}

Expand Down
8 changes: 7 additions & 1 deletion compiler/rustc_interface/src/passes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,13 @@ fn resolver_for_lowering_raw<'tcx>(
let arenas = Resolver::arenas();
let _ = tcx.registered_tools(()); // Uses `crate_for_resolver`.
let (krate, pre_configured_attrs) = tcx.crate_for_resolver(()).steal();
let mut resolver = Resolver::new(tcx, &pre_configured_attrs, krate.spans.inner_span, &arenas);
let mut resolver = Resolver::new(
tcx,
&pre_configured_attrs,
krate.spans.inner_span,
krate.spans.inject_use_span,
&arenas,
);
let krate = configure_and_expand(krate, &pre_configured_attrs, &mut resolver);

// Make sure we don't mutate the cstore from here on.
Expand Down
Loading

0 comments on commit 2ce130d

Please sign in to comment.