From 905342525f88b757a4f7026b2b51a21621999fd1 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Wed, 9 Jul 2025 21:27:27 -0400 Subject: [PATCH 01/23] Add a mailmap entry for gnzlbg The submodule->subtree changes add a lot of commits with the GitHub email. --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index 90533e81b39ff..68abb9003a051 100644 --- a/.mailmap +++ b/.mailmap @@ -255,6 +255,7 @@ Guillaume Gomez Guillaume Gomez ggomez Guillaume Gomez Guillaume Gomez Guillaume Gomez Guillaume Gomez +gnzlbg hamidreza kalbasi Hanna Kruppe Heather From 12b57942d646d27e8d0a615ba4b8a0dea6cf3b9f Mon Sep 17 00:00:00 2001 From: Zachary S Date: Tue, 12 Aug 2025 17:42:43 -0500 Subject: [PATCH 02/23] Remove TmpLayout in layout_of_enum --- compiler/rustc_abi/src/layout.rs | 39 ++++++++------------------------ 1 file changed, 9 insertions(+), 30 deletions(-) diff --git a/compiler/rustc_abi/src/layout.rs b/compiler/rustc_abi/src/layout.rs index c2405553756b9..5004d0c80220f 100644 --- a/compiler/rustc_abi/src/layout.rs +++ b/compiler/rustc_abi/src/layout.rs @@ -594,23 +594,13 @@ impl LayoutCalculator { discr_range_of_repr: impl Fn(i128, i128) -> (Integer, bool), discriminants: impl Iterator, ) -> LayoutCalculatorResult { - // Until we've decided whether to use the tagged or - // niche filling LayoutData, we don't want to intern the - // variant layouts, so we can't store them in the - // overall LayoutData. Store the overall LayoutData - // and the variant LayoutDatas here until then. - struct TmpLayout { - layout: LayoutData, - variants: IndexVec>, - } - let dl = self.cx.data_layout(); // bail if the enum has an incoherent repr that cannot be computed if repr.packed() { return Err(LayoutCalculatorError::ReprConflict); } - let calculate_niche_filling_layout = || -> Option> { + let calculate_niche_filling_layout = || -> Option> { if repr.inhibit_enum_layout_opt() { return None; } @@ -746,7 +736,7 @@ impl LayoutCalculator { niche_start, }, tag_field: FieldIdx::new(0), - variants: IndexVec::new(), + variants: variant_layouts, }, fields: FieldsShape::Arbitrary { offsets: [niche_offset].into(), @@ -762,7 +752,7 @@ impl LayoutCalculator { randomization_seed: combined_seed, }; - Some(TmpLayout { layout, variants: variant_layouts }) + Some(layout) }; let niche_filling_layout = calculate_niche_filling_layout(); @@ -1093,7 +1083,7 @@ impl LayoutCalculator { tag, tag_encoding: TagEncoding::Direct, tag_field: FieldIdx::new(0), - variants: IndexVec::new(), + variants: layout_variants, }, fields: FieldsShape::Arbitrary { offsets: [Size::ZERO].into(), @@ -1109,18 +1099,16 @@ impl LayoutCalculator { randomization_seed: combined_seed, }; - let tagged_layout = TmpLayout { layout: tagged_layout, variants: layout_variants }; - - let mut best_layout = match (tagged_layout, niche_filling_layout) { + let best_layout = match (tagged_layout, niche_filling_layout) { (tl, Some(nl)) => { // Pick the smaller layout; otherwise, // pick the layout with the larger niche; otherwise, // pick tagged as it has simpler codegen. use cmp::Ordering::*; - let niche_size = |tmp_l: &TmpLayout| { - tmp_l.layout.largest_niche.map_or(0, |n| n.available(dl)) + let niche_size = |l: &LayoutData| { + l.largest_niche.map_or(0, |n| n.available(dl)) }; - match (tl.layout.size.cmp(&nl.layout.size), niche_size(&tl).cmp(&niche_size(&nl))) { + match (tl.size.cmp(&nl.size), niche_size(&tl).cmp(&niche_size(&nl))) { (Greater, _) => nl, (Equal, Less) => nl, _ => tl, @@ -1129,16 +1117,7 @@ impl LayoutCalculator { (tl, None) => tl, }; - // Now we can intern the variant layouts and store them in the enum layout. - best_layout.layout.variants = match best_layout.layout.variants { - Variants::Multiple { tag, tag_encoding, tag_field, .. } => { - Variants::Multiple { tag, tag_encoding, tag_field, variants: best_layout.variants } - } - Variants::Single { .. } | Variants::Empty => { - panic!("encountered a single-variant or empty enum during multi-variant layout") - } - }; - Ok(best_layout.layout) + Ok(best_layout) } fn univariant_biased< From db4e71683e86e30fda9c2f72c5f4598b230a5a16 Mon Sep 17 00:00:00 2001 From: Havard Eidnes Date: Sat, 23 Aug 2025 18:52:11 +0000 Subject: [PATCH 03/23] std library: use execinfo library also on NetBSD. --- library/std/src/sys/pal/unix/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/std/src/sys/pal/unix/mod.rs b/library/std/src/sys/pal/unix/mod.rs index aef7ab55088d2..400128acf1264 100644 --- a/library/std/src/sys/pal/unix/mod.rs +++ b/library/std/src/sys/pal/unix/mod.rs @@ -382,6 +382,7 @@ cfg_select! { unsafe extern "C" {} } target_os = "netbsd" => { + #[link(name = "execinfo")] #[link(name = "pthread")] #[link(name = "rt")] unsafe extern "C" {} From 17c866780e4f60c4b5ce0c0925557949c9c8d8b1 Mon Sep 17 00:00:00 2001 From: Rafael RL Date: Wed, 23 Jul 2025 12:25:20 +0200 Subject: [PATCH 04/23] fix(std): Add __my_thread_exit stub for QNX 8 This commit adds an empty stub for the function for QNX 8 targets. This symbol is required by the unwinder but is not present, causing a linking failure when building with the standard library. Address review feedback: use whitelist for QNX versions --- library/std/src/sys/backtrace.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/sys/backtrace.rs b/library/std/src/sys/backtrace.rs index 272d0fa4d1a19..57682207e078e 100644 --- a/library/std/src/sys/backtrace.rs +++ b/library/std/src/sys/backtrace.rs @@ -113,7 +113,7 @@ unsafe fn _print_fmt(fmt: &mut fmt::Formatter<'_>, print_fmt: PrintFmt) -> fmt:: res = bt_fmt.frame().symbol(frame, symbol); } }); - #[cfg(target_os = "nto")] + #[cfg(all(target_os = "nto", any(target_env = "nto70", target_env = "nto71")))] if libc::__my_thread_exit as *mut libc::c_void == frame.ip() { if !hit && print { use crate::backtrace_rs::SymbolName; From f9c765ed76bcaa9aa2ccc902e61e3de91ec96837 Mon Sep 17 00:00:00 2001 From: Jamie Hill-Daniel Date: Tue, 26 Aug 2025 13:44:00 +0000 Subject: [PATCH 05/23] Test `instrument-mcount` --- tests/assembly-llvm/x86_64-mcount.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/assembly-llvm/x86_64-mcount.rs diff --git a/tests/assembly-llvm/x86_64-mcount.rs b/tests/assembly-llvm/x86_64-mcount.rs new file mode 100644 index 0000000000000..0428272cfc598 --- /dev/null +++ b/tests/assembly-llvm/x86_64-mcount.rs @@ -0,0 +1,24 @@ +//@ assembly-output: emit-asm +//@ compile-flags: -Zinstrument-mcount=y -Cllvm-args=-x86-asm-syntax=intel + +//@ revisions: x86_64-linux +//@[x86_64-linux] compile-flags: --target=x86_64-unknown-linux-gnu +//@[x86_64-linux] needs-llvm-components: x86 +//@[x86_64-linux] only-x86_64-unknown-linux-gnu + +//@ revisions: x86_64-darwin +//@[x86_64-darwin] compile-flags: --target=x86_64-apple-darwin +//@[x86_64-darwin] needs-llvm-components: x86 +//@[x86_64-darwin] only-x86_64-apple-darwin + +#![crate_type = "lib"] + +// CHECK-LABEL: mcount_func: +#[no_mangle] +pub fn mcount_func() { + // CHECK: call mcount + + std::hint::black_box(()); + + // CHECK: ret +} From 75060001c0acb03f4febebb81909175cd2798bca Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 27 Aug 2025 20:00:19 +1000 Subject: [PATCH 06/23] Add an overlooked `tracing` to `[workspace.dependencies]`. --- compiler/rustc_ast/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_ast/Cargo.toml b/compiler/rustc_ast/Cargo.toml index 0b8ab7c391c21..7f948a652204b 100644 --- a/compiler/rustc_ast/Cargo.toml +++ b/compiler/rustc_ast/Cargo.toml @@ -16,5 +16,5 @@ rustc_serialize = { path = "../rustc_serialize" } rustc_span = { path = "../rustc_span" } smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } thin-vec.workspace = true -tracing = "0.1" +tracing.workspace = true # tidy-alphabetical-end From 12dc789bc657b1f0b695c39f81de9269f8c709b4 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 27 Aug 2025 19:50:53 +1000 Subject: [PATCH 07/23] Add `libc` to `[workspace.dependencies]`. --- Cargo.toml | 3 +++ compiler/rustc_codegen_llvm/Cargo.toml | 2 +- compiler/rustc_codegen_ssa/Cargo.toml | 2 +- compiler/rustc_data_structures/Cargo.toml | 2 +- compiler/rustc_driver_impl/Cargo.toml | 2 +- compiler/rustc_llvm/Cargo.toml | 2 +- compiler/rustc_metadata/Cargo.toml | 2 +- compiler/rustc_session/Cargo.toml | 4 +--- compiler/rustc_thread_pool/Cargo.toml | 2 +- src/tools/compiletest/Cargo.toml | 2 +- src/tools/run-make-support/Cargo.toml | 2 +- 11 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5003e107cc8a4..e9a030e7de1aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,6 +63,9 @@ exclude = [ # tidy-alphabetical-start bitflags = "2.9.3" itertools = "0.12.1" +# FIXME: Remove this pin once this rustix issue is resolved +# https://github.com/bytecodealliance/rustix/issues/1496 +libc = "=0.2.174" memchr = "2.7.5" rustc-literal-escaper = "0.0.5" thin-vec = "0.2.14" diff --git a/compiler/rustc_codegen_llvm/Cargo.toml b/compiler/rustc_codegen_llvm/Cargo.toml index 26d20acbe28f6..9cfa23ecd43c0 100644 --- a/compiler/rustc_codegen_llvm/Cargo.toml +++ b/compiler/rustc_codegen_llvm/Cargo.toml @@ -13,7 +13,7 @@ bitflags.workspace = true # by `rustc_codegen_ssa` via its `thorin-dwp` dependency. gimli = "0.31" itertools.workspace = true -libc = "0.2" +libc.workspace = true measureme = "12.0.1" object = { version = "0.37.0", default-features = false, features = ["std", "read"] } rustc-demangle = "0.1.21" diff --git a/compiler/rustc_codegen_ssa/Cargo.toml b/compiler/rustc_codegen_ssa/Cargo.toml index 6b989a964882e..123c7ba1f308c 100644 --- a/compiler/rustc_codegen_ssa/Cargo.toml +++ b/compiler/rustc_codegen_ssa/Cargo.toml @@ -48,7 +48,7 @@ wasm-encoder = "0.219" [target.'cfg(unix)'.dependencies] # tidy-alphabetical-start -libc = "0.2.50" +libc.workspace = true # tidy-alphabetical-end [dependencies.object] diff --git a/compiler/rustc_data_structures/Cargo.toml b/compiler/rustc_data_structures/Cargo.toml index 0ac9e02508a67..c9e2d050c1bee 100644 --- a/compiler/rustc_data_structures/Cargo.toml +++ b/compiler/rustc_data_structures/Cargo.toml @@ -47,7 +47,7 @@ features = [ [target.'cfg(unix)'.dependencies] # tidy-alphabetical-start -libc = "0.2" +libc.workspace = true # tidy-alphabetical-end [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/compiler/rustc_driver_impl/Cargo.toml b/compiler/rustc_driver_impl/Cargo.toml index 7e9af054aff63..b4729d2871eca 100644 --- a/compiler/rustc_driver_impl/Cargo.toml +++ b/compiler/rustc_driver_impl/Cargo.toml @@ -56,7 +56,7 @@ tracing.workspace = true [target.'cfg(all(unix, any(target_env = "gnu", target_os = "macos")))'.dependencies] # tidy-alphabetical-start -libc = "0.2" +libc.workspace = true # tidy-alphabetical-end [target.'cfg(windows)'.dependencies.windows] diff --git a/compiler/rustc_llvm/Cargo.toml b/compiler/rustc_llvm/Cargo.toml index cd352ce3d0f4f..e74de453be216 100644 --- a/compiler/rustc_llvm/Cargo.toml +++ b/compiler/rustc_llvm/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" [dependencies] # tidy-alphabetical-start -libc = "0.2.73" +libc.workspace = true # tidy-alphabetical-end [build-dependencies] diff --git a/compiler/rustc_metadata/Cargo.toml b/compiler/rustc_metadata/Cargo.toml index 4bb9e49ccced8..019e951fa6264 100644 --- a/compiler/rustc_metadata/Cargo.toml +++ b/compiler/rustc_metadata/Cargo.toml @@ -36,5 +36,5 @@ tracing.workspace = true [target.'cfg(target_os = "aix")'.dependencies] # tidy-alphabetical-start -libc = "0.2" +libc.workspace = true # tidy-alphabetical-end diff --git a/compiler/rustc_session/Cargo.toml b/compiler/rustc_session/Cargo.toml index 97789b198a41f..5870fb29ae837 100644 --- a/compiler/rustc_session/Cargo.toml +++ b/compiler/rustc_session/Cargo.toml @@ -27,10 +27,8 @@ tracing.workspace = true # tidy-alphabetical-end [target.'cfg(unix)'.dependencies] -# FIXME: Remove this pin once this rustix issue is resolved -# https://github.com/bytecodealliance/rustix/issues/1496 # tidy-alphabetical-start -libc = "=0.2.174" +libc.workspace = true # tidy-alphabetical-end [target.'cfg(windows)'.dependencies.windows] diff --git a/compiler/rustc_thread_pool/Cargo.toml b/compiler/rustc_thread_pool/Cargo.toml index c92984470b7ae..3eafb308192d0 100644 --- a/compiler/rustc_thread_pool/Cargo.toml +++ b/compiler/rustc_thread_pool/Cargo.toml @@ -23,7 +23,7 @@ rand_xorshift = "0.4" scoped-tls = "1.0" [target.'cfg(unix)'.dev-dependencies] -libc = "0.2" +libc.workspace = true [[test]] name = "stack_overflow_crash" diff --git a/src/tools/compiletest/Cargo.toml b/src/tools/compiletest/Cargo.toml index 220c29cec49cf..4b932c7cbd211 100644 --- a/src/tools/compiletest/Cargo.toml +++ b/src/tools/compiletest/Cargo.toml @@ -35,7 +35,7 @@ walkdir = "2" # tidy-alphabetical-end [target.'cfg(unix)'.dependencies] -libc = "0.2" +libc.workspace = true [target.'cfg(windows)'.dependencies] miow = "0.6" diff --git a/src/tools/run-make-support/Cargo.toml b/src/tools/run-make-support/Cargo.toml index 250e0f65a9f44..a87089d12b670 100644 --- a/src/tools/run-make-support/Cargo.toml +++ b/src/tools/run-make-support/Cargo.toml @@ -12,7 +12,7 @@ edition = "2024" # tidy-alphabetical-start bstr = "1.12" gimli = "0.32" -libc = "0.2" +libc.workspace = true object = "0.37" regex = "1.11" serde_json = "1.0" From daf6fe2c1b51877d027453191ec648f52fc0ea8c Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 27 Aug 2025 19:58:21 +1000 Subject: [PATCH 08/23] Add `serde_json` to `[workspace.dependencies]`. --- Cargo.toml | 1 + compiler/rustc_codegen_llvm/Cargo.toml | 2 +- compiler/rustc_codegen_ssa/Cargo.toml | 2 +- compiler/rustc_driver_impl/Cargo.toml | 2 +- compiler/rustc_errors/Cargo.toml | 2 +- compiler/rustc_feature/Cargo.toml | 2 +- compiler/rustc_monomorphize/Cargo.toml | 2 +- compiler/rustc_target/Cargo.toml | 2 +- src/librustdoc/Cargo.toml | 2 +- src/tools/build-manifest/Cargo.toml | 2 +- src/tools/collect-license-metadata/Cargo.toml | 2 +- src/tools/compiletest/Cargo.toml | 2 +- src/tools/features-status-dump/Cargo.toml | 2 +- src/tools/generate-copyright/Cargo.toml | 2 +- src/tools/jsondocck/Cargo.toml | 2 +- src/tools/jsondoclint/Cargo.toml | 2 +- src/tools/lint-docs/Cargo.toml | 2 +- src/tools/opt-dist/Cargo.toml | 2 +- src/tools/run-make-support/Cargo.toml | 2 +- 19 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e9a030e7de1aa..8d8f3612d64bd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,6 +68,7 @@ itertools = "0.12.1" libc = "=0.2.174" memchr = "2.7.5" rustc-literal-escaper = "0.0.5" +serde_json = "1.0.142" thin-vec = "0.2.14" tracing = "0.1.37" # tidy-alphabetical-end diff --git a/compiler/rustc_codegen_llvm/Cargo.toml b/compiler/rustc_codegen_llvm/Cargo.toml index 9cfa23ecd43c0..18c5189a4022e 100644 --- a/compiler/rustc_codegen_llvm/Cargo.toml +++ b/compiler/rustc_codegen_llvm/Cargo.toml @@ -38,7 +38,7 @@ rustc_span = { path = "../rustc_span" } rustc_symbol_mangling = { path = "../rustc_symbol_mangling" } rustc_target = { path = "../rustc_target" } serde = { version = "1", features = ["derive"] } -serde_json = "1" +serde_json.workspace = true smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } tracing.workspace = true # tidy-alphabetical-end diff --git a/compiler/rustc_codegen_ssa/Cargo.toml b/compiler/rustc_codegen_ssa/Cargo.toml index 123c7ba1f308c..8588b5bf32753 100644 --- a/compiler/rustc_codegen_ssa/Cargo.toml +++ b/compiler/rustc_codegen_ssa/Cargo.toml @@ -37,7 +37,7 @@ rustc_span = { path = "../rustc_span" } rustc_symbol_mangling = { path = "../rustc_symbol_mangling" } rustc_target = { path = "../rustc_target" } rustc_trait_selection = { path = "../rustc_trait_selection" } -serde_json = "1.0.59" +serde_json.workspace = true smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } tempfile = "3.2" thin-vec.workspace = true diff --git a/compiler/rustc_driver_impl/Cargo.toml b/compiler/rustc_driver_impl/Cargo.toml index b4729d2871eca..196c8aa354713 100644 --- a/compiler/rustc_driver_impl/Cargo.toml +++ b/compiler/rustc_driver_impl/Cargo.toml @@ -49,7 +49,7 @@ rustc_span = { path = "../rustc_span" } rustc_target = { path = "../rustc_target" } rustc_trait_selection = { path = "../rustc_trait_selection" } rustc_ty_utils = { path = "../rustc_ty_utils" } -serde_json = "1.0.59" +serde_json.workspace = true shlex = "1.0" tracing.workspace = true # tidy-alphabetical-end diff --git a/compiler/rustc_errors/Cargo.toml b/compiler/rustc_errors/Cargo.toml index f5853855673f0..67a17ce88faa0 100644 --- a/compiler/rustc_errors/Cargo.toml +++ b/compiler/rustc_errors/Cargo.toml @@ -21,7 +21,7 @@ rustc_macros = { path = "../rustc_macros" } rustc_serialize = { path = "../rustc_serialize" } rustc_span = { path = "../rustc_span" } serde = { version = "1.0.125", features = ["derive"] } -serde_json = "1.0.59" +serde_json.workspace = true termcolor = "1.2.0" termize = "0.2" tracing.workspace = true diff --git a/compiler/rustc_feature/Cargo.toml b/compiler/rustc_feature/Cargo.toml index a4746ac455c1d..b58f237585241 100644 --- a/compiler/rustc_feature/Cargo.toml +++ b/compiler/rustc_feature/Cargo.toml @@ -9,5 +9,5 @@ rustc_data_structures = { path = "../rustc_data_structures" } rustc_hir = { path = "../rustc_hir" } rustc_span = { path = "../rustc_span" } serde = { version = "1.0.125", features = ["derive"] } -serde_json = "1.0.59" +serde_json.workspace = true # tidy-alphabetical-end diff --git a/compiler/rustc_monomorphize/Cargo.toml b/compiler/rustc_monomorphize/Cargo.toml index b11084cf169e9..78266d3c6d858 100644 --- a/compiler/rustc_monomorphize/Cargo.toml +++ b/compiler/rustc_monomorphize/Cargo.toml @@ -16,6 +16,6 @@ rustc_session = { path = "../rustc_session" } rustc_span = { path = "../rustc_span" } rustc_target = { path = "../rustc_target" } serde = "1" -serde_json = "1" +serde_json.workspace = true tracing.workspace = true # tidy-alphabetical-end diff --git a/compiler/rustc_target/Cargo.toml b/compiler/rustc_target/Cargo.toml index 3c257bf38a554..ed59ee2a57565 100644 --- a/compiler/rustc_target/Cargo.toml +++ b/compiler/rustc_target/Cargo.toml @@ -16,7 +16,7 @@ rustc_serialize = { path = "../rustc_serialize" } rustc_span = { path = "../rustc_span" } serde = "1.0.219" serde_derive = "1.0.219" -serde_json = "1.0.59" +serde_json.workspace = true serde_path_to_error = "0.1.17" tracing.workspace = true # tidy-alphabetical-end diff --git a/src/librustdoc/Cargo.toml b/src/librustdoc/Cargo.toml index 02a3a4e0de404..d34b4af2d95c8 100644 --- a/src/librustdoc/Cargo.toml +++ b/src/librustdoc/Cargo.toml @@ -19,7 +19,7 @@ pulldown-cmark-escape = { version = "0.11.0", features = ["simd"] } regex = "1" rustdoc-json-types = { path = "../rustdoc-json-types" } serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" +serde_json.workspace = true smallvec = "1.8.1" stringdex = { version = "0.0.1-alpha4" } tempfile = "3" diff --git a/src/tools/build-manifest/Cargo.toml b/src/tools/build-manifest/Cargo.toml index efa99f181b3a1..05d5f21c12cb4 100644 --- a/src/tools/build-manifest/Cargo.toml +++ b/src/tools/build-manifest/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] toml = "0.7" serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" +serde_json.workspace = true anyhow = "1.0.32" flate2 = "1.0.26" xz2 = "0.1.7" diff --git a/src/tools/collect-license-metadata/Cargo.toml b/src/tools/collect-license-metadata/Cargo.toml index edf9e5c5393ea..7f2e57ced05cf 100644 --- a/src/tools/collect-license-metadata/Cargo.toml +++ b/src/tools/collect-license-metadata/Cargo.toml @@ -8,5 +8,5 @@ license = "MIT OR Apache-2.0" [dependencies] anyhow = "1.0.65" serde = { version = "1.0.147", features = ["derive"] } -serde_json = "1.0.85" +serde_json.workspace = true spdx-rs = "0.5.1" diff --git a/src/tools/compiletest/Cargo.toml b/src/tools/compiletest/Cargo.toml index 4b932c7cbd211..6f21c7db4874c 100644 --- a/src/tools/compiletest/Cargo.toml +++ b/src/tools/compiletest/Cargo.toml @@ -27,7 +27,7 @@ regex = "1.0" rustfix = "0.8.1" semver = { version = "1.0.23", features = ["serde"] } serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" +serde_json.workspace = true tracing-subscriber = { version = "0.3.3", default-features = false, features = ["ansi", "env-filter", "fmt", "parking_lot", "smallvec"] } tracing.workspace = true unified-diff = "0.2.1" diff --git a/src/tools/features-status-dump/Cargo.toml b/src/tools/features-status-dump/Cargo.toml index b2976f14a01a4..d72555da48650 100644 --- a/src/tools/features-status-dump/Cargo.toml +++ b/src/tools/features-status-dump/Cargo.toml @@ -8,5 +8,5 @@ edition = "2021" anyhow = { version = "1" } clap = { version = "4", features = ["derive"] } serde = { version = "1.0.125", features = [ "derive" ] } -serde_json = "1.0.59" +serde_json.workspace = true tidy = { path = "../tidy", features = ["build-metrics"] } diff --git a/src/tools/generate-copyright/Cargo.toml b/src/tools/generate-copyright/Cargo.toml index bcb3165de458f..5edf1f3d88b34 100644 --- a/src/tools/generate-copyright/Cargo.toml +++ b/src/tools/generate-copyright/Cargo.toml @@ -11,5 +11,5 @@ anyhow = "1.0.65" askama = "0.14.0" cargo_metadata = "0.21" serde = { version = "1.0.147", features = ["derive"] } -serde_json = "1.0.85" +serde_json.workspace = true thiserror = "1" diff --git a/src/tools/jsondocck/Cargo.toml b/src/tools/jsondocck/Cargo.toml index 80fc26cbe6680..92fde36388231 100644 --- a/src/tools/jsondocck/Cargo.toml +++ b/src/tools/jsondocck/Cargo.toml @@ -8,5 +8,5 @@ jsonpath-rust = "1.0.0" getopts = "0.2" regex = "1.4" shlex = "1.0" -serde_json = "1.0" +serde_json.workspace = true fs-err = "2.5.0" diff --git a/src/tools/jsondoclint/Cargo.toml b/src/tools/jsondoclint/Cargo.toml index cc8ecefd530b4..d8cd59f7b4227 100644 --- a/src/tools/jsondoclint/Cargo.toml +++ b/src/tools/jsondoclint/Cargo.toml @@ -12,4 +12,4 @@ fs-err = "2.8.1" rustc-hash = "2.0.0" rustdoc-json-types = { version = "0.1.0", path = "../../rustdoc-json-types" } serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0.85" +serde_json.workspace = true diff --git a/src/tools/lint-docs/Cargo.toml b/src/tools/lint-docs/Cargo.toml index 6e1ab84ed18d9..7af4b72e5b44d 100644 --- a/src/tools/lint-docs/Cargo.toml +++ b/src/tools/lint-docs/Cargo.toml @@ -8,6 +8,6 @@ description = "A script to extract the lint documentation for the rustc book." [dependencies] rustc-literal-escaper = "0.0.5" -serde_json = "1.0.57" +serde_json.workspace = true tempfile = "3.1.0" walkdir = "2.3.1" diff --git a/src/tools/opt-dist/Cargo.toml b/src/tools/opt-dist/Cargo.toml index f4051ae67d7c0..e419a75f5f272 100644 --- a/src/tools/opt-dist/Cargo.toml +++ b/src/tools/opt-dist/Cargo.toml @@ -15,7 +15,7 @@ fs_extra = "1" camino = "1" tar = "0.4" xz = { version = "0.1", package = "xz2" } -serde_json = "1" +serde_json.workspace = true glob = "0.3" tempfile = "3.5" derive_builder = "0.20" diff --git a/src/tools/run-make-support/Cargo.toml b/src/tools/run-make-support/Cargo.toml index a87089d12b670..86ac4b9d7b458 100644 --- a/src/tools/run-make-support/Cargo.toml +++ b/src/tools/run-make-support/Cargo.toml @@ -15,7 +15,7 @@ gimli = "0.32" libc.workspace = true object = "0.37" regex = "1.11" -serde_json = "1.0" +serde_json.workspace = true similar = "2.7" wasmparser = { version = "0.236", default-features = false, features = ["std", "features", "validate"] } # tidy-alphabetical-end From d263d3a88ce2d339a16587fdb60d60a208ea4f6b Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 27 Aug 2025 20:03:15 +1000 Subject: [PATCH 09/23] Add `either` to `[workspace.dependencies]`. --- Cargo.toml | 1 + compiler/rustc_borrowck/Cargo.toml | 2 +- compiler/rustc_const_eval/Cargo.toml | 2 +- compiler/rustc_data_structures/Cargo.toml | 2 +- compiler/rustc_middle/Cargo.toml | 2 +- compiler/rustc_mir_transform/Cargo.toml | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8d8f3612d64bd..d7408cd48ae74 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,6 +62,7 @@ exclude = [ [workspace.dependencies] # tidy-alphabetical-start bitflags = "2.9.3" +either = "1.15.0" itertools = "0.12.1" # FIXME: Remove this pin once this rustix issue is resolved # https://github.com/bytecodealliance/rustix/issues/1496 diff --git a/compiler/rustc_borrowck/Cargo.toml b/compiler/rustc_borrowck/Cargo.toml index 3162e9da1ba63..c0311ff414d70 100644 --- a/compiler/rustc_borrowck/Cargo.toml +++ b/compiler/rustc_borrowck/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" [dependencies] # tidy-alphabetical-start -either = "1.5.0" +either.workspace = true itertools.workspace = true polonius-engine = "0.13.0" rustc_abi = { path = "../rustc_abi" } diff --git a/compiler/rustc_const_eval/Cargo.toml b/compiler/rustc_const_eval/Cargo.toml index 88dfc83f7fc3e..4f5e5eaa74cdb 100644 --- a/compiler/rustc_const_eval/Cargo.toml +++ b/compiler/rustc_const_eval/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" [dependencies] # tidy-alphabetical-start -either = "1" +either.workspace = true rustc_abi = { path = "../rustc_abi" } rustc_apfloat = "0.2.0" rustc_ast = { path = "../rustc_ast" } diff --git a/compiler/rustc_data_structures/Cargo.toml b/compiler/rustc_data_structures/Cargo.toml index c9e2d050c1bee..d8d9d35cfc18f 100644 --- a/compiler/rustc_data_structures/Cargo.toml +++ b/compiler/rustc_data_structures/Cargo.toml @@ -7,7 +7,7 @@ edition = "2024" # tidy-alphabetical-start arrayvec = { version = "0.7", default-features = false } bitflags.workspace = true -either = "1.0" +either.workspace = true elsa = "1.11.0" ena = "0.14.3" indexmap = "2.4.0" diff --git a/compiler/rustc_middle/Cargo.toml b/compiler/rustc_middle/Cargo.toml index 782066981c9cd..b6e20017bbf4a 100644 --- a/compiler/rustc_middle/Cargo.toml +++ b/compiler/rustc_middle/Cargo.toml @@ -6,7 +6,7 @@ edition = "2024" [dependencies] # tidy-alphabetical-start bitflags.workspace = true -either = "1.5.0" +either.workspace = true gsgdt = "0.1.2" polonius-engine = "0.13.0" rustc_abi = { path = "../rustc_abi" } diff --git a/compiler/rustc_mir_transform/Cargo.toml b/compiler/rustc_mir_transform/Cargo.toml index 16acec15e923c..99ef67e2625d2 100644 --- a/compiler/rustc_mir_transform/Cargo.toml +++ b/compiler/rustc_mir_transform/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" [dependencies] # tidy-alphabetical-start -either = "1" +either.workspace = true itertools.workspace = true rustc_abi = { path = "../rustc_abi" } rustc_arena = { path = "../rustc_arena" } From 1ed566026633c20f7bbb2d1d5edcf558dcb7ef37 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 27 Aug 2025 20:07:35 +1000 Subject: [PATCH 10/23] Add `proc-macro2` and `quote` to `[workspace.dependencies]`. --- Cargo.toml | 2 ++ compiler/rustc_fluent_macro/Cargo.toml | 4 ++-- compiler/rustc_index_macros/Cargo.toml | 4 ++-- compiler/rustc_macros/Cargo.toml | 4 ++-- compiler/rustc_type_ir_macros/Cargo.toml | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d7408cd48ae74..68c4ad4658716 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,6 +68,8 @@ itertools = "0.12.1" # https://github.com/bytecodealliance/rustix/issues/1496 libc = "=0.2.174" memchr = "2.7.5" +proc-macro2 = "1.0.101" +quote = "1.0.40" rustc-literal-escaper = "0.0.5" serde_json = "1.0.142" thin-vec = "0.2.14" diff --git a/compiler/rustc_fluent_macro/Cargo.toml b/compiler/rustc_fluent_macro/Cargo.toml index d7ef4280aef05..60afd9aca87ee 100644 --- a/compiler/rustc_fluent_macro/Cargo.toml +++ b/compiler/rustc_fluent_macro/Cargo.toml @@ -11,8 +11,8 @@ proc-macro = true annotate-snippets = "0.11" fluent-bundle = "0.16" fluent-syntax = "0.12" -proc-macro2 = "1" -quote = "1" +proc-macro2.workspace = true +quote.workspace = true syn = { version = "2", features = ["full"] } unic-langid = { version = "0.9.0", features = ["macros"] } # tidy-alphabetical-end diff --git a/compiler/rustc_index_macros/Cargo.toml b/compiler/rustc_index_macros/Cargo.toml index 34f3109a526b5..8593bde261512 100644 --- a/compiler/rustc_index_macros/Cargo.toml +++ b/compiler/rustc_index_macros/Cargo.toml @@ -8,8 +8,8 @@ proc-macro = true [dependencies] # tidy-alphabetical-start -proc-macro2 = "1" -quote = "1" +proc-macro2.workspace = true +quote.workspace = true syn = { version = "2.0.9", features = ["full", "extra-traits"] } # tidy-alphabetical-end diff --git a/compiler/rustc_macros/Cargo.toml b/compiler/rustc_macros/Cargo.toml index f9d3b75835907..5add2691b886e 100644 --- a/compiler/rustc_macros/Cargo.toml +++ b/compiler/rustc_macros/Cargo.toml @@ -8,8 +8,8 @@ proc-macro = true [dependencies] # tidy-alphabetical-start -proc-macro2 = "1" -quote = "1" +proc-macro2.workspace = true +quote.workspace = true syn = { version = "2.0.9", features = ["full"] } synstructure = "0.13.0" # tidy-alphabetical-end diff --git a/compiler/rustc_type_ir_macros/Cargo.toml b/compiler/rustc_type_ir_macros/Cargo.toml index 15a5557509929..29a2cc8903354 100644 --- a/compiler/rustc_type_ir_macros/Cargo.toml +++ b/compiler/rustc_type_ir_macros/Cargo.toml @@ -8,8 +8,8 @@ proc-macro = true [dependencies] # tidy-alphabetical-start -proc-macro2 = "1" -quote = "1" +proc-macro2.workspace = true +quote.workspace = true syn = { version = "2.0.9", features = ["full"] } synstructure = "0.13.0" # tidy-alphabetical-end From ce02d34b2faa2f4b43bb438bf4f7021d54e79c92 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 27 Aug 2025 20:11:34 +1000 Subject: [PATCH 11/23] Add `rustc_apfloat` to `[workspace.dependencies]`. --- Cargo.toml | 1 + compiler/rustc_const_eval/Cargo.toml | 2 +- compiler/rustc_middle/Cargo.toml | 2 +- compiler/rustc_mir_build/Cargo.toml | 2 +- compiler/rustc_pattern_analysis/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 68c4ad4658716..d09495103846a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -71,6 +71,7 @@ memchr = "2.7.5" proc-macro2 = "1.0.101" quote = "1.0.40" rustc-literal-escaper = "0.0.5" +rustc_apfloat = "0.2.3" serde_json = "1.0.142" thin-vec = "0.2.14" tracing = "0.1.37" diff --git a/compiler/rustc_const_eval/Cargo.toml b/compiler/rustc_const_eval/Cargo.toml index 4f5e5eaa74cdb..acf19b0f2fcdb 100644 --- a/compiler/rustc_const_eval/Cargo.toml +++ b/compiler/rustc_const_eval/Cargo.toml @@ -7,7 +7,7 @@ edition = "2024" # tidy-alphabetical-start either.workspace = true rustc_abi = { path = "../rustc_abi" } -rustc_apfloat = "0.2.0" +rustc_apfloat.workspace = true rustc_ast = { path = "../rustc_ast" } rustc_data_structures = { path = "../rustc_data_structures" } rustc_errors = { path = "../rustc_errors" } diff --git a/compiler/rustc_middle/Cargo.toml b/compiler/rustc_middle/Cargo.toml index b6e20017bbf4a..ae27c3bbf67f9 100644 --- a/compiler/rustc_middle/Cargo.toml +++ b/compiler/rustc_middle/Cargo.toml @@ -10,7 +10,7 @@ either.workspace = true gsgdt = "0.1.2" polonius-engine = "0.13.0" rustc_abi = { path = "../rustc_abi" } -rustc_apfloat = "0.2.0" +rustc_apfloat.workspace = true rustc_arena = { path = "../rustc_arena" } rustc_ast = { path = "../rustc_ast" } rustc_ast_ir = { path = "../rustc_ast_ir" } diff --git a/compiler/rustc_mir_build/Cargo.toml b/compiler/rustc_mir_build/Cargo.toml index c3f7fdfcb0020..440cb0bdbf3eb 100644 --- a/compiler/rustc_mir_build/Cargo.toml +++ b/compiler/rustc_mir_build/Cargo.toml @@ -7,7 +7,7 @@ edition = "2024" # tidy-alphabetical-start itertools.workspace = true rustc_abi = { path = "../rustc_abi" } -rustc_apfloat = "0.2.0" +rustc_apfloat.workspace = true rustc_arena = { path = "../rustc_arena" } rustc_ast = { path = "../rustc_ast" } rustc_data_structures = { path = "../rustc_data_structures" } diff --git a/compiler/rustc_pattern_analysis/Cargo.toml b/compiler/rustc_pattern_analysis/Cargo.toml index 39f660c8771d5..45f43822b5cc4 100644 --- a/compiler/rustc_pattern_analysis/Cargo.toml +++ b/compiler/rustc_pattern_analysis/Cargo.toml @@ -7,7 +7,7 @@ edition = "2024" # tidy-alphabetical-start rustc-hash = "2.0.0" rustc_abi = { path = "../rustc_abi", optional = true } -rustc_apfloat = "0.2.0" +rustc_apfloat.workspace = true rustc_arena = { path = "../rustc_arena", optional = true } rustc_data_structures = { path = "../rustc_data_structures", optional = true } rustc_errors = { path = "../rustc_errors", optional = true } From 77d2f0c16e0c3957052a3ecaccd9479be8efed87 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 27 Aug 2025 20:15:19 +1000 Subject: [PATCH 12/23] Add `tempfile` to `[workspace.dependencies]`. --- Cargo.toml | 1 + compiler/rustc_codegen_ssa/Cargo.toml | 2 +- compiler/rustc_data_structures/Cargo.toml | 2 +- compiler/rustc_fs_util/Cargo.toml | 2 +- compiler/rustc_metadata/Cargo.toml | 2 +- compiler/rustc_serialize/Cargo.toml | 2 +- src/librustdoc/Cargo.toml | 2 +- src/tools/lint-docs/Cargo.toml | 2 +- src/tools/opt-dist/Cargo.toml | 2 +- 9 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d09495103846a..9938d4190336f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,6 +73,7 @@ quote = "1.0.40" rustc-literal-escaper = "0.0.5" rustc_apfloat = "0.2.3" serde_json = "1.0.142" +tempfile = "3.20.0" thin-vec = "0.2.14" tracing = "0.1.37" # tidy-alphabetical-end diff --git a/compiler/rustc_codegen_ssa/Cargo.toml b/compiler/rustc_codegen_ssa/Cargo.toml index 8588b5bf32753..57e1fee2c0a67 100644 --- a/compiler/rustc_codegen_ssa/Cargo.toml +++ b/compiler/rustc_codegen_ssa/Cargo.toml @@ -39,7 +39,7 @@ rustc_target = { path = "../rustc_target" } rustc_trait_selection = { path = "../rustc_trait_selection" } serde_json.workspace = true smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } -tempfile = "3.2" +tempfile.workspace = true thin-vec.workspace = true thorin-dwp = "0.9" tracing.workspace = true diff --git a/compiler/rustc_data_structures/Cargo.toml b/compiler/rustc_data_structures/Cargo.toml index d8d9d35cfc18f..580bbde1b10a8 100644 --- a/compiler/rustc_data_structures/Cargo.toml +++ b/compiler/rustc_data_structures/Cargo.toml @@ -25,7 +25,7 @@ rustc_serialize = { path = "../rustc_serialize" } rustc_thread_pool = { path = "../rustc_thread_pool" } smallvec = { version = "1.8.1", features = ["const_generics", "union", "may_dangle"] } stacker = "0.1.17" -tempfile = "3.2" +tempfile.workspace = true thin-vec.workspace = true tracing.workspace = true # tidy-alphabetical-end diff --git a/compiler/rustc_fs_util/Cargo.toml b/compiler/rustc_fs_util/Cargo.toml index 90a6acade8b03..37970e81fead4 100644 --- a/compiler/rustc_fs_util/Cargo.toml +++ b/compiler/rustc_fs_util/Cargo.toml @@ -5,5 +5,5 @@ edition = "2024" [dependencies] # tidy-alphabetical-start -tempfile = "3.7.1" +tempfile.workspace = true # tidy-alphabetical-end diff --git a/compiler/rustc_metadata/Cargo.toml b/compiler/rustc_metadata/Cargo.toml index 019e951fa6264..ce65a71acad11 100644 --- a/compiler/rustc_metadata/Cargo.toml +++ b/compiler/rustc_metadata/Cargo.toml @@ -30,7 +30,7 @@ rustc_serialize = { path = "../rustc_serialize" } rustc_session = { path = "../rustc_session" } rustc_span = { path = "../rustc_span" } rustc_target = { path = "../rustc_target" } -tempfile = "3.7.1" +tempfile.workspace = true tracing.workspace = true # tidy-alphabetical-end diff --git a/compiler/rustc_serialize/Cargo.toml b/compiler/rustc_serialize/Cargo.toml index e9959735f9f2e..7d81ef996c824 100644 --- a/compiler/rustc_serialize/Cargo.toml +++ b/compiler/rustc_serialize/Cargo.toml @@ -14,5 +14,5 @@ thin-vec.workspace = true [dev-dependencies] # tidy-alphabetical-start rustc_macros = { path = "../rustc_macros" } -tempfile = "3.2" +tempfile.workspace = true # tidy-alphabetical-end diff --git a/src/librustdoc/Cargo.toml b/src/librustdoc/Cargo.toml index d34b4af2d95c8..63ac9ba6aa993 100644 --- a/src/librustdoc/Cargo.toml +++ b/src/librustdoc/Cargo.toml @@ -22,7 +22,7 @@ serde = { version = "1.0", features = ["derive"] } serde_json.workspace = true smallvec = "1.8.1" stringdex = { version = "0.0.1-alpha4" } -tempfile = "3" +tempfile.workspace = true threadpool = "1.8.1" tracing-tree = "0.3.0" tracing.workspace = true diff --git a/src/tools/lint-docs/Cargo.toml b/src/tools/lint-docs/Cargo.toml index 7af4b72e5b44d..acafe17cb0cd1 100644 --- a/src/tools/lint-docs/Cargo.toml +++ b/src/tools/lint-docs/Cargo.toml @@ -9,5 +9,5 @@ description = "A script to extract the lint documentation for the rustc book." [dependencies] rustc-literal-escaper = "0.0.5" serde_json.workspace = true -tempfile = "3.1.0" +tempfile.workspace = true walkdir = "2.3.1" diff --git a/src/tools/opt-dist/Cargo.toml b/src/tools/opt-dist/Cargo.toml index e419a75f5f272..b2833a9d7f1a6 100644 --- a/src/tools/opt-dist/Cargo.toml +++ b/src/tools/opt-dist/Cargo.toml @@ -17,7 +17,7 @@ tar = "0.4" xz = { version = "0.1", package = "xz2" } serde_json.workspace = true glob = "0.3" -tempfile = "3.5" +tempfile.workspace = true derive_builder = "0.20" clap = { version = "4", features = ["derive"] } tabled = { version = "0.15", default-features = false, features = ["std"] } From 77b047aaab6de9ec20b3c4f2fa57743c16d8789c Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 27 Aug 2025 20:20:12 +1000 Subject: [PATCH 13/23] Add `indexmap` to `[workspace.dependencies]`. --- Cargo.toml | 1 + compiler/rustc_data_structures/Cargo.toml | 2 +- compiler/rustc_resolve/Cargo.toml | 2 +- compiler/rustc_serialize/Cargo.toml | 2 +- compiler/rustc_span/Cargo.toml | 2 +- compiler/rustc_type_ir/Cargo.toml | 2 +- src/librustdoc/Cargo.toml | 2 +- src/tools/compiletest/Cargo.toml | 2 +- 8 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9938d4190336f..4f4dd83f41535 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,6 +63,7 @@ exclude = [ # tidy-alphabetical-start bitflags = "2.9.3" either = "1.15.0" +indexmap = "2.10.0" itertools = "0.12.1" # FIXME: Remove this pin once this rustix issue is resolved # https://github.com/bytecodealliance/rustix/issues/1496 diff --git a/compiler/rustc_data_structures/Cargo.toml b/compiler/rustc_data_structures/Cargo.toml index 580bbde1b10a8..949a5a9ac800a 100644 --- a/compiler/rustc_data_structures/Cargo.toml +++ b/compiler/rustc_data_structures/Cargo.toml @@ -10,7 +10,7 @@ bitflags.workspace = true either.workspace = true elsa = "1.11.0" ena = "0.14.3" -indexmap = "2.4.0" +indexmap.workspace = true jobserver_crate = { version = "0.1.28", package = "jobserver" } measureme = "12.0.1" parking_lot = "0.12" diff --git a/compiler/rustc_resolve/Cargo.toml b/compiler/rustc_resolve/Cargo.toml index 7c5332c166238..4da4c0840dfab 100644 --- a/compiler/rustc_resolve/Cargo.toml +++ b/compiler/rustc_resolve/Cargo.toml @@ -6,7 +6,7 @@ edition = "2024" [dependencies] # tidy-alphabetical-start bitflags.workspace = true -indexmap = "2.4.0" +indexmap.workspace = true itertools.workspace = true pulldown-cmark = { version = "0.11", features = ["html"], default-features = false } rustc_arena = { path = "../rustc_arena" } diff --git a/compiler/rustc_serialize/Cargo.toml b/compiler/rustc_serialize/Cargo.toml index 7d81ef996c824..853f87ebed96f 100644 --- a/compiler/rustc_serialize/Cargo.toml +++ b/compiler/rustc_serialize/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" [dependencies] # tidy-alphabetical-start -indexmap = "2.0.0" +indexmap.workspace = true rustc_hashes = { path = "../rustc_hashes" } smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } thin-vec.workspace = true diff --git a/compiler/rustc_span/Cargo.toml b/compiler/rustc_span/Cargo.toml index 2e45177e3b744..8368c9656e2d5 100644 --- a/compiler/rustc_span/Cargo.toml +++ b/compiler/rustc_span/Cargo.toml @@ -7,7 +7,7 @@ edition = "2024" # tidy-alphabetical-start blake3 = "1.5.2" derive-where = "1.2.7" -indexmap = { version = "2.0.0" } +indexmap.workspace = true itoa = "1.0" md5 = { package = "md-5", version = "0.10.0" } rustc_arena = { path = "../rustc_arena" } diff --git a/compiler/rustc_type_ir/Cargo.toml b/compiler/rustc_type_ir/Cargo.toml index 1dba7fe426930..bcd321d0c5ff3 100644 --- a/compiler/rustc_type_ir/Cargo.toml +++ b/compiler/rustc_type_ir/Cargo.toml @@ -8,7 +8,7 @@ edition = "2024" bitflags.workspace = true derive-where = "1.2.7" ena = "0.14.3" -indexmap = "2.0.0" +indexmap.workspace = true rustc-hash = "2.0.0" rustc_ast_ir = { path = "../rustc_ast_ir", default-features = false } rustc_data_structures = { path = "../rustc_data_structures", optional = true } diff --git a/src/librustdoc/Cargo.toml b/src/librustdoc/Cargo.toml index 63ac9ba6aa993..2985971a053f5 100644 --- a/src/librustdoc/Cargo.toml +++ b/src/librustdoc/Cargo.toml @@ -12,7 +12,7 @@ path = "lib.rs" arrayvec = { version = "0.7", default-features = false } askama = { version = "0.14", default-features = false, features = ["alloc", "config", "derive"] } base64 = "0.21.7" -indexmap = "2" +indexmap.workspace = true itertools.workspace = true minifier = { version = "0.3.5", default-features = false } pulldown-cmark-escape = { version = "0.11.0", features = ["simd"] } diff --git a/src/tools/compiletest/Cargo.toml b/src/tools/compiletest/Cargo.toml index 6f21c7db4874c..fb71275b03c71 100644 --- a/src/tools/compiletest/Cargo.toml +++ b/src/tools/compiletest/Cargo.toml @@ -20,7 +20,7 @@ diff = "0.1.10" getopts = "0.2" glob = "0.3.0" home = "0.5.5" -indexmap = "2.0.0" +indexmap.workspace = true miropt-test-tools = { path = "../miropt-test-tools" } rayon = "1.10.0" regex = "1.0" From 2b26476ccd8c5a6c03ba513b37381ebb6532c980 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 27 Aug 2025 20:24:41 +1000 Subject: [PATCH 14/23] Add `rustc-hash` to `[workspace.dependencies]`. --- Cargo.toml | 1 + compiler/rustc_data_structures/Cargo.toml | 2 +- compiler/rustc_pattern_analysis/Cargo.toml | 2 +- compiler/rustc_type_ir/Cargo.toml | 2 +- src/tools/jsondoclint/Cargo.toml | 2 +- src/tools/tidy/Cargo.toml | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4f4dd83f41535..fc161df5b2b37 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -71,6 +71,7 @@ libc = "=0.2.174" memchr = "2.7.5" proc-macro2 = "1.0.101" quote = "1.0.40" +rustc-hash = "2.1.1" rustc-literal-escaper = "0.0.5" rustc_apfloat = "0.2.3" serde_json = "1.0.142" diff --git a/compiler/rustc_data_structures/Cargo.toml b/compiler/rustc_data_structures/Cargo.toml index 949a5a9ac800a..c4011f59a1e0f 100644 --- a/compiler/rustc_data_structures/Cargo.toml +++ b/compiler/rustc_data_structures/Cargo.toml @@ -14,7 +14,7 @@ indexmap.workspace = true jobserver_crate = { version = "0.1.28", package = "jobserver" } measureme = "12.0.1" parking_lot = "0.12" -rustc-hash = "2.0.0" +rustc-hash.workspace = true rustc-stable-hash = { version = "0.1.0", features = ["nightly"] } rustc_arena = { path = "../rustc_arena" } rustc_graphviz = { path = "../rustc_graphviz" } diff --git a/compiler/rustc_pattern_analysis/Cargo.toml b/compiler/rustc_pattern_analysis/Cargo.toml index 45f43822b5cc4..e4909ab6d1628 100644 --- a/compiler/rustc_pattern_analysis/Cargo.toml +++ b/compiler/rustc_pattern_analysis/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" [dependencies] # tidy-alphabetical-start -rustc-hash = "2.0.0" +rustc-hash.workspace = true rustc_abi = { path = "../rustc_abi", optional = true } rustc_apfloat.workspace = true rustc_arena = { path = "../rustc_arena", optional = true } diff --git a/compiler/rustc_type_ir/Cargo.toml b/compiler/rustc_type_ir/Cargo.toml index bcd321d0c5ff3..ac7a5329448b0 100644 --- a/compiler/rustc_type_ir/Cargo.toml +++ b/compiler/rustc_type_ir/Cargo.toml @@ -9,7 +9,7 @@ bitflags.workspace = true derive-where = "1.2.7" ena = "0.14.3" indexmap.workspace = true -rustc-hash = "2.0.0" +rustc-hash.workspace = true rustc_ast_ir = { path = "../rustc_ast_ir", default-features = false } rustc_data_structures = { path = "../rustc_data_structures", optional = true } rustc_error_messages = { path = "../rustc_error_messages", optional = true } diff --git a/src/tools/jsondoclint/Cargo.toml b/src/tools/jsondoclint/Cargo.toml index d8cd59f7b4227..44beaf2ddfd23 100644 --- a/src/tools/jsondoclint/Cargo.toml +++ b/src/tools/jsondoclint/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" anyhow = "1.0.62" clap = { version = "4.0.15", features = ["derive"] } fs-err = "2.8.1" -rustc-hash = "2.0.0" +rustc-hash.workspace = true rustdoc-json-types = { version = "0.1.0", path = "../../rustdoc-json-types" } serde = { version = "1.0", features = ["derive"] } serde_json.workspace = true diff --git a/src/tools/tidy/Cargo.toml b/src/tools/tidy/Cargo.toml index c1f27de7ed4a5..f43733665edda 100644 --- a/src/tools/tidy/Cargo.toml +++ b/src/tools/tidy/Cargo.toml @@ -14,7 +14,7 @@ ignore = "0.4.18" semver = "1.0" serde = { version = "1.0.125", features = ["derive"], optional = true } termcolor = "1.1.3" -rustc-hash = "2.0.0" +rustc-hash.workspace = true fluent-syntax = "0.12" similar = "2.5.0" toml = "0.7.8" From e692c97ad3f6beb59617b9720f30f616e5fbc431 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 27 Aug 2025 22:08:35 +1000 Subject: [PATCH 15/23] Add `derive-where` to `[workspace.dependencies]`. --- Cargo.toml | 1 + compiler/rustc_next_trait_solver/Cargo.toml | 2 +- compiler/rustc_span/Cargo.toml | 2 +- compiler/rustc_type_ir/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fc161df5b2b37..171138481c33c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,6 +62,7 @@ exclude = [ [workspace.dependencies] # tidy-alphabetical-start bitflags = "2.9.3" +derive-where = "1.6.0" either = "1.15.0" indexmap = "2.10.0" itertools = "0.12.1" diff --git a/compiler/rustc_next_trait_solver/Cargo.toml b/compiler/rustc_next_trait_solver/Cargo.toml index 8b66f30cf0e97..43db90c08f3f5 100644 --- a/compiler/rustc_next_trait_solver/Cargo.toml +++ b/compiler/rustc_next_trait_solver/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" [dependencies] # tidy-alphabetical-start -derive-where = "1.2.7" +derive-where.workspace = true rustc_data_structures = { path = "../rustc_data_structures", optional = true } rustc_index = { path = "../rustc_index", default-features = false } rustc_macros = { path = "../rustc_macros", optional = true } diff --git a/compiler/rustc_span/Cargo.toml b/compiler/rustc_span/Cargo.toml index 8368c9656e2d5..6283e47e1fee9 100644 --- a/compiler/rustc_span/Cargo.toml +++ b/compiler/rustc_span/Cargo.toml @@ -6,7 +6,7 @@ edition = "2024" [dependencies] # tidy-alphabetical-start blake3 = "1.5.2" -derive-where = "1.2.7" +derive-where.workspace = true indexmap.workspace = true itoa = "1.0" md5 = { package = "md-5", version = "0.10.0" } diff --git a/compiler/rustc_type_ir/Cargo.toml b/compiler/rustc_type_ir/Cargo.toml index ac7a5329448b0..42860fa2d88da 100644 --- a/compiler/rustc_type_ir/Cargo.toml +++ b/compiler/rustc_type_ir/Cargo.toml @@ -6,7 +6,7 @@ edition = "2024" [dependencies] # tidy-alphabetical-start bitflags.workspace = true -derive-where = "1.2.7" +derive-where.workspace = true ena = "0.14.3" indexmap.workspace = true rustc-hash.workspace = true From 8fc0813e292e9772f28462a57f51f79a24c63774 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 27 Aug 2025 22:10:04 +1000 Subject: [PATCH 16/23] Add `measureme` to `[workspace.dependencies]`. --- Cargo.toml | 1 + compiler/rustc_codegen_llvm/Cargo.toml | 2 +- compiler/rustc_data_structures/Cargo.toml | 2 +- compiler/rustc_query_impl/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 171138481c33c..94464439df8b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,6 +69,7 @@ itertools = "0.12.1" # FIXME: Remove this pin once this rustix issue is resolved # https://github.com/bytecodealliance/rustix/issues/1496 libc = "=0.2.174" +measureme = "12.0.3" memchr = "2.7.5" proc-macro2 = "1.0.101" quote = "1.0.40" diff --git a/compiler/rustc_codegen_llvm/Cargo.toml b/compiler/rustc_codegen_llvm/Cargo.toml index 18c5189a4022e..5961cbb103383 100644 --- a/compiler/rustc_codegen_llvm/Cargo.toml +++ b/compiler/rustc_codegen_llvm/Cargo.toml @@ -14,7 +14,7 @@ bitflags.workspace = true gimli = "0.31" itertools.workspace = true libc.workspace = true -measureme = "12.0.1" +measureme.workspace = true object = { version = "0.37.0", default-features = false, features = ["std", "read"] } rustc-demangle = "0.1.21" rustc_abi = { path = "../rustc_abi" } diff --git a/compiler/rustc_data_structures/Cargo.toml b/compiler/rustc_data_structures/Cargo.toml index c4011f59a1e0f..852fc11350b19 100644 --- a/compiler/rustc_data_structures/Cargo.toml +++ b/compiler/rustc_data_structures/Cargo.toml @@ -12,7 +12,7 @@ elsa = "1.11.0" ena = "0.14.3" indexmap.workspace = true jobserver_crate = { version = "0.1.28", package = "jobserver" } -measureme = "12.0.1" +measureme.workspace = true parking_lot = "0.12" rustc-hash.workspace = true rustc-stable-hash = { version = "0.1.0", features = ["nightly"] } diff --git a/compiler/rustc_query_impl/Cargo.toml b/compiler/rustc_query_impl/Cargo.toml index 2005b8b9eca50..3d5cf0eb72df3 100644 --- a/compiler/rustc_query_impl/Cargo.toml +++ b/compiler/rustc_query_impl/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" [dependencies] # tidy-alphabetical-start -measureme = "12.0.1" +measureme.workspace = true rustc_data_structures = { path = "../rustc_data_structures" } rustc_hashes = { path = "../rustc_hashes" } rustc_hir = { path = "../rustc_hir" } From 42359b7026dbb4b68b3415582fabd8def56d6a8e Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 27 Aug 2025 22:13:29 +1000 Subject: [PATCH 17/23] Add `scoped-tls` to `[workspace.dependencies]`. --- Cargo.toml | 1 + compiler/rustc_public/Cargo.toml | 2 +- compiler/rustc_span/Cargo.toml | 2 +- compiler/rustc_thread_pool/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 94464439df8b7..378aa5ada2f9d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -76,6 +76,7 @@ quote = "1.0.40" rustc-hash = "2.1.1" rustc-literal-escaper = "0.0.5" rustc_apfloat = "0.2.3" +scoped-tls = "1.0.1" serde_json = "1.0.142" tempfile = "3.20.0" thin-vec = "0.2.14" diff --git a/compiler/rustc_public/Cargo.toml b/compiler/rustc_public/Cargo.toml index 71d339b5792a0..e67e4fe67396e 100644 --- a/compiler/rustc_public/Cargo.toml +++ b/compiler/rustc_public/Cargo.toml @@ -12,7 +12,7 @@ rustc_public_bridge = { path = "../rustc_public_bridge" } rustc_session = { path = "../rustc_session" } rustc_span = { path = "../rustc_span" } rustc_target = { path = "../rustc_target" } -scoped-tls = "1.0" +scoped-tls.workspace = true serde = { version = "1.0.125", features = [ "derive" ] } tracing.workspace = true # tidy-alphabetical-end diff --git a/compiler/rustc_span/Cargo.toml b/compiler/rustc_span/Cargo.toml index 6283e47e1fee9..da6f2101d234b 100644 --- a/compiler/rustc_span/Cargo.toml +++ b/compiler/rustc_span/Cargo.toml @@ -16,7 +16,7 @@ rustc_hashes = { path = "../rustc_hashes" } rustc_index = { path = "../rustc_index" } rustc_macros = { path = "../rustc_macros" } rustc_serialize = { path = "../rustc_serialize" } -scoped-tls = "1.0" +scoped-tls.workspace = true sha1 = "0.10.0" sha2 = "0.10.1" tracing.workspace = true diff --git a/compiler/rustc_thread_pool/Cargo.toml b/compiler/rustc_thread_pool/Cargo.toml index 3eafb308192d0..8e8c6469512bb 100644 --- a/compiler/rustc_thread_pool/Cargo.toml +++ b/compiler/rustc_thread_pool/Cargo.toml @@ -20,7 +20,7 @@ smallvec = "1.8.1" [dev-dependencies] rand = "0.9" rand_xorshift = "0.4" -scoped-tls = "1.0" +scoped-tls.workspace = true [target.'cfg(unix)'.dev-dependencies] libc.workspace = true From 20d03752c5a1c6ea4f81fcb09505977a6c945d8b Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 28 Aug 2025 07:33:35 +1000 Subject: [PATCH 18/23] Add `odht` to `[workspace.dependencies]`. --- Cargo.toml | 1 + compiler/rustc_hir/Cargo.toml | 2 +- compiler/rustc_metadata/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 378aa5ada2f9d..69d93b7985ef1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -71,6 +71,7 @@ itertools = "0.12.1" libc = "=0.2.174" measureme = "12.0.3" memchr = "2.7.5" +odht = { version = "0.3.1", features = ["nightly"] } proc-macro2 = "1.0.101" quote = "1.0.40" rustc-hash = "2.1.1" diff --git a/compiler/rustc_hir/Cargo.toml b/compiler/rustc_hir/Cargo.toml index ea72ed68c5ef7..e74fcfe74559c 100644 --- a/compiler/rustc_hir/Cargo.toml +++ b/compiler/rustc_hir/Cargo.toml @@ -6,7 +6,7 @@ edition = "2024" [dependencies] # tidy-alphabetical-start bitflags.workspace = true -odht = { version = "0.3.1", features = ["nightly"] } +odht.workspace = true rustc_abi = { path = "../rustc_abi" } rustc_arena = { path = "../rustc_arena" } rustc_ast = { path = "../rustc_ast" } diff --git a/compiler/rustc_metadata/Cargo.toml b/compiler/rustc_metadata/Cargo.toml index ce65a71acad11..a8f3dd18353c1 100644 --- a/compiler/rustc_metadata/Cargo.toml +++ b/compiler/rustc_metadata/Cargo.toml @@ -7,7 +7,7 @@ edition = "2024" # tidy-alphabetical-start bitflags.workspace = true libloading = "0.8.0" -odht = { version = "0.3.1", features = ["nightly"] } +odht.workspace = true rustc_abi = { path = "../rustc_abi" } rustc_ast = { path = "../rustc_ast" } rustc_attr_parsing = { path = "../rustc_attr_parsing" } From b16c66ee838ba77331cefa3e1747899978b76ff7 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 28 Aug 2025 07:43:31 +1000 Subject: [PATCH 19/23] Add `polonius-engine` to `[workspace.dependencies]`. --- Cargo.toml | 1 + compiler/rustc_borrowck/Cargo.toml | 2 +- compiler/rustc_middle/Cargo.toml | 2 +- compiler/rustc_mir_dataflow/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 69d93b7985ef1..01935b7daff34 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,6 +72,7 @@ libc = "=0.2.174" measureme = "12.0.3" memchr = "2.7.5" odht = { version = "0.3.1", features = ["nightly"] } +polonius-engine = "0.13.0" proc-macro2 = "1.0.101" quote = "1.0.40" rustc-hash = "2.1.1" diff --git a/compiler/rustc_borrowck/Cargo.toml b/compiler/rustc_borrowck/Cargo.toml index c0311ff414d70..5f9dc41766bc6 100644 --- a/compiler/rustc_borrowck/Cargo.toml +++ b/compiler/rustc_borrowck/Cargo.toml @@ -7,7 +7,7 @@ edition = "2024" # tidy-alphabetical-start either.workspace = true itertools.workspace = true -polonius-engine = "0.13.0" +polonius-engine.workspace = true rustc_abi = { path = "../rustc_abi" } rustc_data_structures = { path = "../rustc_data_structures" } rustc_errors = { path = "../rustc_errors" } diff --git a/compiler/rustc_middle/Cargo.toml b/compiler/rustc_middle/Cargo.toml index ae27c3bbf67f9..f08324055672d 100644 --- a/compiler/rustc_middle/Cargo.toml +++ b/compiler/rustc_middle/Cargo.toml @@ -8,7 +8,7 @@ edition = "2024" bitflags.workspace = true either.workspace = true gsgdt = "0.1.2" -polonius-engine = "0.13.0" +polonius-engine.workspace = true rustc_abi = { path = "../rustc_abi" } rustc_apfloat.workspace = true rustc_arena = { path = "../rustc_arena" } diff --git a/compiler/rustc_mir_dataflow/Cargo.toml b/compiler/rustc_mir_dataflow/Cargo.toml index e422f69c7ca07..11713bb77f1ee 100644 --- a/compiler/rustc_mir_dataflow/Cargo.toml +++ b/compiler/rustc_mir_dataflow/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" [dependencies] # tidy-alphabetical-start -polonius-engine = "0.13.0" +polonius-engine.workspace = true regex = "1" rustc_abi = { path = "../rustc_abi" } rustc_ast = { path = "../rustc_ast" } From 475c29d30f7d31c63fad132908fa325a4fc30efe Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 28 Aug 2025 07:46:26 +1000 Subject: [PATCH 20/23] Add `rustc-demangle` to `[workspace.dependencies]`. --- Cargo.toml | 1 + compiler/rustc_codegen_llvm/Cargo.toml | 2 +- compiler/rustc_symbol_mangling/Cargo.toml | 2 +- src/tools/coverage-dump/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 01935b7daff34..2c5044f6a3550 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,6 +75,7 @@ odht = { version = "0.3.1", features = ["nightly"] } polonius-engine = "0.13.0" proc-macro2 = "1.0.101" quote = "1.0.40" +rustc-demangle = "0.1.26" rustc-hash = "2.1.1" rustc-literal-escaper = "0.0.5" rustc_apfloat = "0.2.3" diff --git a/compiler/rustc_codegen_llvm/Cargo.toml b/compiler/rustc_codegen_llvm/Cargo.toml index 5961cbb103383..b04310f3d5449 100644 --- a/compiler/rustc_codegen_llvm/Cargo.toml +++ b/compiler/rustc_codegen_llvm/Cargo.toml @@ -16,7 +16,7 @@ itertools.workspace = true libc.workspace = true measureme.workspace = true object = { version = "0.37.0", default-features = false, features = ["std", "read"] } -rustc-demangle = "0.1.21" +rustc-demangle.workspace = true rustc_abi = { path = "../rustc_abi" } rustc_ast = { path = "../rustc_ast" } rustc_codegen_ssa = { path = "../rustc_codegen_ssa" } diff --git a/compiler/rustc_symbol_mangling/Cargo.toml b/compiler/rustc_symbol_mangling/Cargo.toml index 48e02dabdde74..0ceac4b3e1b3c 100644 --- a/compiler/rustc_symbol_mangling/Cargo.toml +++ b/compiler/rustc_symbol_mangling/Cargo.toml @@ -6,7 +6,7 @@ edition = "2024" [dependencies] # tidy-alphabetical-start punycode = "0.4.0" -rustc-demangle = "0.1.21" +rustc-demangle.workspace = true rustc_abi = { path = "../rustc_abi" } rustc_data_structures = { path = "../rustc_data_structures" } rustc_errors = { path = "../rustc_errors" } diff --git a/src/tools/coverage-dump/Cargo.toml b/src/tools/coverage-dump/Cargo.toml index 2f703537b59e5..e491804c2574f 100644 --- a/src/tools/coverage-dump/Cargo.toml +++ b/src/tools/coverage-dump/Cargo.toml @@ -12,4 +12,4 @@ leb128 = "0.2.5" md5 = { package = "md-5" , version = "0.10.5" } miniz_oxide = "0.8.8" regex = "1.8.4" -rustc-demangle = "0.1.23" +rustc-demangle.workspace = true From df802ccd2fad88ea617622ae0bf89067a250145e Mon Sep 17 00:00:00 2001 From: neeko-cat <60898184+neeko-cat@users.noreply.github.com> Date: Thu, 28 Aug 2025 22:19:37 +0200 Subject: [PATCH 21/23] fix `core::marker::Destruct` doc --- library/core/src/marker.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index 8ad58599c6815..73aad27afef6f 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -1049,7 +1049,7 @@ marker_impls! { /// A marker for types that can be dropped. /// -/// This should be used for `~const` bounds, +/// This should be used for `[const]` bounds, /// as non-const bounds will always hold for every type. #[unstable(feature = "const_destruct", issue = "133214")] #[rustc_const_unstable(feature = "const_destruct", issue = "133214")] From 1a33d628df211c92650e357c291097b6ce4f223f Mon Sep 17 00:00:00 2001 From: Jeremy Smart Date: Thu, 28 Aug 2025 18:37:58 -0400 Subject: [PATCH 22/23] implement Sum and Product for Saturating(u*) --- library/core/src/iter/traits/accum.rs | 58 +++++++++++++++++++- library/coretests/tests/iter/traits/accum.rs | 36 ++++++++++++ 2 files changed, 93 insertions(+), 1 deletion(-) diff --git a/library/core/src/iter/traits/accum.rs b/library/core/src/iter/traits/accum.rs index 12e2b8b393a88..73122369b41dd 100644 --- a/library/core/src/iter/traits/accum.rs +++ b/library/core/src/iter/traits/accum.rs @@ -1,5 +1,5 @@ use crate::iter; -use crate::num::Wrapping; +use crate::num::{Saturating, Wrapping}; /// Trait to represent types that can be created by summing up an iterator. /// @@ -98,6 +98,61 @@ macro_rules! integer_sum_product { ); } +macro_rules! saturating_integer_sum_product { + (@impls $zero:expr, $one:expr, $doc:expr, #[$attr:meta], $($a:ty)*) => ($( + #[$attr] + #[doc = $doc] + impl Sum for $a { + fn sum>(iter: I) -> Self { + iter.fold( + $zero, + |a, b| a + b, + ) + } + } + + #[$attr] + #[doc = $doc] + impl Product for $a { + fn product>(iter: I) -> Self { + iter.fold( + $one, + |a, b| a * b, + ) + } + } + + #[$attr] + #[doc = $doc] + impl<'a> Sum<&'a $a> for $a { + fn sum>(iter: I) -> Self { + iter.fold( + $zero, + |a, b| a + b, + ) + } + } + + #[$attr] + #[doc = $doc] + impl<'a> Product<&'a $a> for $a { + fn product>(iter: I) -> Self { + iter.fold( + $one, + |a, b| a * b, + ) + } + } + )*); + ($($a:ty)*) => ( + saturating_integer_sum_product!(@impls Saturating(0), Saturating(1), + "The short-circuiting behavior of this implementation is unspecified. If you care about \ + short-circuiting, use [`Iterator::fold`] directly.", + #[stable(feature = "saturating_iter_arith", since = "CURRENT_RUSTC_VERSION")], + $(Saturating<$a>)*); + ); +} + macro_rules! float_sum_product { ($($a:ident)*) => ($( #[stable(feature = "iter_arith_traits", since = "1.12.0")] @@ -147,6 +202,7 @@ macro_rules! float_sum_product { } integer_sum_product! { i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize } +saturating_integer_sum_product! { u8 u16 u32 u64 u128 usize } float_sum_product! { f32 f64 } #[stable(feature = "iter_arith_traits_result", since = "1.16.0")] diff --git a/library/coretests/tests/iter/traits/accum.rs b/library/coretests/tests/iter/traits/accum.rs index f3eeb31fe5803..95f299d2680f8 100644 --- a/library/coretests/tests/iter/traits/accum.rs +++ b/library/coretests/tests/iter/traits/accum.rs @@ -1,4 +1,5 @@ use core::iter::*; +use std::num::Saturating; #[test] fn test_iterator_sum() { @@ -64,3 +65,38 @@ fn test_iterator_product_option() { let v: &[Option] = &[Some(1), None, Some(3), Some(4)]; assert_eq!(v.iter().cloned().product::>(), None); } + +#[test] +fn test_saturating_sum_product() { + let v = (1u32..=10).map(|i| Saturating(i)); + assert_eq!(v.sum::>(), Saturating(55)); + let v = (1u32..=10).map(|i| Saturating(i)); + assert_eq!(v.product::>(), Saturating(3628800)); + let v = [Saturating(usize::MAX), Saturating(2)]; + assert_eq!(v.iter().copied().sum::>(), Saturating(usize::MAX)); + assert_eq!(v.iter().copied().product::>(), Saturating(usize::MAX)); + + let mut cnt = 0; + let v = 250..=u8::MAX; + assert_eq!( + v.map(|i| { + cnt += 1; + Saturating(i) + }) + .sum::>(), + Saturating(u8::MAX) + ); + assert_eq!(cnt, 6); // no short-circuiting + + let mut cnt = 0; + let v = (250..=u8::MAX).chain(0..5); + assert_eq!( + v.map(|i| { + cnt += 1; + Saturating(i) + }) + .product::>(), + Saturating(0) + ); + assert_eq!(cnt, 11); // no short-circuiting +} From a54567e76ce0b32c6d48d019ab4bd9c8a7070933 Mon Sep 17 00:00:00 2001 From: Caiweiran Date: Fri, 29 Aug 2025 08:11:48 +0000 Subject: [PATCH 23/23] tests: Ignore basic-stepping.rs on riscv64 --- tests/debuginfo/basic-stepping.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/debuginfo/basic-stepping.rs b/tests/debuginfo/basic-stepping.rs index e7a70c8b087ba..f6399814a43a8 100644 --- a/tests/debuginfo/basic-stepping.rs +++ b/tests/debuginfo/basic-stepping.rs @@ -4,6 +4,7 @@ //@ ignore-aarch64: Doesn't work yet. //@ ignore-loongarch64: Doesn't work yet. +//@ ignore-riscv64: Doesn't work yet. //@ compile-flags: -g // gdb-command: run