From 06921630287373f5480c98d633c9df07df20d173 Mon Sep 17 00:00:00 2001 From: panstromek Date: Sun, 30 Aug 2026 11:25:51 +0200 Subject: [PATCH 1/3] Sort symbol names by demangled name first to avoid different ordering on hash changes --- Cargo.lock | 1 + compiler/rustc_middle/Cargo.toml | 1 + compiler/rustc_middle/src/mono.rs | 7 ++++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 696b797e612f9..f83bd25f617ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4412,6 +4412,7 @@ dependencies = [ "gsgdt", "parking_lot", "polonius-engine", + "rustc-demangle", "rustc_abi", "rustc_apfloat", "rustc_arena", diff --git a/compiler/rustc_middle/Cargo.toml b/compiler/rustc_middle/Cargo.toml index b26969a830f11..0ca2b23e8dab1 100644 --- a/compiler/rustc_middle/Cargo.toml +++ b/compiler/rustc_middle/Cargo.toml @@ -10,6 +10,7 @@ either = "1.5.0" gsgdt = "0.1.2" parking_lot = "0.12" polonius-engine = "0.13.0" +rustc-demangle = "0.1.28" rustc_abi = { path = "../rustc_abi" } rustc_apfloat = "0.2.0" rustc_arena = { path = "../rustc_arena" } diff --git a/compiler/rustc_middle/src/mono.rs b/compiler/rustc_middle/src/mono.rs index 76828cbee60f1..397189a1c9074 100644 --- a/compiler/rustc_middle/src/mono.rs +++ b/compiler/rustc_middle/src/mono.rs @@ -586,7 +586,12 @@ impl<'tcx> CodegenUnit<'tcx> { // See https://github.com/rust-lang/rust/pull/145358 for more details. // // Sorting by symbol name should not incur any new non-determinism. - items.sort_by_cached_key(|&(i, _)| i.symbol_name(tcx)); + items.sort_by_cached_key(|&(i, _)| { + let symbol_name = i.symbol_name(tcx); + let demangled = rustc_demangle::demangle(symbol_name.name); + let name_without_disambiguator = format!("{:#}", demangled); + (name_without_disambiguator, symbol_name) + }); } else { items.sort_by_cached_key(|&(i, _)| item_sort_key(tcx, i)); } From b61744a07f8f236f24b91dcfd44d0b1c73a17172 Mon Sep 17 00:00:00 2001 From: panstromek Date: Sun, 30 Aug 2026 13:26:46 +0200 Subject: [PATCH 2/3] no-op change --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ed35016eb3a23..5fafedc94eaeb 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md). For a detailed explanation of the compiler's architecture and how to begin contributing, see the [rustc-dev-guide](https://rustc-dev-guide.rust-lang.org/). +test + ## License Rust is primarily distributed under the terms of both the MIT license and the From 09a3fcedc730b7d662f1b3d6c3735bd4344d09f7 Mon Sep 17 00:00:00 2001 From: panstromek Date: Sun, 30 Aug 2026 17:26:33 +0200 Subject: [PATCH 3/3] no-op change 2 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5fafedc94eaeb..fa50f0aedcc41 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md). For a detailed explanation of the compiler's architecture and how to begin contributing, see the [rustc-dev-guide](https://rustc-dev-guide.rust-lang.org/). -test +test1 ## License