From 58141b27f765f8865d75c8039fee36cb8db5d722 Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Tue, 14 Apr 2026 19:56:41 +0800 Subject: [PATCH 1/6] Revert "Build shared LLVM lib for windows-gnullvm" This reverts commit 1d1280aae1e31b9ae9325fddc0c57ffc5074f434. Looks like this causes problems with certain LLVM bin tools not finding `libLLVM` on `*-windows-gnullvm`. This commit is a _minimal_ revert to return us to known state to alleviate time pressure to investigate. --- src/ci/github-actions/jobs.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index 448a2c927b394..45eeff9032223 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -722,7 +722,6 @@ auto: --target=aarch64-pc-windows-gnullvm,i686-pc-windows-gnullvm --enable-full-tools --enable-profiler - --enable-llvm-link-shared DIST_REQUIRE_ALL_TOOLS: 1 CODEGEN_BACKENDS: llvm,cranelift CC_i686_pc_windows_gnullvm: i686-w64-mingw32-clang @@ -735,7 +734,6 @@ auto: --build=x86_64-pc-windows-gnullvm --enable-full-tools --enable-profiler - --enable-llvm-link-shared DIST_REQUIRE_ALL_TOOLS: 1 CODEGEN_BACKENDS: llvm,cranelift <<: *job-windows From e2d113f5e688debb0c8d5ac912143a5b4cd3d746 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Wed, 27 May 2026 12:08:59 +0200 Subject: [PATCH 2/6] Allow building the source tarballs while offline Previously locally vendored dependencies wouldn't be reused when building the source tarball, instead everything would be downloaded from the internet again (if not in the cargo cache). (cherry picked from commit b665316530342625ebc57d4c7137770c2625da84) --- src/bootstrap/src/core/build_steps/vendor.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/bootstrap/src/core/build_steps/vendor.rs b/src/bootstrap/src/core/build_steps/vendor.rs index 246598550553a..17bee20a525b6 100644 --- a/src/bootstrap/src/core/build_steps/vendor.rs +++ b/src/bootstrap/src/core/build_steps/vendor.rs @@ -114,6 +114,13 @@ impl Step for Vendor { cmd.arg("--sync").arg(sync_arg); } + // Reuse vendored dependencies when building source tarball for offline support. + if builder.config.vendor { + cmd.arg("--respect-source-config") + .arg("--config") + .arg(builder.src.join(".cargo").join("config.toml")); + } + // Will read the libstd Cargo.toml // which uses the unstable `public-dependency` feature. cmd.env("RUSTC_BOOTSTRAP", "1"); @@ -135,6 +142,13 @@ impl Step for Vendor { cmd.arg("--versioned-dirs"); } + // Reuse vendored dependencies when building source tarball for offline support. + if builder.config.vendor { + cmd.arg("--respect-source-config") + .arg("--config") + .arg(builder.src.join("library").join(".cargo").join("config.toml")); + } + // Will read the libstd Cargo.toml // which uses the unstable `public-dependency` feature. cmd.env("RUSTC_BOOTSTRAP", "1"); From e71aa040afb675b1108e16ca79c2c6cb17ed5a5e Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Wed, 10 Jun 2026 19:44:15 +0300 Subject: [PATCH 3/6] resolve: Partially revert "Remove a special case for dummy imports" (cherry picked from commit 816c70b52c78eaf1a98bec55e8047e1327d31d39) --- compiler/rustc_resolve/src/imports.rs | 9 +++++++++ .../auxiliary/dummy-import-ice-macro.rs | 15 ++++++++++++++ tests/ui/imports/dummy-import-ice.rs | 20 +++++++++++++++++++ tests/ui/imports/issue-56125.rs | 2 +- tests/ui/imports/issue-56125.stderr | 19 +++++++++++++++++- .../shadow-glob-module-resolution-2.rs | 2 ++ .../shadow-glob-module-resolution-2.stderr | 16 ++++++++++++++- .../shadow-glob-module-resolution-4.rs | 2 ++ .../shadow-glob-module-resolution-4.stderr | 16 ++++++++++++++- 9 files changed, 97 insertions(+), 4 deletions(-) create mode 100644 tests/ui/imports/auxiliary/dummy-import-ice-macro.rs create mode 100644 tests/ui/imports/dummy-import-ice.rs diff --git a/compiler/rustc_resolve/src/imports.rs b/compiler/rustc_resolve/src/imports.rs index c49e0fce630d4..2f734e6632e41 100644 --- a/compiler/rustc_resolve/src/imports.rs +++ b/compiler/rustc_resolve/src/imports.rs @@ -568,6 +568,15 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { orig_ident_span, warn_ambiguity, |this, resolution| { + if res == Res::Err + && let Some(old_decl) = resolution.best_decl() + && old_decl.res() != Res::Err + { + // Do not override real declarations with `Res::Err`s from error recovery. + // FIXME: this special case shouldn't be necessary, but removing it triggers an ICE + // due to some other issues (#157406, tests/ui/imports/dummy-import-ice.rs). + return Ok(()); + } if decl.is_glob_import() { resolution.glob_decl = Some(match resolution.glob_decl { Some(old_decl) => this.select_glob_decl( diff --git a/tests/ui/imports/auxiliary/dummy-import-ice-macro.rs b/tests/ui/imports/auxiliary/dummy-import-ice-macro.rs new file mode 100644 index 0000000000000..b5bc9c72575c5 --- /dev/null +++ b/tests/ui/imports/auxiliary/dummy-import-ice-macro.rs @@ -0,0 +1,15 @@ +extern crate proc_macro; +use proc_macro::TokenStream; + +#[proc_macro] +pub fn my_macro(_: proc_macro::TokenStream) -> proc_macro::TokenStream { + r" + use own::*; + mod own { + pub use super::submodule::*; + pub use super::ambiguous; + } + " + .parse() + .unwrap() +} diff --git a/tests/ui/imports/dummy-import-ice.rs b/tests/ui/imports/dummy-import-ice.rs new file mode 100644 index 0000000000000..e1e82db9d9f80 --- /dev/null +++ b/tests/ui/imports/dummy-import-ice.rs @@ -0,0 +1,20 @@ +// Regression test for issue #157406. + +//@ check-pass +//@ proc-macro: dummy-import-ice-macro.rs + +extern crate dummy_import_ice_macro; + +pub fn foo() { + ambiguous(); +} + +mod submodule { + pub fn ambiguous() {} +} + +pub mod ambiguous {} + +dummy_import_ice_macro::my_macro!(); + +fn main() {} diff --git a/tests/ui/imports/issue-56125.rs b/tests/ui/imports/issue-56125.rs index a30ac36473bdd..4e7e7ac67c572 100644 --- a/tests/ui/imports/issue-56125.rs +++ b/tests/ui/imports/issue-56125.rs @@ -15,7 +15,7 @@ mod m2 { mod m3 { mod empty {} use empty::issue_56125; //~ ERROR unresolved import `empty::issue_56125` - use issue_56125::*; + use issue_56125::*; //~ ERROR `issue_56125` is ambiguous } fn main() {} diff --git a/tests/ui/imports/issue-56125.stderr b/tests/ui/imports/issue-56125.stderr index f9a169b17a2f9..371130facf9d3 100644 --- a/tests/ui/imports/issue-56125.stderr +++ b/tests/ui/imports/issue-56125.stderr @@ -54,7 +54,24 @@ LL | use issue_56125::non_last_segment::non_last_segment::*; = help: consider adding an explicit import of `issue_56125` to disambiguate = help: or use `self::issue_56125` to refer to this module unambiguously -error: aborting due to 3 previous errors +error[E0659]: `issue_56125` is ambiguous + --> $DIR/issue-56125.rs:18:9 + | +LL | use issue_56125::*; + | ^^^^^^^^^^^ ambiguous name + | + = note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution + = note: `issue_56125` could refer to a crate passed with `--extern` + = help: use `::issue_56125` to refer to this crate unambiguously +note: `issue_56125` could also refer to the module imported here + --> $DIR/issue-56125.rs:18:9 + | +LL | use issue_56125::*; + | ^^^^^^^^^^^^^^ + = help: consider adding an explicit import of `issue_56125` to disambiguate + = help: or use `self::issue_56125` to refer to this module unambiguously + +error: aborting due to 4 previous errors Some errors have detailed explanations: E0432, E0659. For more information about an error, try `rustc --explain E0432`. diff --git a/tests/ui/imports/shadow-glob-module-resolution-2.rs b/tests/ui/imports/shadow-glob-module-resolution-2.rs index ac2901eb35290..c3abd1f75542c 100644 --- a/tests/ui/imports/shadow-glob-module-resolution-2.rs +++ b/tests/ui/imports/shadow-glob-module-resolution-2.rs @@ -14,5 +14,7 @@ use a::*; use e as b; //~^ ERROR: unresolved import `e` use b::c::D as e; +//~^ ERROR: cannot determine resolution for the import +//~| ERROR: cannot determine resolution for the import fn main() { } diff --git a/tests/ui/imports/shadow-glob-module-resolution-2.stderr b/tests/ui/imports/shadow-glob-module-resolution-2.stderr index ba8a2ce2d29f8..26745384dee34 100644 --- a/tests/ui/imports/shadow-glob-module-resolution-2.stderr +++ b/tests/ui/imports/shadow-glob-module-resolution-2.stderr @@ -1,3 +1,17 @@ +error: cannot determine resolution for the import + --> $DIR/shadow-glob-module-resolution-2.rs:16:5 + | +LL | use b::c::D as e; + | ^^^^^^^^^^^^ + +error: cannot determine resolution for the import + --> $DIR/shadow-glob-module-resolution-2.rs:16:5 + | +LL | use b::c::D as e; + | ^^^^^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + error[E0432]: unresolved import `e` --> $DIR/shadow-glob-module-resolution-2.rs:14:5 | @@ -10,6 +24,6 @@ LL - use e as b; LL + use a as b; | -error: aborting due to 1 previous error +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0432`. diff --git a/tests/ui/imports/shadow-glob-module-resolution-4.rs b/tests/ui/imports/shadow-glob-module-resolution-4.rs index 38fe7d17a367f..581cdc185d3f3 100644 --- a/tests/ui/imports/shadow-glob-module-resolution-4.rs +++ b/tests/ui/imports/shadow-glob-module-resolution-4.rs @@ -12,6 +12,8 @@ use e as b; use b::C as e; //~^ ERROR: unresolved import `b::C` +//~| ERROR: cannot determine resolution for the import +//~| ERROR: cannot determine resolution for the import fn e() {} diff --git a/tests/ui/imports/shadow-glob-module-resolution-4.stderr b/tests/ui/imports/shadow-glob-module-resolution-4.stderr index d94a59347a5b8..063beb612b132 100644 --- a/tests/ui/imports/shadow-glob-module-resolution-4.stderr +++ b/tests/ui/imports/shadow-glob-module-resolution-4.stderr @@ -1,9 +1,23 @@ +error: cannot determine resolution for the import + --> $DIR/shadow-glob-module-resolution-4.rs:13:5 + | +LL | use b::C as e; + | ^^^^^^^^^ + +error: cannot determine resolution for the import + --> $DIR/shadow-glob-module-resolution-4.rs:13:5 + | +LL | use b::C as e; + | ^^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + error[E0432]: unresolved import `b::C` --> $DIR/shadow-glob-module-resolution-4.rs:13:5 | LL | use b::C as e; | ^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0432`. From 37c14d399e9356af2e06b9298be54ba1c400a760 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Wed, 10 Jun 2026 15:52:15 +0300 Subject: [PATCH 4/6] Add a regression test for issue 157420 (cherry picked from commit ea1e984ceb77d7572a74a981ff102993f4e8d1f9) --- .../ui/imports/unused-import-issue-157420.rs | 19 +++++++++++++++++++ .../imports/unused-import-issue-157420.stderr | 14 ++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 tests/ui/imports/unused-import-issue-157420.rs create mode 100644 tests/ui/imports/unused-import-issue-157420.stderr diff --git a/tests/ui/imports/unused-import-issue-157420.rs b/tests/ui/imports/unused-import-issue-157420.rs new file mode 100644 index 0000000000000..8300f709d9158 --- /dev/null +++ b/tests/ui/imports/unused-import-issue-157420.rs @@ -0,0 +1,19 @@ +//@ check-pass +//@ edition: 2018.. + +#![crate_type = "lib"] // needed to enable doc link collection +#![warn(unused_imports)] + +pub use inner::*; +use crate::outer::*; //~ WARN unused import: `crate::outer` + +mod outer { + pub mod inner { + pub trait Trait {} // must be a trait + } + + pub use inner::*; +} + +/// [A::assoc] // needed to force collection of traits in scope, without filter on assoc item name +pub struct A; diff --git a/tests/ui/imports/unused-import-issue-157420.stderr b/tests/ui/imports/unused-import-issue-157420.stderr new file mode 100644 index 0000000000000..0f51508cd7c1b --- /dev/null +++ b/tests/ui/imports/unused-import-issue-157420.stderr @@ -0,0 +1,14 @@ +warning: unused import: `crate::outer` + --> $DIR/unused-import-issue-157420.rs:8:5 + | +LL | use crate::outer::*; + | ^^^^^^^^^^^^ + | +note: the lint level is defined here + --> $DIR/unused-import-issue-157420.rs:5:9 + | +LL | #![warn(unused_imports)] + | ^^^^^^^^^^^^^^ + +warning: 1 warning emitted + From 024c353292fa478e2f7247b7ab292657c76eb9f5 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Wed, 10 Jun 2026 18:38:45 +0300 Subject: [PATCH 5/6] resolve: Remove exported imports from maybe_unused_trait_imports (cherry picked from commit b4a1fc7897ff1d1ab7e305af148fb0c49e728820) --- compiler/rustc_resolve/src/check_unused.rs | 1 + tests/ui/imports/unused-import-issue-157420.rs | 2 +- tests/ui/imports/unused-import-issue-157420.stderr | 14 -------------- 3 files changed, 2 insertions(+), 15 deletions(-) delete mode 100644 tests/ui/imports/unused-import-issue-157420.stderr diff --git a/compiler/rustc_resolve/src/check_unused.rs b/compiler/rustc_resolve/src/check_unused.rs index 84221cb8c2d5e..30d4458369999 100644 --- a/compiler/rustc_resolve/src/check_unused.rs +++ b/compiler/rustc_resolve/src/check_unused.rs @@ -105,6 +105,7 @@ impl<'a, 'ra, 'tcx> UnusedImportCheckVisitor<'a, 'ra, 'tcx> { let def_id = self.r.owner_def_id(id); if self.r.effective_visibilities.is_exported(def_id) { self.check_import_as_underscore(use_tree, id); + self.r.maybe_unused_trait_imports.swap_remove(&def_id); return; } diff --git a/tests/ui/imports/unused-import-issue-157420.rs b/tests/ui/imports/unused-import-issue-157420.rs index 8300f709d9158..550c455f5bbb3 100644 --- a/tests/ui/imports/unused-import-issue-157420.rs +++ b/tests/ui/imports/unused-import-issue-157420.rs @@ -5,7 +5,7 @@ #![warn(unused_imports)] pub use inner::*; -use crate::outer::*; //~ WARN unused import: `crate::outer` +use crate::outer::*; mod outer { pub mod inner { diff --git a/tests/ui/imports/unused-import-issue-157420.stderr b/tests/ui/imports/unused-import-issue-157420.stderr deleted file mode 100644 index 0f51508cd7c1b..0000000000000 --- a/tests/ui/imports/unused-import-issue-157420.stderr +++ /dev/null @@ -1,14 +0,0 @@ -warning: unused import: `crate::outer` - --> $DIR/unused-import-issue-157420.rs:8:5 - | -LL | use crate::outer::*; - | ^^^^^^^^^^^^ - | -note: the lint level is defined here - --> $DIR/unused-import-issue-157420.rs:5:9 - | -LL | #![warn(unused_imports)] - | ^^^^^^^^^^^^^^ - -warning: 1 warning emitted - From 4cc21344c26f1f757f7e6b4a629cd822bc1192b4 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Thu, 11 Jun 2026 15:52:15 -0400 Subject: [PATCH 6/6] [beta-1.97] Update cargo submodule --- src/tools/cargo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/cargo b/src/tools/cargo index 31bcf52c870d0..910306f2a7b88 160000 --- a/src/tools/cargo +++ b/src/tools/cargo @@ -1 +1 @@ -Subproject commit 31bcf52c870d00e7b993ec65fdb888ea12bc2052 +Subproject commit 910306f2a7b889a7ff58fd4a451d3daf356a4cbb