From e0637766029752d6d9a2aaf088edbc469b4f66a0 Mon Sep 17 00:00:00 2001 From: Guillaume Date: Wed, 4 Mar 2026 01:00:11 +0100 Subject: [PATCH 01/19] Fix LegacyKeyValueFormat report from docker build: powerpc --- src/ci/docker/host-x86_64/dist-powerpc-linux/Dockerfile | 4 ++-- .../docker/host-x86_64/dist-powerpc64-linux-gnu/Dockerfile | 4 ++-- .../host-x86_64/dist-powerpc64-linux-musl/Dockerfile | 7 +++---- .../host-x86_64/dist-powerpc64le-linux-gnu/Dockerfile | 7 +++---- .../host-x86_64/dist-powerpc64le-linux-musl/Dockerfile | 7 +++---- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/ci/docker/host-x86_64/dist-powerpc-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-powerpc-linux/Dockerfile index 7081d9527f06..825392414671 100644 --- a/src/ci/docker/host-x86_64/dist-powerpc-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-powerpc-linux/Dockerfile @@ -26,5 +26,5 @@ ENV \ ENV HOSTS=powerpc-unknown-linux-gnu -ENV RUST_CONFIGURE_ARGS --enable-extended --enable-profiler --disable-docs -ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS +ENV RUST_CONFIGURE_ARGS="--enable-extended --enable-profiler --disable-docs" +ENV SCRIPT="python3 ../x.py dist --host $HOSTS --target $HOSTS" diff --git a/src/ci/docker/host-x86_64/dist-powerpc64-linux-gnu/Dockerfile b/src/ci/docker/host-x86_64/dist-powerpc64-linux-gnu/Dockerfile index 046406224c34..ad0e21019017 100644 --- a/src/ci/docker/host-x86_64/dist-powerpc64-linux-gnu/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-powerpc64-linux-gnu/Dockerfile @@ -26,5 +26,5 @@ ENV \ ENV HOSTS=powerpc64-unknown-linux-gnu -ENV RUST_CONFIGURE_ARGS --enable-extended --enable-profiler --disable-docs -ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS +ENV RUST_CONFIGURE_ARGS="--enable-extended --enable-profiler --disable-docs" +ENV SCRIPT="python3 ../x.py dist --host $HOSTS --target $HOSTS" diff --git a/src/ci/docker/host-x86_64/dist-powerpc64-linux-musl/Dockerfile b/src/ci/docker/host-x86_64/dist-powerpc64-linux-musl/Dockerfile index 7c8a1e657ac2..17783b9c7358 100644 --- a/src/ci/docker/host-x86_64/dist-powerpc64-linux-musl/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-powerpc64-linux-musl/Dockerfile @@ -27,13 +27,12 @@ ENV \ ENV HOSTS=powerpc64-unknown-linux-musl -ENV RUST_CONFIGURE_ARGS \ - --enable-extended \ +ENV RUST_CONFIGURE_ARGS="--enable-extended \ --enable-full-tools \ --enable-profiler \ --enable-sanitizers \ --disable-docs \ --set target.powerpc64-unknown-linux-musl.crt-static=false \ - --musl-root-powerpc64=/x-tools/powerpc64-unknown-linux-musl/powerpc64-unknown-linux-musl/sysroot/usr + --musl-root-powerpc64=/x-tools/powerpc64-unknown-linux-musl/powerpc64-unknown-linux-musl/sysroot/usr" -ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS +ENV SCRIPT="python3 ../x.py dist --host $HOSTS --target $HOSTS" diff --git a/src/ci/docker/host-x86_64/dist-powerpc64le-linux-gnu/Dockerfile b/src/ci/docker/host-x86_64/dist-powerpc64le-linux-gnu/Dockerfile index e3ba51e8ffce..6a9573cb4231 100644 --- a/src/ci/docker/host-x86_64/dist-powerpc64le-linux-gnu/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-powerpc64le-linux-gnu/Dockerfile @@ -27,11 +27,10 @@ ENV \ ENV HOSTS=powerpc64le-unknown-linux-gnu -ENV RUST_CONFIGURE_ARGS \ - --enable-extended \ +ENV RUST_CONFIGURE_ARGS="--enable-extended \ --enable-full-tools \ --enable-profiler \ --enable-sanitizers \ - --disable-docs + --disable-docs" -ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS +ENV SCRIPT="python3 ../x.py dist --host $HOSTS --target $HOSTS" diff --git a/src/ci/docker/host-x86_64/dist-powerpc64le-linux-musl/Dockerfile b/src/ci/docker/host-x86_64/dist-powerpc64le-linux-musl/Dockerfile index 601c8e905858..be16966fbe1b 100644 --- a/src/ci/docker/host-x86_64/dist-powerpc64le-linux-musl/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-powerpc64le-linux-musl/Dockerfile @@ -27,13 +27,12 @@ ENV \ ENV HOSTS=powerpc64le-unknown-linux-musl -ENV RUST_CONFIGURE_ARGS \ - --enable-extended \ +ENV RUST_CONFIGURE_ARGS="--enable-extended \ --enable-full-tools \ --enable-profiler \ --enable-sanitizers \ --disable-docs \ --set target.powerpc64le-unknown-linux-musl.crt-static=false \ - --musl-root-powerpc64le=/x-tools/powerpc64le-unknown-linux-musl/powerpc64le-unknown-linux-musl/sysroot/usr + --musl-root-powerpc64le=/x-tools/powerpc64le-unknown-linux-musl/powerpc64le-unknown-linux-musl/sysroot/usr" -ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS +ENV SCRIPT="python3 ../x.py dist --host $HOSTS --target $HOSTS" From 2e657348a9522c1d54570e4914fbf6d44f0a7be3 Mon Sep 17 00:00:00 2001 From: may Date: Tue, 24 Mar 2026 16:23:09 +0100 Subject: [PATCH 02/19] feat: reimplement `hash_map!` macro Co-authored-by: stifskere --- library/std/src/lib.rs | 2 ++ library/std/src/macros.rs | 76 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index c8c8a6c89714..3f4ac35674f6 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -337,6 +337,8 @@ #![feature(formatting_options)] #![feature(funnel_shifts)] #![feature(generic_atomic)] +#![feature(hash_map_internals)] +#![feature(hash_map_macro)] #![feature(hasher_prefixfree_extras)] #![feature(hashmap_internals)] #![feature(hint_must_use)] diff --git a/library/std/src/macros.rs b/library/std/src/macros.rs index 0bb14552432d..cc000274ea8d 100644 --- a/library/std/src/macros.rs +++ b/library/std/src/macros.rs @@ -414,3 +414,79 @@ macro_rules! dbg { } }, } + +#[doc(hidden)] +#[macro_export] +#[allow_internal_unstable(hash_map_internals)] +#[unstable(feature = "hash_map_internals", issue = "none")] +macro_rules! repetition_utils { + (@count $($tokens:tt),*) => {{ + [$($crate::repetition_utils!(@replace $tokens => ())),*].len() + }}; + + (@replace $x:tt => $y:tt) => { $y } +} + +/// Creates a [`HashMap`] containing the arguments. +/// +/// `hash_map!` allows specifying the entries that make +/// up the [`HashMap`] where the key and value are separated by a `=>`. +/// +/// The entries are separated by commas with a trailing comma being allowed. +/// +/// It is semantically equivalent to using repeated [`HashMap::insert`] +/// on a newly created hashmap. +/// +/// `hash_map!` will attempt to avoid repeated reallocations by +/// using [`HashMap::with_capacity`]. +/// +/// # Examples +/// +/// ```rust +/// #![feature(hash_map_macro)] +/// use std::hash_map; +/// +/// let map = hash_map! { +/// "key" => "value", +/// "key1" => "value1" +/// }; +/// +/// assert_eq!(map.get("key"), Some(&"value")); +/// assert_eq!(map.get("key1"), Some(&"value1")); +/// assert!(map.get("brrrrrrooooommm").is_none()); +/// ``` +/// +/// And with a trailing comma +/// +///```rust +/// #![feature(hash_map_macro)] +/// use std::hash_map; +/// +/// let map = hash_map! { +/// "key" => "value", // notice the , +/// }; +/// +/// assert_eq!(map.get("key"), Some(&"value")); +/// ``` +/// +/// The key and value are moved into the HashMap. +/// +/// [`HashMap`]: crate::collections::HashMap +/// [`HashMap::insert`]: crate::collections::HashMap::insert +/// [`HashMap::with_capacity`]: crate::collections::HashMap::with_capacity +#[macro_export] +#[allow_internal_unstable(hash_map_internals)] +#[unstable(feature = "hash_map_macro", issue = "144032")] +macro_rules! hash_map { + () => {{ + $crate::collections::HashMap::new() + }}; + + ( $( $key:expr => $value:expr ),* $(,)? ) => {{ + let mut map = $crate::collections::HashMap::with_capacity( + const { $crate::repetition_utils!(@count $($key),*) } + ); + $( map.insert($key, $value); )* + map + }} +} From eee01dd21138c376b1f64e49f7f76b9f6121c5ec Mon Sep 17 00:00:00 2001 From: Vincent Whitchurch Date: Thu, 26 Mar 2026 09:38:27 +0000 Subject: [PATCH 03/19] Add `IoSplit` diagnostic item for `std::io::Split` Similar to the existing `IoLines` item. It will be used in Clippy to detect uses of `Split` leading to infinite loops similar to the existing lint for `Lines`. --- library/std/src/io/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index 623c34c6d291..cba578cd3a6f 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -3348,6 +3348,7 @@ fn upper_bound(&self) -> Option { /// [`split`]: BufRead::split #[stable(feature = "rust1", since = "1.0.0")] #[derive(Debug)] +#[cfg_attr(not(test), rustc_diagnostic_item = "IoSplit")] pub struct Split { buf: B, delim: u8, From 1f1785712384f90b52a01e966ac70883efc8b9d3 Mon Sep 17 00:00:00 2001 From: Laine Taffin Altman Date: Fri, 27 Mar 2026 17:24:27 -0700 Subject: [PATCH 04/19] std_detect on AArch64 Darwin: Detect FEAT_SVE_B16B16 This is now exposed via `sysctl` as of macOS "Tahoe" 26.4 (or possibly earlier). --- library/std_detect/src/detect/os/darwin/aarch64.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/std_detect/src/detect/os/darwin/aarch64.rs b/library/std_detect/src/detect/os/darwin/aarch64.rs index a23d65a23d81..5805d5cc3646 100644 --- a/library/std_detect/src/detect/os/darwin/aarch64.rs +++ b/library/std_detect/src/detect/os/darwin/aarch64.rs @@ -81,6 +81,7 @@ pub(crate) fn detect_features() -> cache::Initializer { let sme_f64f64 = _sysctlbyname(c"hw.optional.arm.FEAT_SME_F64F64"); let sme_i16i64 = _sysctlbyname(c"hw.optional.arm.FEAT_SME_I16I64"); let ssbs = _sysctlbyname(c"hw.optional.arm.FEAT_SSBS"); + let sve_b16b16 = _sysctlbyname(c"hw.optional.arm.FEAT_SVE_B16B16"); let wfxt = _sysctlbyname(c"hw.optional.arm.FEAT_WFxT"); // The following features are not exposed by `is_aarch64_feature_detected`, @@ -160,6 +161,7 @@ pub(crate) fn detect_features() -> cache::Initializer { enable_feature(Feature::sme_f64f64, sme_f64f64); enable_feature(Feature::sme_i16i64, sme_i16i64); enable_feature(Feature::ssbs, ssbs); + enable_feature(Feature::sve_b16b16, sve_b16b16); enable_feature(Feature::wfxt, wfxt); value From 94ed03acb552ff4bb2801d090df5f760bc9bcb74 Mon Sep 17 00:00:00 2001 From: Daria Sukhonina Date: Tue, 24 Mar 2026 14:00:46 +0300 Subject: [PATCH 05/19] Make typeck a tcx method which calls typeck_root query --- compiler/rustc_hir_typeck/src/lib.rs | 18 ++++++++++-------- .../rustc_incremental/src/persist/clean.rs | 2 +- compiler/rustc_middle/src/queries.rs | 4 ++-- compiler/rustc_middle/src/query/plumbing.rs | 19 +++++++++++++++++-- src/librustdoc/core.rs | 13 ++++--------- 5 files changed, 34 insertions(+), 22 deletions(-) diff --git a/compiler/rustc_hir_typeck/src/lib.rs b/compiler/rustc_hir_typeck/src/lib.rs index 6cfcdfe87480..fe8a9a9fb4f7 100644 --- a/compiler/rustc_hir_typeck/src/lib.rs +++ b/compiler/rustc_hir_typeck/src/lib.rs @@ -82,7 +82,7 @@ fn used_trait_imports(tcx: TyCtxt<'_>, def_id: LocalDefId) -> &UnordSet(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> { +fn typeck_root<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> { typeck_with_inspect(tcx, def_id, None) } @@ -95,6 +95,13 @@ pub fn inspect_typeck<'tcx>( def_id: LocalDefId, inspect: ObligationInspector<'tcx>, ) -> &'tcx ty::TypeckResults<'tcx> { + // Closures' typeck results come from their outermost function, + // as they are part of the same "inference environment". + let typeck_root_def_id = tcx.typeck_root_def_id_local(def_id); + if typeck_root_def_id != def_id { + return tcx.typeck(typeck_root_def_id); + } + typeck_with_inspect(tcx, def_id, Some(inspect)) } @@ -104,12 +111,7 @@ fn typeck_with_inspect<'tcx>( def_id: LocalDefId, inspector: Option>, ) -> &'tcx ty::TypeckResults<'tcx> { - // Closures' typeck results come from their outermost function, - // as they are part of the same "inference environment". - let typeck_root_def_id = tcx.typeck_root_def_id_local(def_id); - if typeck_root_def_id != def_id { - return tcx.typeck(typeck_root_def_id); - } + assert!(!tcx.is_typeck_child(def_id.to_def_id())); let id = tcx.local_def_id_to_hir_id(def_id); let node = tcx.hir_node(id); @@ -660,7 +662,7 @@ fn fatally_break_rust(tcx: TyCtxt<'_>, span: Span) -> ! { pub fn provide(providers: &mut Providers) { *providers = Providers { method_autoderef_steps: method::probe::method_autoderef_steps, - typeck, + typeck_root, used_trait_imports, check_transmutes: intrinsicck::check_transmutes, ..*providers diff --git a/compiler/rustc_incremental/src/persist/clean.rs b/compiler/rustc_incremental/src/persist/clean.rs index ab336a69737a..e999404c6cc8 100644 --- a/compiler/rustc_incremental/src/persist/clean.rs +++ b/compiler/rustc_incremental/src/persist/clean.rs @@ -49,7 +49,7 @@ label_strs::type_of, // And a big part of compilation (that we eventually want to cache) is type inference // information: - label_strs::typeck, + label_strs::typeck_root, ]; /// DepNodes for Hir, which is pretty much everything diff --git a/compiler/rustc_middle/src/queries.rs b/compiler/rustc_middle/src/queries.rs index 3572e3ff35cb..7537a4fc6b0e 100644 --- a/compiler/rustc_middle/src/queries.rs +++ b/compiler/rustc_middle/src/queries.rs @@ -1222,9 +1222,9 @@ separate_provide_extern } - query typeck(key: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> { + query typeck_root(key: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> { desc { "type-checking `{}`", tcx.def_path_str(key) } - cache_on_disk_if { !tcx.is_typeck_child(key.to_def_id()) } + cache_on_disk_if { true } } query used_trait_imports(key: LocalDefId) -> &'tcx UnordSet { diff --git a/compiler/rustc_middle/src/query/plumbing.rs b/compiler/rustc_middle/src/query/plumbing.rs index ef6259b1a0c1..e5c7d994b6c8 100644 --- a/compiler/rustc_middle/src/query/plumbing.rs +++ b/compiler/rustc_middle/src/query/plumbing.rs @@ -7,14 +7,15 @@ use rustc_data_structures::sharded::Sharded; use rustc_data_structures::sync::{AtomicU64, Lock, WorkerLocal}; use rustc_errors::Diag; +use rustc_hir::def_id::LocalDefId; use rustc_span::Span; use crate::dep_graph::{DepKind, DepNodeIndex, QuerySideEffect, SerializedDepNodeIndex}; use crate::ich::StableHashingContext; use crate::queries::{ExternProviders, Providers, QueryArenas, QueryVTables, TaggedQueryKey}; use crate::query::on_disk_cache::OnDiskCache; -use crate::query::{QueryCache, QueryJob, QueryStackFrame}; -use crate::ty::TyCtxt; +use crate::query::{IntoQueryKey, QueryCache, QueryJob, QueryStackFrame}; +use crate::ty::{self, TyCtxt}; /// For a particular query, keeps track of "active" keys, i.e. keys whose /// evaluation has started but has not yet finished successfully. @@ -200,7 +201,21 @@ pub struct TyCtxtEnsureDone<'tcx> { pub tcx: TyCtxt<'tcx>, } +impl<'tcx> TyCtxtEnsureOk<'tcx> { + pub fn typeck(self, def_id: impl IntoQueryKey) { + self.typeck_root( + self.tcx.typeck_root_def_id(def_id.into_query_key().to_def_id()).expect_local(), + ) + } +} + impl<'tcx> TyCtxt<'tcx> { + pub fn typeck(self, def_id: impl IntoQueryKey) -> &'tcx ty::TypeckResults<'tcx> { + self.typeck_root( + self.typeck_root_def_id(def_id.into_query_key().to_def_id()).expect_local(), + ) + } + /// Returns a transparent wrapper for `TyCtxt` which uses /// `span` as the location of queries performed through it. #[inline(always)] diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index a875d6d00221..42d7237f68e5 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -309,19 +309,14 @@ pub(crate) fn create_config( &EMPTY_SET }; // In case typeck does end up being called, don't ICE in case there were name resolution errors - providers.queries.typeck = move |tcx, def_id| { - // Closures' tables come from their outermost function, - // as they are part of the same "inference environment". - // This avoids emitting errors for the parent twice (see similar code in `typeck_with_fallback`) - let typeck_root_def_id = tcx.typeck_root_def_id(def_id.to_def_id()).expect_local(); - if typeck_root_def_id != def_id { - return tcx.typeck(typeck_root_def_id); - } + providers.queries.typeck_root = move |tcx, def_id| { + // Panic before code below breaks in case of someone calls typeck_root directly + assert!(!tcx.is_typeck_child(def_id.to_def_id())); let body = tcx.hir_body_owned_by(def_id); debug!("visiting body for {def_id:?}"); EmitIgnoredResolutionErrors::new(tcx).visit_body(body); - (rustc_interface::DEFAULT_QUERY_PROVIDERS.queries.typeck)(tcx, def_id) + (rustc_interface::DEFAULT_QUERY_PROVIDERS.queries.typeck_root)(tcx, def_id) }; }), extra_symbols: Vec::new(), From 26c75dfccf8e102c00067897dcac4864b22656e6 Mon Sep 17 00:00:00 2001 From: Daria Sukhonina Date: Wed, 25 Mar 2026 11:56:49 +0300 Subject: [PATCH 06/19] Rename typeck into typeck_root in tests/ui --- .../dep-graph/dep-graph-assoc-type-codegen.rs | 2 +- .../dep-graph-assoc-type-codegen.stderr | 4 ++-- tests/ui/dep-graph/dep-graph-caller-callee.rs | 4 ++-- .../dep-graph/dep-graph-caller-callee.stderr | 10 ++++----- .../dep-graph/dep-graph-struct-signature.rs | 10 ++++----- .../dep-graph-struct-signature.stderr | 22 +++++++++---------- ...graph-trait-impl-two-traits-same-method.rs | 4 ++-- ...h-trait-impl-two-traits-same-method.stderr | 10 ++++----- .../dep-graph-trait-impl-two-traits.rs | 4 ++-- .../dep-graph-trait-impl-two-traits.stderr | 12 +++++----- tests/ui/dep-graph/dep-graph-trait-impl.rs | 10 ++++----- .../ui/dep-graph/dep-graph-trait-impl.stderr | 22 +++++++++---------- tests/ui/dep-graph/dep-graph-type-alias.rs | 4 ++-- .../ui/dep-graph/dep-graph-type-alias.stderr | 8 +++---- tests/ui/track-diagnostics/track.stderr | 2 +- 15 files changed, 64 insertions(+), 64 deletions(-) diff --git a/tests/ui/dep-graph/dep-graph-assoc-type-codegen.rs b/tests/ui/dep-graph/dep-graph-assoc-type-codegen.rs index e04975f9c99b..8b87499966de 100644 --- a/tests/ui/dep-graph/dep-graph-assoc-type-codegen.rs +++ b/tests/ui/dep-graph/dep-graph-assoc-type-codegen.rs @@ -26,7 +26,7 @@ mod x { mod y { use crate::Foo; - #[rustc_then_this_would_need(typeck)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_root)] //~ ERROR OK pub fn use_char_assoc() { // Careful here: in the representation, ::T gets // normalized away, so at a certain point we had no edge to diff --git a/tests/ui/dep-graph/dep-graph-assoc-type-codegen.stderr b/tests/ui/dep-graph/dep-graph-assoc-type-codegen.stderr index b0372051f026..1a56d3181884 100644 --- a/tests/ui/dep-graph/dep-graph-assoc-type-codegen.stderr +++ b/tests/ui/dep-graph/dep-graph-assoc-type-codegen.stderr @@ -1,8 +1,8 @@ error: OK --> $DIR/dep-graph-assoc-type-codegen.rs:29:34 | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^ +LL | #[rustc_then_this_would_need(typeck_root)] + | ^^^^^^^^^^^ error: aborting due to 1 previous error diff --git a/tests/ui/dep-graph/dep-graph-caller-callee.rs b/tests/ui/dep-graph/dep-graph-caller-callee.rs index df959a93c9c2..43d10cd57cdb 100644 --- a/tests/ui/dep-graph/dep-graph-caller-callee.rs +++ b/tests/ui/dep-graph/dep-graph-caller-callee.rs @@ -18,7 +18,7 @@ mod y { use crate::x; // These dependencies SHOULD exist: - #[rustc_then_this_would_need(typeck)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_root)] //~ ERROR OK pub fn y() { x::x(); } @@ -29,7 +29,7 @@ mod z { // These are expected to yield errors, because changes to `x` // affect the BODY of `y`, but not its signature. - #[rustc_then_this_would_need(typeck)] //~ ERROR no path + #[rustc_then_this_would_need(typeck_root)] //~ ERROR no path pub fn z() { y::y(); } diff --git a/tests/ui/dep-graph/dep-graph-caller-callee.stderr b/tests/ui/dep-graph/dep-graph-caller-callee.stderr index 33fe91b3500a..379e23fc9a27 100644 --- a/tests/ui/dep-graph/dep-graph-caller-callee.stderr +++ b/tests/ui/dep-graph/dep-graph-caller-callee.stderr @@ -1,14 +1,14 @@ error: OK --> $DIR/dep-graph-caller-callee.rs:21:34 | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^ +LL | #[rustc_then_this_would_need(typeck_root)] + | ^^^^^^^^^^^ -error: no path from `x` to `typeck` +error: no path from `x` to `typeck_root` --> $DIR/dep-graph-caller-callee.rs:32:34 | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^ +LL | #[rustc_then_this_would_need(typeck_root)] + | ^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/tests/ui/dep-graph/dep-graph-struct-signature.rs b/tests/ui/dep-graph/dep-graph-struct-signature.rs index 080a1b5c583d..abef7d2e9884 100644 --- a/tests/ui/dep-graph/dep-graph-struct-signature.rs +++ b/tests/ui/dep-graph/dep-graph-struct-signature.rs @@ -34,11 +34,11 @@ trait Bar { } #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK - #[rustc_then_this_would_need(typeck)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_root)] //~ ERROR OK fn some_fn(x: WillChange) { } #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK - #[rustc_then_this_would_need(typeck)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_root)] //~ ERROR OK fn new_foo(x: u32, y: u32) -> WillChange { WillChange { x: x, y: y } } @@ -46,14 +46,14 @@ fn new_foo(x: u32, y: u32) -> WillChange { #[rustc_then_this_would_need(type_of)] //~ ERROR OK impl WillChange { #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK - #[rustc_then_this_would_need(typeck)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_root)] //~ ERROR OK fn new(x: u32, y: u32) -> WillChange { loop { } } } #[rustc_then_this_would_need(type_of)] //~ ERROR OK impl WillChange { #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK - #[rustc_then_this_would_need(typeck)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_root)] //~ ERROR OK fn method(&self, x: u32) { } } @@ -82,6 +82,6 @@ trait A { fn b(x: WontChange) { } #[rustc_then_this_would_need(fn_sig)] //~ ERROR no path from `WillChange` - #[rustc_then_this_would_need(typeck)] //~ ERROR no path from `WillChange` + #[rustc_then_this_would_need(typeck_root)] //~ ERROR no path from `WillChange` fn c(x: u32) { } } diff --git a/tests/ui/dep-graph/dep-graph-struct-signature.stderr b/tests/ui/dep-graph/dep-graph-struct-signature.stderr index 98efedc7244c..24d35b87820d 100644 --- a/tests/ui/dep-graph/dep-graph-struct-signature.stderr +++ b/tests/ui/dep-graph/dep-graph-struct-signature.stderr @@ -25,8 +25,8 @@ LL | #[rustc_then_this_would_need(fn_sig)] error: OK --> $DIR/dep-graph-struct-signature.rs:37:34 | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^ +LL | #[rustc_then_this_would_need(typeck_root)] + | ^^^^^^^^^^^ error: OK --> $DIR/dep-graph-struct-signature.rs:40:34 @@ -37,8 +37,8 @@ LL | #[rustc_then_this_would_need(fn_sig)] error: OK --> $DIR/dep-graph-struct-signature.rs:41:34 | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^ +LL | #[rustc_then_this_would_need(typeck_root)] + | ^^^^^^^^^^^ error: OK --> $DIR/dep-graph-struct-signature.rs:46:34 @@ -88,11 +88,11 @@ error: no path from `WillChange` to `fn_sig` LL | #[rustc_then_this_would_need(fn_sig)] | ^^^^^^ -error: no path from `WillChange` to `typeck` +error: no path from `WillChange` to `typeck_root` --> $DIR/dep-graph-struct-signature.rs:85:34 | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^ +LL | #[rustc_then_this_would_need(typeck_root)] + | ^^^^^^^^^^^ error: OK --> $DIR/dep-graph-struct-signature.rs:32:38 @@ -115,8 +115,8 @@ LL | #[rustc_then_this_would_need(fn_sig)] error: OK --> $DIR/dep-graph-struct-signature.rs:49:38 | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^ +LL | #[rustc_then_this_would_need(typeck_root)] + | ^^^^^^^^^^^ error: OK --> $DIR/dep-graph-struct-signature.rs:55:38 @@ -127,8 +127,8 @@ LL | #[rustc_then_this_would_need(fn_sig)] error: OK --> $DIR/dep-graph-struct-signature.rs:56:38 | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^ +LL | #[rustc_then_this_would_need(typeck_root)] + | ^^^^^^^^^^^ error: aborting due to 22 previous errors diff --git a/tests/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.rs b/tests/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.rs index 397a8c6a39d4..ccdd2ff570f6 100644 --- a/tests/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.rs +++ b/tests/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.rs @@ -30,7 +30,7 @@ impl Bar for char { } mod y { use crate::{Foo, Bar}; - #[rustc_then_this_would_need(typeck)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_root)] //~ ERROR OK pub fn with_char() { char::method('a'); } @@ -39,7 +39,7 @@ pub fn with_char() { mod z { use crate::y; - #[rustc_then_this_would_need(typeck)] //~ ERROR no path + #[rustc_then_this_would_need(typeck_root)] //~ ERROR no path pub fn z() { y::with_char(); } diff --git a/tests/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.stderr b/tests/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.stderr index 293f918a3187..9802d5acce18 100644 --- a/tests/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.stderr +++ b/tests/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.stderr @@ -1,14 +1,14 @@ error: OK --> $DIR/dep-graph-trait-impl-two-traits-same-method.rs:33:34 | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^ +LL | #[rustc_then_this_would_need(typeck_root)] + | ^^^^^^^^^^^ -error: no path from `x::` to `typeck` +error: no path from `x::` to `typeck_root` --> $DIR/dep-graph-trait-impl-two-traits-same-method.rs:42:34 | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^ +LL | #[rustc_then_this_would_need(typeck_root)] + | ^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/tests/ui/dep-graph/dep-graph-trait-impl-two-traits.rs b/tests/ui/dep-graph/dep-graph-trait-impl-two-traits.rs index 859505a4a7a1..c86923c0468b 100644 --- a/tests/ui/dep-graph/dep-graph-trait-impl-two-traits.rs +++ b/tests/ui/dep-graph/dep-graph-trait-impl-two-traits.rs @@ -29,7 +29,7 @@ impl Bar for char { } mod y { use crate::{Foo, Bar}; - #[rustc_then_this_would_need(typeck)] //~ ERROR no path + #[rustc_then_this_would_need(typeck_root)] //~ ERROR no path pub fn call_bar() { char::bar('a'); } @@ -38,7 +38,7 @@ pub fn call_bar() { mod z { use crate::y; - #[rustc_then_this_would_need(typeck)] //~ ERROR no path + #[rustc_then_this_would_need(typeck_root)] //~ ERROR no path pub fn z() { y::call_bar(); } diff --git a/tests/ui/dep-graph/dep-graph-trait-impl-two-traits.stderr b/tests/ui/dep-graph/dep-graph-trait-impl-two-traits.stderr index 46cb0e9ea86f..7d7ff0543cb3 100644 --- a/tests/ui/dep-graph/dep-graph-trait-impl-two-traits.stderr +++ b/tests/ui/dep-graph/dep-graph-trait-impl-two-traits.stderr @@ -1,14 +1,14 @@ -error: no path from `x::` to `typeck` +error: no path from `x::` to `typeck_root` --> $DIR/dep-graph-trait-impl-two-traits.rs:32:34 | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^ +LL | #[rustc_then_this_would_need(typeck_root)] + | ^^^^^^^^^^^ -error: no path from `x::` to `typeck` +error: no path from `x::` to `typeck_root` --> $DIR/dep-graph-trait-impl-two-traits.rs:41:34 | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^ +LL | #[rustc_then_this_would_need(typeck_root)] + | ^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/tests/ui/dep-graph/dep-graph-trait-impl.rs b/tests/ui/dep-graph/dep-graph-trait-impl.rs index 80925ddfe0c0..952ccf61c7d5 100644 --- a/tests/ui/dep-graph/dep-graph-trait-impl.rs +++ b/tests/ui/dep-graph/dep-graph-trait-impl.rs @@ -25,22 +25,22 @@ impl Foo for u32 { } mod y { use crate::Foo; - #[rustc_then_this_would_need(typeck)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_root)] //~ ERROR OK pub fn with_char() { char::method('a'); } - #[rustc_then_this_would_need(typeck)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_root)] //~ ERROR OK pub fn take_foo_with_char() { take_foo::('a'); } - #[rustc_then_this_would_need(typeck)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_root)] //~ ERROR OK pub fn with_u32() { u32::method(22); } - #[rustc_then_this_would_need(typeck)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_root)] //~ ERROR OK pub fn take_foo_with_u32() { take_foo::(22); } @@ -53,7 +53,7 @@ mod z { // These are expected to yield errors, because changes to `x` // affect the BODY of `y`, but not its signature. - #[rustc_then_this_would_need(typeck)] //~ ERROR no path + #[rustc_then_this_would_need(typeck_root)] //~ ERROR no path pub fn z() { y::with_char(); y::with_u32(); diff --git a/tests/ui/dep-graph/dep-graph-trait-impl.stderr b/tests/ui/dep-graph/dep-graph-trait-impl.stderr index a5fce64c3a1c..8a205feb774b 100644 --- a/tests/ui/dep-graph/dep-graph-trait-impl.stderr +++ b/tests/ui/dep-graph/dep-graph-trait-impl.stderr @@ -1,32 +1,32 @@ error: OK --> $DIR/dep-graph-trait-impl.rs:28:34 | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^ +LL | #[rustc_then_this_would_need(typeck_root)] + | ^^^^^^^^^^^ error: OK --> $DIR/dep-graph-trait-impl.rs:33:34 | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^ +LL | #[rustc_then_this_would_need(typeck_root)] + | ^^^^^^^^^^^ error: OK --> $DIR/dep-graph-trait-impl.rs:38:34 | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^ +LL | #[rustc_then_this_would_need(typeck_root)] + | ^^^^^^^^^^^ error: OK --> $DIR/dep-graph-trait-impl.rs:43:34 | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^ +LL | #[rustc_then_this_would_need(typeck_root)] + | ^^^^^^^^^^^ -error: no path from `x::` to `typeck` +error: no path from `x::` to `typeck_root` --> $DIR/dep-graph-trait-impl.rs:56:34 | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^ +LL | #[rustc_then_this_would_need(typeck_root)] + | ^^^^^^^^^^^ error: aborting due to 5 previous errors diff --git a/tests/ui/dep-graph/dep-graph-type-alias.rs b/tests/ui/dep-graph/dep-graph-type-alias.rs index 1796ebda1fc7..8d0407a74ca8 100644 --- a/tests/ui/dep-graph/dep-graph-type-alias.rs +++ b/tests/ui/dep-graph/dep-graph-type-alias.rs @@ -42,7 +42,7 @@ trait Trait { #[rustc_then_this_would_need(type_of)] //~ ERROR no path impl SomeType { #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK - #[rustc_then_this_would_need(typeck)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_root)] //~ ERROR OK fn method(&self, _: TypeAlias) {} } @@ -50,7 +50,7 @@ fn method(&self, _: TypeAlias) {} type TypeAlias2 = TypeAlias; #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK -#[rustc_then_this_would_need(typeck)] //~ ERROR OK +#[rustc_then_this_would_need(typeck_root)] //~ ERROR OK fn function(_: TypeAlias) { } diff --git a/tests/ui/dep-graph/dep-graph-type-alias.stderr b/tests/ui/dep-graph/dep-graph-type-alias.stderr index 9f24c1113b98..63312a5f249d 100644 --- a/tests/ui/dep-graph/dep-graph-type-alias.stderr +++ b/tests/ui/dep-graph/dep-graph-type-alias.stderr @@ -49,8 +49,8 @@ LL | #[rustc_then_this_would_need(fn_sig)] error: OK --> $DIR/dep-graph-type-alias.rs:53:30 | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^ +LL | #[rustc_then_this_would_need(typeck_root)] + | ^^^^^^^^^^^ error: OK --> $DIR/dep-graph-type-alias.rs:36:34 @@ -67,8 +67,8 @@ LL | #[rustc_then_this_would_need(fn_sig)] error: OK --> $DIR/dep-graph-type-alias.rs:45:34 | -LL | #[rustc_then_this_would_need(typeck)] - | ^^^^^^ +LL | #[rustc_then_this_would_need(typeck_root)] + | ^^^^^^^^^^^ error: aborting due to 12 previous errors diff --git a/tests/ui/track-diagnostics/track.stderr b/tests/ui/track-diagnostics/track.stderr index ba314c14b37e..9ac567436939 100644 --- a/tests/ui/track-diagnostics/track.stderr +++ b/tests/ui/track-diagnostics/track.stderr @@ -40,7 +40,7 @@ note: rustc $VERSION running on $TARGET note: compiler flags: ... -Z ui-testing ... -Z track-diagnostics query stack during panic: -#0 [typeck] type-checking `main` +#0 [typeck_root] type-checking `main` #1 [analysis] running analysis passes on crate `track` end of query stack error: aborting due to 3 previous errors From 5cf7376aac506122c466ecdb569b431636e0b5e9 Mon Sep 17 00:00:00 2001 From: Daria Sukhonina Date: Wed, 25 Mar 2026 13:37:51 +0300 Subject: [PATCH 07/19] Rename typeck into typeck_root in tests/incremental --- .../callee_caller_cross_crate/b.rs | 2 +- .../change_add_field/struct_point.rs | 12 +-- tests/incremental/change_crate_order/main.rs | 2 +- .../change_private_fn/struct_point.rs | 4 +- .../struct_point.rs | 2 +- tests/incremental/clean.rs | 6 +- tests/incremental/hashes/call_expressions.rs | 24 +++--- .../incremental/hashes/closure_expressions.rs | 16 ++-- tests/incremental/hashes/enum_constructors.rs | 36 ++++----- tests/incremental/hashes/for_loops.rs | 8 +- .../incremental/hashes/function_interfaces.rs | 38 +++++----- tests/incremental/hashes/if_expressions.rs | 20 ++--- .../hashes/indexing_expressions.rs | 16 ++-- tests/incremental/hashes/inherent_impls.rs | 76 +++++++++---------- tests/incremental/hashes/let_expressions.rs | 36 ++++----- tests/incremental/hashes/loop_expressions.rs | 12 +-- tests/incremental/hashes/match_expressions.rs | 36 ++++----- .../incremental/hashes/struct_constructors.rs | 28 +++---- tests/incremental/hashes/trait_defs.rs | 4 +- tests/incremental/hashes/trait_impls.rs | 36 ++++----- .../hashes/unary_and_binary_exprs.rs | 4 +- tests/incremental/hashes/while_let_loops.rs | 4 +- tests/incremental/hashes/while_loops.rs | 4 +- .../hygiene/auxiliary/cached_hygiene.rs | 2 +- .../ich_method_call_trait_scope.rs | 2 +- tests/incremental/ich_resolve_results.rs | 4 +- tests/incremental/issue-42602.rs | 2 +- tests/incremental/rlib_cross_crate/b.rs | 2 +- tests/incremental/string_constant.rs | 2 +- tests/incremental/struct_add_field.rs | 4 +- tests/incremental/struct_change_field_name.rs | 4 +- tests/incremental/struct_change_field_type.rs | 4 +- .../struct_change_field_type_cross_crate/b.rs | 4 +- tests/incremental/struct_remove_field.rs | 4 +- tests/incremental/type_alias_cross_crate/b.rs | 2 +- 35 files changed, 231 insertions(+), 231 deletions(-) diff --git a/tests/incremental/callee_caller_cross_crate/b.rs b/tests/incremental/callee_caller_cross_crate/b.rs index 78f3d8b3958f..ebdecf5b0a16 100644 --- a/tests/incremental/callee_caller_cross_crate/b.rs +++ b/tests/incremental/callee_caller_cross_crate/b.rs @@ -7,7 +7,7 @@ extern crate a; -#[rustc_clean(except="typeck", cfg="rpass2")] +#[rustc_clean(except="typeck_root", cfg="rpass2")] pub fn call_function0() { a::function0(77); } diff --git a/tests/incremental/change_add_field/struct_point.rs b/tests/incremental/change_add_field/struct_point.rs index 024812bd4beb..142a8e7533e4 100644 --- a/tests/incremental/change_add_field/struct_point.rs +++ b/tests/incremental/change_add_field/struct_point.rs @@ -70,7 +70,7 @@ pub fn x(&self) -> f32 { pub mod fn_with_type_in_sig { use point::Point; - #[rustc_clean(except="typeck,fn_sig,optimized_mir", cfg="cfail2")] + #[rustc_clean(except="typeck_root,fn_sig,optimized_mir", cfg="cfail2")] pub fn boop(p: Option<&Point>) -> f32 { p.map(|p| p.total()).unwrap_or(0.0) } @@ -86,7 +86,7 @@ pub fn boop(p: Option<&Point>) -> f32 { pub mod call_fn_with_type_in_sig { use fn_with_type_in_sig; - #[rustc_clean(except="typeck,optimized_mir", cfg="cfail2")] + #[rustc_clean(except="typeck_root,optimized_mir", cfg="cfail2")] pub fn bip() -> f32 { fn_with_type_in_sig::boop(None) } @@ -102,7 +102,7 @@ pub fn bip() -> f32 { pub mod fn_with_type_in_body { use point::Point; - #[rustc_clean(except="typeck,optimized_mir", cfg="cfail2")] + #[rustc_clean(except="typeck_root,optimized_mir", cfg="cfail2")] pub fn boop() -> f32 { Point::origin().total() } @@ -125,7 +125,7 @@ pub fn bip() -> f32 { pub mod fn_make_struct { use point::Point; - #[rustc_clean(except="typeck,fn_sig,optimized_mir", cfg="cfail2")] + #[rustc_clean(except="typeck_root,fn_sig,optimized_mir", cfg="cfail2")] pub fn make_origin(p: Point) -> Point { Point { ..p } } @@ -135,7 +135,7 @@ pub fn make_origin(p: Point) -> Point { pub mod fn_read_field { use point::Point; - #[rustc_clean(except="typeck,fn_sig,optimized_mir", cfg="cfail2")] + #[rustc_clean(except="typeck_root,fn_sig,optimized_mir", cfg="cfail2")] pub fn get_x(p: Point) -> f32 { p.x } @@ -145,7 +145,7 @@ pub fn get_x(p: Point) -> f32 { pub mod fn_write_field { use point::Point; - #[rustc_clean(except="typeck,fn_sig,optimized_mir", cfg="cfail2")] + #[rustc_clean(except="typeck_root,fn_sig,optimized_mir", cfg="cfail2")] pub fn inc_x(p: &mut Point) { p.x += 1.0; } diff --git a/tests/incremental/change_crate_order/main.rs b/tests/incremental/change_crate_order/main.rs index 38a2541a76b5..b5e05c244e07 100644 --- a/tests/incremental/change_crate_order/main.rs +++ b/tests/incremental/change_crate_order/main.rs @@ -19,7 +19,7 @@ use a::A; use b::B; -//? #[rustc_clean(label="typeck", cfg="rpass2")] +//? #[rustc_clean(label="typeck_root", cfg="rpass2")] pub fn main() { A + B; } diff --git a/tests/incremental/change_private_fn/struct_point.rs b/tests/incremental/change_private_fn/struct_point.rs index 2c2560309d27..eac1def3348d 100644 --- a/tests/incremental/change_private_fn/struct_point.rs +++ b/tests/incremental/change_private_fn/struct_point.rs @@ -54,8 +54,8 @@ pub mod fn_calls_methods_in_same_impl { // The cached result should actually be loaded from disk // (not just marked green) - for example, `DeadVisitor` // always runs during compilation as a "pass", and loads - // the typeck results for bodies. - #[rustc_clean(cfg="cfail2", loaded_from_disk="typeck")] + // the typeck_root results for bodies. + #[rustc_clean(cfg="cfail2", loaded_from_disk="typeck_root")] pub fn check() { let x = Point { x: 2.0, y: 2.0 }; x.distance_from_origin(); diff --git a/tests/incremental/change_pub_inherent_method_sig/struct_point.rs b/tests/incremental/change_pub_inherent_method_sig/struct_point.rs index 5c24199df6aa..e9778ed9dd5d 100644 --- a/tests/incremental/change_pub_inherent_method_sig/struct_point.rs +++ b/tests/incremental/change_pub_inherent_method_sig/struct_point.rs @@ -52,7 +52,7 @@ pub fn x(&self) -> f32 { pub mod fn_calls_changed_method { use point::Point; - #[rustc_clean(except="typeck,optimized_mir", cfg="cfail2")] + #[rustc_clean(except="typeck_root,optimized_mir", cfg="cfail2")] pub fn check() { let p = Point { x: 2.0, y: 2.0 }; p.distance_from_point(None); diff --git a/tests/incremental/clean.rs b/tests/incremental/clean.rs index 1188b46fa0ad..25aa25addfcd 100644 --- a/tests/incremental/clean.rs +++ b/tests/incremental/clean.rs @@ -36,14 +36,14 @@ pub fn y() { //[cfail2]~| ERROR `predicates_of(y)` should be dirty but is not //[cfail2]~| ERROR `type_of(y)` should be dirty but is not //[cfail2]~| ERROR `fn_sig(y)` should be dirty but is not - //[cfail2]~| ERROR `typeck(y)` should be clean but is not + //[cfail2]~| ERROR `typeck_root(y)` should be clean but is not x::x(); } } mod z { - #[rustc_clean(except="typeck", cfg="cfail2")] + #[rustc_clean(except="typeck_root", cfg="cfail2")] pub fn z() { - //[cfail2]~^ ERROR `typeck(z)` should be dirty but is not + //[cfail2]~^ ERROR `typeck_root(z)` should be dirty but is not } } diff --git a/tests/incremental/hashes/call_expressions.rs b/tests/incremental/hashes/call_expressions.rs index d58bf0416c6f..f106519f0373 100644 --- a/tests/incremental/hashes/call_expressions.rs +++ b/tests/incremental/hashes/call_expressions.rs @@ -29,9 +29,9 @@ pub fn change_callee_function() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_callee_function() { callee2(1, 2) @@ -63,9 +63,9 @@ mod change_callee_indirectly_function { #[cfg(not(any(cfail1,cfail4)))] use super::callee2 as callee; - #[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail2")] + #[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail5")] + #[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] pub fn change_callee_indirectly_function() { callee(1, 2) @@ -87,9 +87,9 @@ pub fn change_callee_method() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_callee_method() { let s = Struct; @@ -125,9 +125,9 @@ pub fn change_ufcs_callee_method() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_ufcs_callee_method() { let s = Struct; @@ -163,9 +163,9 @@ pub fn change_to_ufcs() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] // One might think this would be expanded in the opt_hir_owner_nodes/Mir, but it actually // results in slightly different hir_owner/Mir. @@ -187,9 +187,9 @@ pub mod change_ufcs_callee_indirectly { #[cfg(not(any(cfail1,cfail4)))] use super::Struct2 as Struct; - #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_ufcs_callee_indirectly() { let s = Struct; diff --git a/tests/incremental/hashes/closure_expressions.rs b/tests/incremental/hashes/closure_expressions.rs index 3cda661834f5..0d9f62c90df0 100644 --- a/tests/incremental/hashes/closure_expressions.rs +++ b/tests/incremental/hashes/closure_expressions.rs @@ -43,9 +43,9 @@ pub fn add_parameter() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn add_parameter() { let x = 0u32; @@ -61,9 +61,9 @@ pub fn change_parameter_pattern() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_parameter_pattern() { let _ = |(x,): (u32,)| x; @@ -96,9 +96,9 @@ pub fn add_type_ascription_to_parameter() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg = "cfail2", except = "opt_hir_owner_nodes, typeck")] +#[rustc_clean(cfg = "cfail2", except = "opt_hir_owner_nodes, typeck_root")] #[rustc_clean(cfg = "cfail3")] -#[rustc_clean(cfg = "cfail5", except = "opt_hir_owner_nodes, typeck")] +#[rustc_clean(cfg = "cfail5", except = "opt_hir_owner_nodes, typeck_root")] #[rustc_clean(cfg = "cfail6")] pub fn add_type_ascription_to_parameter() { let closure = |x: u32| x + 1u32; @@ -115,9 +115,9 @@ pub fn change_parameter_type() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_parameter_type() { let closure = |x: u16| (x as u64) + 1; diff --git a/tests/incremental/hashes/enum_constructors.rs b/tests/incremental/hashes/enum_constructors.rs index 5962727b3af0..4c6971eabd1e 100644 --- a/tests/incremental/hashes/enum_constructors.rs +++ b/tests/incremental/hashes/enum_constructors.rs @@ -63,9 +63,9 @@ pub fn change_field_order_struct_like() -> Enum { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root")] #[rustc_clean(cfg="cfail6")] // FIXME(michaelwoerister):Interesting. I would have thought that that changes the MIR. And it // would if it were not all constants @@ -104,9 +104,9 @@ pub fn change_constructor_path_struct_like() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_constructor_path_struct_like() { let _ = Enum2::Struct { @@ -149,9 +149,9 @@ pub mod change_constructor_path_indirectly_struct_like { #[cfg(not(any(cfail1,cfail4)))] use super::Enum2 as TheEnum; - #[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn function() -> TheEnum { TheEnum::Struct { @@ -211,12 +211,12 @@ pub fn change_constructor_path_tuple_like() { #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean( cfg="cfail2", - except="opt_hir_owner_nodes,typeck" + except="opt_hir_owner_nodes,typeck_root" )] #[rustc_clean(cfg="cfail3")] #[rustc_clean( cfg="cfail5", - except="opt_hir_owner_nodes,typeck" + except="opt_hir_owner_nodes,typeck_root" )] #[rustc_clean(cfg="cfail6")] pub fn change_constructor_path_tuple_like() { @@ -234,12 +234,12 @@ pub fn change_constructor_variant_tuple_like() { #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean( cfg="cfail2", - except="opt_hir_owner_nodes,typeck" + except="opt_hir_owner_nodes,typeck_root" )] #[rustc_clean(cfg="cfail3")] #[rustc_clean( cfg="cfail5", - except="opt_hir_owner_nodes,typeck" + except="opt_hir_owner_nodes,typeck_root" )] #[rustc_clean(cfg="cfail6")] pub fn change_constructor_variant_tuple_like() { @@ -254,9 +254,9 @@ pub mod change_constructor_path_indirectly_tuple_like { #[cfg(not(any(cfail1,cfail4)))] use super::Enum2 as TheEnum; - #[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn function() -> TheEnum { TheEnum::Tuple(0, 1, 2) @@ -273,9 +273,9 @@ pub mod change_constructor_variant_indirectly_tuple_like { #[cfg(not(any(cfail1,cfail4)))] use super::Enum2::Tuple2 as Variant; - #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn function() -> Enum2 { Variant(0, 1, 2) @@ -302,9 +302,9 @@ pub fn change_constructor_path_c_like() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_constructor_path_c_like() { let _x = Clike2::B; @@ -335,9 +335,9 @@ pub mod change_constructor_path_indirectly_c_like { #[cfg(not(any(cfail1,cfail4)))] use super::Clike2 as TheEnum; - #[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn function() -> TheEnum { TheEnum::B diff --git a/tests/incremental/hashes/for_loops.rs b/tests/incremental/hashes/for_loops.rs index 24717e0faaf5..d63f264da6e4 100644 --- a/tests/incremental/hashes/for_loops.rs +++ b/tests/incremental/hashes/for_loops.rs @@ -79,9 +79,9 @@ pub fn change_iteration_variable_pattern() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_iteration_variable_pattern() { let mut _x = 0; @@ -129,9 +129,9 @@ pub fn add_break() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn add_break() { let mut _x = 0; diff --git a/tests/incremental/hashes/function_interfaces.rs b/tests/incremental/hashes/function_interfaces.rs index 5b03f9ed6c67..8c0685042dbc 100644 --- a/tests/incremental/hashes/function_interfaces.rs +++ b/tests/incremental/hashes/function_interfaces.rs @@ -26,12 +26,12 @@ pub fn add_parameter() {} #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean( cfg = "cfail2", - except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig" + except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig" )] #[rustc_clean(cfg = "cfail3")] #[rustc_clean( cfg = "cfail5", - except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig" + except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig" )] #[rustc_clean(cfg = "cfail6")] pub fn add_parameter(p: i32) {} @@ -56,12 +56,12 @@ pub fn type_of_parameter(p: i32) {} #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean( cfg = "cfail2", - except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig" + except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig" )] #[rustc_clean(cfg = "cfail3")] #[rustc_clean( cfg = "cfail5", - except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig" + except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig" )] #[rustc_clean(cfg = "cfail6")] pub fn type_of_parameter(p: i64) {} @@ -74,12 +74,12 @@ pub fn type_of_parameter_ref(p: &i32) {} #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean( cfg = "cfail2", - except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig" + except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig" )] #[rustc_clean(cfg = "cfail3")] #[rustc_clean( cfg = "cfail5", - except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig" + except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig" )] #[rustc_clean(cfg = "cfail6")] pub fn type_of_parameter_ref(p: &mut i32) {} @@ -92,12 +92,12 @@ pub fn order_of_parameters(p1: i32, p2: i64) {} #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean( cfg = "cfail2", - except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig" + except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig" )] #[rustc_clean(cfg = "cfail3")] #[rustc_clean( cfg = "cfail5", - except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig" + except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig" )] #[rustc_clean(cfg = "cfail6")] pub fn order_of_parameters(p2: i64, p1: i32) {} @@ -110,12 +110,12 @@ pub fn make_unsafe() {} #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean( cfg = "cfail2", - except = "opt_hir_owner_nodes, typeck, fn_sig" + except = "opt_hir_owner_nodes, typeck_root, fn_sig" )] #[rustc_clean(cfg = "cfail3")] #[rustc_clean( cfg = "cfail5", - except = "opt_hir_owner_nodes, typeck, fn_sig" + except = "opt_hir_owner_nodes, typeck_root, fn_sig" )] #[rustc_clean(cfg = "cfail6")] pub unsafe fn make_unsafe() {} @@ -126,9 +126,9 @@ pub unsafe fn make_unsafe() {} pub fn make_extern() {} #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg = "cfail2", except = "opt_hir_owner_nodes, typeck, fn_sig")] +#[rustc_clean(cfg = "cfail2", except = "opt_hir_owner_nodes, typeck_root, fn_sig")] #[rustc_clean(cfg = "cfail3")] -#[rustc_clean(cfg = "cfail5", except = "opt_hir_owner_nodes, typeck, fn_sig")] +#[rustc_clean(cfg = "cfail5", except = "opt_hir_owner_nodes, typeck_root, fn_sig")] #[rustc_clean(cfg = "cfail6")] pub extern "C" fn make_extern() {} @@ -303,9 +303,9 @@ pub fn return_impl_trait() -> i32 { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg = "cfail2", except = "opt_hir_owner_nodes, typeck, fn_sig")] +#[rustc_clean(cfg = "cfail2", except = "opt_hir_owner_nodes, typeck_root, fn_sig")] #[rustc_clean(cfg = "cfail3")] -#[rustc_clean(cfg = "cfail5", except = "opt_hir_owner_nodes, typeck, fn_sig, optimized_mir")] +#[rustc_clean(cfg = "cfail5", except = "opt_hir_owner_nodes, typeck_root, fn_sig, optimized_mir")] #[rustc_clean(cfg = "cfail6")] pub fn return_impl_trait() -> impl Clone { 0 @@ -321,7 +321,7 @@ pub fn change_return_impl_trait() -> impl Clone { #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg = "cfail2", except = "opt_hir_owner_nodes")] #[rustc_clean(cfg = "cfail3")] -#[rustc_clean(cfg = "cfail5", except = "opt_hir_owner_nodes, typeck")] +#[rustc_clean(cfg = "cfail5", except = "opt_hir_owner_nodes, typeck_root")] #[rustc_clean(cfg = "cfail6")] pub fn change_return_impl_trait() -> impl Copy { 0u32 @@ -340,12 +340,12 @@ pub mod change_return_type_indirectly { #[rustc_clean( cfg = "cfail2", - except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig" + except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig" )] #[rustc_clean(cfg = "cfail3")] #[rustc_clean( cfg = "cfail5", - except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig" + except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig" )] #[rustc_clean(cfg = "cfail6")] pub fn indirect_return_type() -> ReturnType { @@ -363,12 +363,12 @@ pub mod change_parameter_type_indirectly { #[rustc_clean( cfg = "cfail2", - except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig" + except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig" )] #[rustc_clean(cfg = "cfail3")] #[rustc_clean( cfg = "cfail5", - except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig" + except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig" )] #[rustc_clean(cfg = "cfail6")] pub fn indirect_parameter_type(p: ParameterType) {} diff --git a/tests/incremental/hashes/if_expressions.rs b/tests/incremental/hashes/if_expressions.rs index 6a241692977f..47a50838633d 100644 --- a/tests/incremental/hashes/if_expressions.rs +++ b/tests/incremental/hashes/if_expressions.rs @@ -28,9 +28,9 @@ pub fn change_condition(x: bool) -> u32 { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_condition(x: bool) -> u32 { if !x { @@ -104,9 +104,9 @@ pub fn add_else_branch(x: bool) -> u32 { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn add_else_branch(x: bool) -> u32 { let mut ret = 1; @@ -132,9 +132,9 @@ pub fn change_condition_if_let(x: Option) -> u32 { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_condition_if_let(x: Option) -> u32 { if let Some(_ ) = x { @@ -157,9 +157,9 @@ pub fn change_then_branch_if_let(x: Option) -> u32 { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_then_branch_if_let(x: Option) -> u32 { if let Some(x) = x { @@ -210,9 +210,9 @@ pub fn add_else_branch_if_let(x: Option) -> u32 { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck,optimized_mir")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root,optimized_mir")] #[rustc_clean(cfg="cfail6")] pub fn add_else_branch_if_let(x: Option) -> u32 { let mut ret = 1; diff --git a/tests/incremental/hashes/indexing_expressions.rs b/tests/incremental/hashes/indexing_expressions.rs index bfc64c904039..cf056287994d 100644 --- a/tests/incremental/hashes/indexing_expressions.rs +++ b/tests/incremental/hashes/indexing_expressions.rs @@ -75,9 +75,9 @@ fn add_lower_bound(slice: &[u32]) -> &[u32] { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail2")] +#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] fn add_lower_bound(slice: &[u32]) -> &[u32] { &slice[3..4] @@ -92,9 +92,9 @@ fn add_upper_bound(slice: &[u32]) -> &[u32] { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail2")] +#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] fn add_upper_bound(slice: &[u32]) -> &[u32] { &slice[3..7] @@ -109,9 +109,9 @@ fn change_mutability(slice: &mut [u32]) -> u32 { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail2")] +#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] fn change_mutability(slice: &mut [u32]) -> u32 { (& slice[3..5])[0] @@ -126,9 +126,9 @@ fn exclusive_to_inclusive_range(slice: &[u32]) -> &[u32] { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail2")] +#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] fn exclusive_to_inclusive_range(slice: &[u32]) -> &[u32] { &slice[3..=7] diff --git a/tests/incremental/hashes/inherent_impls.rs b/tests/incremental/hashes/inherent_impls.rs index 75c0939fbfcd..c0d1c9a7b652 100644 --- a/tests/incremental/hashes/inherent_impls.rs +++ b/tests/incremental/hashes/inherent_impls.rs @@ -58,9 +58,9 @@ pub fn method_body() { #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { - #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,promoted_mir,typeck")] + #[rustc_clean(cfg="cfail2",except="opt_hir_owner_nodes,optimized_mir,promoted_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,promoted_mir,typeck")] + #[rustc_clean(cfg="cfail5",except="opt_hir_owner_nodes,optimized_mir,promoted_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn method_body() { println!("Hello, world!"); @@ -89,9 +89,9 @@ pub fn method_body_inlined() { #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { - #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] #[inline] pub fn method_body_inlined() { @@ -147,12 +147,12 @@ pub fn method_selfness() { } impl Foo { #[rustc_clean( cfg="cfail2", - except="opt_hir_owner_nodes,fn_sig,generics_of,typeck,associated_item,optimized_mir", + except="opt_hir_owner_nodes,fn_sig,generics_of,typeck_root,associated_item,optimized_mir", )] #[rustc_clean(cfg="cfail3")] #[rustc_clean( cfg="cfail5", - except="opt_hir_owner_nodes,fn_sig,generics_of,typeck,associated_item,optimized_mir", + except="opt_hir_owner_nodes,fn_sig,generics_of,typeck_root,associated_item,optimized_mir", )] #[rustc_clean(cfg="cfail6")] pub fn method_selfness(&self) { } @@ -174,9 +174,9 @@ pub fn method_selfmutness(& self) { } #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { - #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir")] + #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir")] + #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir")] #[rustc_clean(cfg="cfail6")] pub fn method_selfmutness(&mut self) { } } @@ -224,9 +224,9 @@ pub fn add_method_parameter(&self ) { } #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { - #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir")] + #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir")] + #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir")] #[rustc_clean(cfg="cfail6")] pub fn add_method_parameter(&self, _: i32) { } } @@ -274,9 +274,9 @@ pub fn change_method_return_type(&self) -> u16 { 0 } #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { - #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_method_return_type(&self) -> u32 { 0 } } @@ -351,9 +351,9 @@ pub fn make_method_unsafe(&self) { } #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { - #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck")] + #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck_root")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck")] + #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck_root")] #[rustc_clean(cfg="cfail6")] pub unsafe fn make_method_unsafe(&self) { } } @@ -376,9 +376,9 @@ pub fn make_method_extern(&self) { } #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { - #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck")] + #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck_root")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck")] + #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck_root")] #[rustc_clean(cfg="cfail6")] pub extern "C" fn make_method_extern(&self) { } } @@ -401,9 +401,9 @@ pub extern "C" fn change_method_calling_convention(&self) { } #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { - #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck")] + #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck_root")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck")] + #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck_root")] #[rustc_clean(cfg="cfail6")] pub extern "system" fn change_method_calling_convention(&self) { } } @@ -435,15 +435,15 @@ pub fn add_lifetime_parameter_to_method (&self) { } #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { - // Warning: Note that `typeck` are coming up clean here. + // Warning: Note that `typeck_root` are coming up clean here. // The addition or removal of lifetime parameters that don't // appear in the arguments or fn body in any way does not, in - // fact, affect the `typeck` in any semantic way (at least + // fact, affect the `typeck_root` in any semantic way (at least // as of this writing). **However,** altering the order of - // lowering **can** cause it appear to affect the `typeck`: + // lowering **can** cause it appear to affect the `typeck_root`: // if we lower generics before the body, then the `HirId` for // things in the body will be affected. So if you start to see - // `typeck` appear dirty, that might be the cause. -nmatsakis + // `typeck_root` appear dirty, that might be the cause. -nmatsakis #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig")] #[rustc_clean(cfg="cfail3")] #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,generics_of")] @@ -484,14 +484,14 @@ pub fn add_type_parameter_to_method (&self) { } #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { - // Warning: Note that `typeck` are coming up clean here. + // Warning: Note that `typeck_root` are coming up clean here. // The addition or removal of type parameters that don't appear in // the arguments or fn body in any way does not, in fact, affect - // the `typeck` in any semantic way (at least as of this + // the `typeck_root` in any semantic way (at least as of this // writing). **However,** altering the order of lowering **can** - // cause it appear to affect the `typeck`: if we lower + // cause it appear to affect the `typeck_root`: if we lower // generics before the body, then the `HirId` for things in the - // body will be affected. So if you start to see `typeck` + // body will be affected. So if you start to see `typeck_root` // appear dirty, that might be the cause. -nmatsakis #[rustc_clean( cfg="cfail2", @@ -576,14 +576,14 @@ pub fn add_lifetime_bound_to_type_param_of_method<'a, T >(&self) { } #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { - // Warning: Note that `typeck` are coming up clean here. + // Warning: Note that `typeck_root` are coming up clean here. // The addition or removal of bounds that don't appear in the // arguments or fn body in any way does not, in fact, affect the - // `typeck` in any semantic way (at least as of this + // `typeck_root` in any semantic way (at least as of this // writing). **However,** altering the order of lowering **can** - // cause it appear to affect the `typeck`: if we lower + // cause it appear to affect the `typeck_root`: if we lower // generics before the body, then the `HirId` for things in the - // body will be affected. So if you start to see `typeck` + // body will be affected. So if you start to see `typeck_root` // appear dirty, that might be the cause. -nmatsakis #[rustc_clean( cfg="cfail2", @@ -625,14 +625,14 @@ pub fn add_trait_bound_to_type_param_of_method(&self) { } #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { - // Warning: Note that `typeck` are coming up clean here. + // Warning: Note that `typeck_root` are coming up clean here. // The addition or removal of bounds that don't appear in the // arguments or fn body in any way does not, in fact, affect the - // `typeck` in any semantic way (at least as of this + // `typeck_root` in any semantic way (at least as of this // writing). **However,** altering the order of lowering **can** - // cause it appear to affect the `typeck`: if we lower + // cause it appear to affect the `typeck_root`: if we lower // generics before the body, then the `HirId` for things in the - // body will be affected. So if you start to see `typeck` + // body will be affected. So if you start to see `typeck_root` // appear dirty, that might be the cause. -nmatsakis #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,predicates_of")] #[rustc_clean(cfg="cfail3")] @@ -686,12 +686,12 @@ pub fn add_type_parameter_to_impl(&self) { } impl Bar { #[rustc_clean( cfg="cfail2", - except="generics_of,fn_sig,typeck,type_of,optimized_mir" + except="generics_of,fn_sig,typeck_root,type_of,optimized_mir" )] #[rustc_clean(cfg="cfail3")] #[rustc_clean( cfg="cfail5", - except="generics_of,fn_sig,typeck,type_of,optimized_mir" + except="generics_of,fn_sig,typeck_root,type_of,optimized_mir" )] #[rustc_clean(cfg="cfail6")] pub fn add_type_parameter_to_impl(&self) { } @@ -711,9 +711,9 @@ pub fn change_impl_self_type(&self) { } #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes")] #[rustc_clean(cfg="cfail6")] impl Bar { - #[rustc_clean(cfg="cfail2", except="fn_sig,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail2", except="fn_sig,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(cfg="cfail5", except="fn_sig,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail5", except="fn_sig,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_impl_self_type(&self) { } } diff --git a/tests/incremental/hashes/let_expressions.rs b/tests/incremental/hashes/let_expressions.rs index b2e89380acb3..155132b63856 100644 --- a/tests/incremental/hashes/let_expressions.rs +++ b/tests/incremental/hashes/let_expressions.rs @@ -41,9 +41,9 @@ pub fn add_type() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn add_type() { let _x: u32 = 2u32; @@ -58,9 +58,9 @@ pub fn change_type() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck,optimized_mir")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root,optimized_mir")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck,optimized_mir")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root,optimized_mir")] #[rustc_clean(cfg="cfail6")] pub fn change_type() { let _x: u8 = 2; @@ -75,9 +75,9 @@ pub fn change_mutability_of_reference_type() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck,optimized_mir")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root,optimized_mir")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck,optimized_mir")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root,optimized_mir")] #[rustc_clean(cfg="cfail6")] pub fn change_mutability_of_reference_type() { let _x: &mut u64; @@ -92,9 +92,9 @@ pub fn change_mutability_of_slot() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck,optimized_mir")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root,optimized_mir")] #[rustc_clean(cfg="cfail6")] pub fn change_mutability_of_slot() { let _x: u64 = 0; @@ -109,9 +109,9 @@ pub fn change_simple_binding_to_pattern() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck,optimized_mir")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root,optimized_mir")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck,optimized_mir")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root,optimized_mir")] #[rustc_clean(cfg="cfail6")] pub fn change_simple_binding_to_pattern() { let (_a, _b) = (0u8, 'x'); @@ -143,9 +143,9 @@ pub fn add_ref_in_pattern() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck,optimized_mir")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root,optimized_mir")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck,optimized_mir")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root,optimized_mir")] #[rustc_clean(cfg="cfail6")] pub fn add_ref_in_pattern() { let (ref _a, _b) = (1u8, 'y'); @@ -160,9 +160,9 @@ pub fn add_amp_in_pattern() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck,optimized_mir")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root,optimized_mir")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck,optimized_mir")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root,optimized_mir")] #[rustc_clean(cfg="cfail6")] pub fn add_amp_in_pattern() { let (&_a, _b) = (&1u8, 'y'); @@ -177,9 +177,9 @@ pub fn change_mutability_of_binding_in_pattern() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck,optimized_mir")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root,optimized_mir")] #[rustc_clean(cfg="cfail6")] pub fn change_mutability_of_binding_in_pattern() { let (mut _a, _b) = (99u8, 'q'); @@ -194,9 +194,9 @@ pub fn add_initializer() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck,optimized_mir")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root,optimized_mir")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck,optimized_mir")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root,optimized_mir")] #[rustc_clean(cfg="cfail6")] pub fn add_initializer() { let _x: i16 = 3i16; diff --git a/tests/incremental/hashes/loop_expressions.rs b/tests/incremental/hashes/loop_expressions.rs index a8b89217b949..da03fb17680a 100644 --- a/tests/incremental/hashes/loop_expressions.rs +++ b/tests/incremental/hashes/loop_expressions.rs @@ -54,9 +54,9 @@ pub fn add_break() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn add_break() { let mut _x = 0; @@ -131,9 +131,9 @@ pub fn change_break_label() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_break_label() { let mut _x = 0; @@ -212,9 +212,9 @@ pub fn change_continue_to_break() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, typeck, optimized_mir")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, typeck_root, optimized_mir")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, typeck, optimized_mir")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, typeck_root, optimized_mir")] #[rustc_clean(cfg="cfail6")] pub fn change_continue_to_break() { let mut _x = 0; diff --git a/tests/incremental/hashes/match_expressions.rs b/tests/incremental/hashes/match_expressions.rs index 0c7f847932b8..b6d753ac8a08 100644 --- a/tests/incremental/hashes/match_expressions.rs +++ b/tests/incremental/hashes/match_expressions.rs @@ -29,9 +29,9 @@ pub fn add_arm(x: u32) -> u32 { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn add_arm(x: u32) -> u32 { match x { @@ -80,9 +80,9 @@ pub fn add_guard_clause(x: u32, y: bool) -> u32 { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn add_guard_clause(x: u32, y: bool) -> u32 { match x { @@ -105,9 +105,9 @@ pub fn change_guard_clause(x: u32, y: bool) -> u32 { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_guard_clause(x: u32, y: bool) -> u32 { match x { @@ -130,9 +130,9 @@ pub fn add_at_binding(x: u32) -> u32 { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn add_at_binding(x: u32) -> u32 { match x { @@ -179,9 +179,9 @@ pub fn change_simple_name_to_pattern(x: u32) -> u32 { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_simple_name_to_pattern(x: u32) -> u32 { match (x, x & 1) { @@ -228,9 +228,9 @@ pub fn change_mutability_of_binding_in_pattern(x: u32) -> u32 { // Ignore optimized_mir in cfail2, the only change to optimized MIR is a span. #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_mutability_of_binding_in_pattern(x: u32) -> u32 { match (x, x & 1) { @@ -251,9 +251,9 @@ pub fn add_ref_to_binding_in_pattern(x: u32) -> u32 { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn add_ref_to_binding_in_pattern(x: u32) -> u32 { match (x, x & 1) { @@ -274,9 +274,9 @@ pub fn add_amp_to_binding_in_pattern(x: u32) -> u32 { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn add_amp_to_binding_in_pattern(x: u32) -> u32 { match (&x, x & 1) { @@ -323,9 +323,9 @@ pub fn add_alternative_to_arm(x: u32) -> u32 { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn add_alternative_to_arm(x: u32) -> u32 { match x { diff --git a/tests/incremental/hashes/struct_constructors.rs b/tests/incremental/hashes/struct_constructors.rs index b2f8d116b1e9..0efbd50627d7 100644 --- a/tests/incremental/hashes/struct_constructors.rs +++ b/tests/incremental/hashes/struct_constructors.rs @@ -60,9 +60,9 @@ pub fn change_field_order_regular_struct() -> RegularStruct { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_field_order_regular_struct() -> RegularStruct { RegularStruct { @@ -91,9 +91,9 @@ pub fn add_field_regular_struct() -> RegularStruct { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn add_field_regular_struct() -> RegularStruct { let struct1 = RegularStruct { @@ -128,9 +128,9 @@ pub fn change_field_label_regular_struct() -> RegularStruct { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_field_label_regular_struct() -> RegularStruct { let struct1 = RegularStruct { @@ -165,9 +165,9 @@ pub fn change_constructor_path_regular_struct() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_constructor_path_regular_struct() { let _ = RegularStruct2 { @@ -186,9 +186,9 @@ pub mod change_constructor_path_indirectly_regular_struct { #[cfg(not(any(cfail1,cfail4)))] use super::RegularStruct2 as Struct; - #[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn function() -> Struct { Struct { @@ -229,9 +229,9 @@ pub fn change_constructor_path_tuple_struct() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn change_constructor_path_tuple_struct() { let _ = TupleStruct2(0, 1, 2); @@ -246,9 +246,9 @@ pub mod change_constructor_path_indirectly_tuple_struct { #[cfg(not(any(cfail1,cfail4)))] use super::TupleStruct2 as Struct; - #[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail6")] - #[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")] + #[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")] #[rustc_clean(cfg="cfail3")] pub fn function() -> Struct { Struct(0, 1, 2) diff --git a/tests/incremental/hashes/trait_defs.rs b/tests/incremental/hashes/trait_defs.rs index 13334a08cae8..28f0c8633b4d 100644 --- a/tests/incremental/hashes/trait_defs.rs +++ b/tests/incremental/hashes/trait_defs.rs @@ -356,9 +356,9 @@ fn method( self) {} #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] trait TraitChangeModeSelfOwnToMut: Sized { - #[rustc_clean(except="opt_hir_owner_nodes,typeck,optimized_mir", cfg="cfail2")] + #[rustc_clean(except="opt_hir_owner_nodes,typeck_root,optimized_mir", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(except="opt_hir_owner_nodes,typeck,optimized_mir", cfg="cfail5")] + #[rustc_clean(except="opt_hir_owner_nodes,typeck_root,optimized_mir", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] fn method(mut self) {} } diff --git a/tests/incremental/hashes/trait_impls.rs b/tests/incremental/hashes/trait_impls.rs index d4ac69a8b55d..26a87ef5d723 100644 --- a/tests/incremental/hashes/trait_impls.rs +++ b/tests/incremental/hashes/trait_impls.rs @@ -79,9 +79,9 @@ fn method_name() { #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl ChangeMethodBodyTrait for Foo { - #[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail2")] + #[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail5")] + #[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] fn method_name() { () @@ -114,9 +114,9 @@ fn method_name() { #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl ChangeMethodBodyTraitInlined for Foo { - #[rustc_clean(except="opt_hir_owner_nodes,typeck,optimized_mir", cfg="cfail2")] + #[rustc_clean(except="opt_hir_owner_nodes,typeck_root,optimized_mir", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(except="opt_hir_owner_nodes,typeck,optimized_mir", cfg="cfail5")] + #[rustc_clean(except="opt_hir_owner_nodes,typeck_root,optimized_mir", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] #[inline] fn method_name() { @@ -148,12 +148,12 @@ pub trait ChangeMethodSelfnessTrait { #[rustc_clean(cfg="cfail6")] impl ChangeMethodSelfnessTrait for Foo { #[rustc_clean( - except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck,optimized_mir", + except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck_root,optimized_mir", cfg="cfail2", )] #[rustc_clean(cfg="cfail3")] #[rustc_clean( - except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck,optimized_mir", + except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck_root,optimized_mir", cfg="cfail5", )] #[rustc_clean(cfg="cfail6")] @@ -186,12 +186,12 @@ pub trait RemoveMethodSelfnessTrait { #[rustc_clean(cfg="cfail6")] impl RemoveMethodSelfnessTrait for Foo { #[rustc_clean( - except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck,optimized_mir", + except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck_root,optimized_mir", cfg="cfail2", )] #[rustc_clean(cfg="cfail3")] #[rustc_clean( - except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck,optimized_mir", + except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck_root,optimized_mir", cfg="cfail5", )] #[rustc_clean(cfg="cfail6")] @@ -225,9 +225,9 @@ pub trait ChangeMethodSelfmutnessTrait { #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl ChangeMethodSelfmutnessTrait for Foo { - #[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail2")] + #[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail5")] + #[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] fn method_name(&mut self) {} } @@ -407,9 +407,9 @@ pub trait AddArgumentTrait { #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl AddArgumentTrait for Foo { - #[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail2")] + #[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail5")] + #[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] fn method_name(&self, _x: u32) { } } @@ -441,9 +441,9 @@ pub trait ChangeArgumentTypeTrait { #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl ChangeArgumentTypeTrait for Foo { - #[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail2")] + #[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail5")] + #[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] fn method_name(&self, _x: char) { } } @@ -469,12 +469,12 @@ fn id(t: u32) -> u32 { t } #[rustc_clean(cfg="cfail6")] impl AddTypeParameterToImpl for Bar { #[rustc_clean( - except="opt_hir_owner_nodes,generics_of,fn_sig,type_of,typeck,optimized_mir", + except="opt_hir_owner_nodes,generics_of,fn_sig,type_of,typeck_root,optimized_mir", cfg="cfail2", )] #[rustc_clean(cfg="cfail3")] #[rustc_clean( - except="opt_hir_owner_nodes,generics_of,fn_sig,type_of,typeck,optimized_mir", + except="opt_hir_owner_nodes,generics_of,fn_sig,type_of,typeck_root,optimized_mir", cfg="cfail5", )] #[rustc_clean(cfg="cfail6")] @@ -499,9 +499,9 @@ fn id(self) -> Self { self } #[rustc_clean(except="opt_hir_owner_nodes,impl_trait_header", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl ChangeSelfTypeOfImpl for u64 { - #[rustc_clean(except="fn_sig,typeck,optimized_mir", cfg="cfail2")] + #[rustc_clean(except="fn_sig,typeck_root,optimized_mir", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] - #[rustc_clean(except="fn_sig,typeck,optimized_mir", cfg="cfail5")] + #[rustc_clean(except="fn_sig,typeck_root,optimized_mir", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] fn id(self) -> Self { self } } diff --git a/tests/incremental/hashes/unary_and_binary_exprs.rs b/tests/incremental/hashes/unary_and_binary_exprs.rs index fec167c2604c..9154aa30e4a6 100644 --- a/tests/incremental/hashes/unary_and_binary_exprs.rs +++ b/tests/incremental/hashes/unary_and_binary_exprs.rs @@ -418,9 +418,9 @@ pub fn type_cast(a: u8) -> u64 { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(except="opt_hir_owner_nodes,optimized_mir,typeck", cfg="cfail2")] +#[rustc_clean(except="opt_hir_owner_nodes,optimized_mir,typeck_root", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(except="opt_hir_owner_nodes,optimized_mir,typeck", cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes,optimized_mir,typeck_root", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] pub fn type_cast(a: u8) -> u64 { let b = a as u32; diff --git a/tests/incremental/hashes/while_let_loops.rs b/tests/incremental/hashes/while_let_loops.rs index 1071ee86b1fb..62ff32fcc97c 100644 --- a/tests/incremental/hashes/while_let_loops.rs +++ b/tests/incremental/hashes/while_let_loops.rs @@ -79,9 +79,9 @@ pub fn add_break() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn add_break() { let mut _x = 0; diff --git a/tests/incremental/hashes/while_loops.rs b/tests/incremental/hashes/while_loops.rs index 57287cbcdcee..79e514546544 100644 --- a/tests/incremental/hashes/while_loops.rs +++ b/tests/incremental/hashes/while_loops.rs @@ -79,9 +79,9 @@ pub fn add_break() { } #[cfg(not(any(cfail1,cfail4)))] -#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck")] +#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck_root")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck")] +#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck_root")] #[rustc_clean(cfg="cfail6")] pub fn add_break() { let mut _x = 0; diff --git a/tests/incremental/hygiene/auxiliary/cached_hygiene.rs b/tests/incremental/hygiene/auxiliary/cached_hygiene.rs index 67b54e641430..d52a6397590f 100644 --- a/tests/incremental/hygiene/auxiliary/cached_hygiene.rs +++ b/tests/incremental/hygiene/auxiliary/cached_hygiene.rs @@ -13,7 +13,7 @@ macro_rules! first_macro { } } -#[rustc_clean(except="opt_hir_owner_nodes,typeck,optimized_mir", cfg="rpass2")] +#[rustc_clean(except="opt_hir_owner_nodes,typeck_root,optimized_mir", cfg="rpass2")] #[inline(always)] pub fn changed_fn() { // This will cause additional hygiene to be generate, diff --git a/tests/incremental/ich_method_call_trait_scope.rs b/tests/incremental/ich_method_call_trait_scope.rs index 28234ca60d8e..58a56e6646f0 100644 --- a/tests/incremental/ich_method_call_trait_scope.rs +++ b/tests/incremental/ich_method_call_trait_scope.rs @@ -27,7 +27,7 @@ mod mod3 { #[cfg(rpass2)] use Trait2; - #[rustc_clean(except="typeck", cfg="rpass2")] + #[rustc_clean(except="typeck_root", cfg="rpass2")] fn bar() { ().method(); } diff --git a/tests/incremental/ich_resolve_results.rs b/tests/incremental/ich_resolve_results.rs index 41c98bd38912..60d3fd929479 100644 --- a/tests/incremental/ich_resolve_results.rs +++ b/tests/incremental/ich_resolve_results.rs @@ -31,13 +31,13 @@ mod mod3 { use mod2::Foo; #[rustc_clean(cfg="rpass2")] - #[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="rpass3")] + #[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="rpass3")] fn in_expr() { Foo(0); } #[rustc_clean(cfg="rpass2")] - #[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="rpass3")] + #[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="rpass3")] fn in_type() { test::(); } diff --git a/tests/incremental/issue-42602.rs b/tests/incremental/issue-42602.rs index e75dd9696b79..de1fd701f8cd 100644 --- a/tests/incremental/issue-42602.rs +++ b/tests/incremental/issue-42602.rs @@ -1,7 +1,7 @@ // Regression test for #42602. It used to be that we had // a dep-graph like // -// typeck(foo) -> FnOnce -> typeck(bar) +// typeck_root(foo) -> FnOnce -> typeck_root(bar) // // This was fixed by improving the resolution of the `FnOnce` trait // selection node. diff --git a/tests/incremental/rlib_cross_crate/b.rs b/tests/incremental/rlib_cross_crate/b.rs index 3373f8098c4f..c60e1c52f7ed 100644 --- a/tests/incremental/rlib_cross_crate/b.rs +++ b/tests/incremental/rlib_cross_crate/b.rs @@ -13,7 +13,7 @@ extern crate a; -#[rustc_clean(except="typeck,optimized_mir", cfg="rpass2")] +#[rustc_clean(except="typeck_root,optimized_mir", cfg="rpass2")] #[rustc_clean(cfg="rpass3")] pub fn use_X() -> u32 { let x: a::X = 22; diff --git a/tests/incremental/string_constant.rs b/tests/incremental/string_constant.rs index 4200df87ec65..fad76d4a9096 100644 --- a/tests/incremental/string_constant.rs +++ b/tests/incremental/string_constant.rs @@ -7,7 +7,7 @@ #![crate_type = "rlib"] // Here the only thing which changes is the string constant in `x`. -// Therefore, the compiler deduces (correctly) that typeck is not +// Therefore, the compiler deduces (correctly) that typeck_root is not // needed even for callers of `x`. pub mod x { diff --git a/tests/incremental/struct_add_field.rs b/tests/incremental/struct_add_field.rs index 2c26b388122a..e39935c0231a 100644 --- a/tests/incremental/struct_add_field.rs +++ b/tests/incremental/struct_add_field.rs @@ -22,12 +22,12 @@ pub struct Y { pub y: char } -#[rustc_clean(except="fn_sig,typeck", cfg="rpass2")] +#[rustc_clean(except="fn_sig,typeck_root", cfg="rpass2")] pub fn use_X(x: X) -> u32 { x.x as u32 } -#[rustc_clean(except="typeck", cfg="rpass2")] +#[rustc_clean(except="typeck_root", cfg="rpass2")] pub fn use_EmbedX(embed: EmbedX) -> u32 { embed.x.x as u32 } diff --git a/tests/incremental/struct_change_field_name.rs b/tests/incremental/struct_change_field_name.rs index 1519f8d477e5..76f42b68c5c8 100644 --- a/tests/incremental/struct_change_field_name.rs +++ b/tests/incremental/struct_change_field_name.rs @@ -26,7 +26,7 @@ pub struct Y { pub y: char } -#[rustc_clean(except="typeck", cfg="cfail2")] +#[rustc_clean(except="typeck_root", cfg="cfail2")] pub fn use_X() -> u32 { let x: X = X { x: 22 }; //[cfail2]~^ ERROR struct `X` has no field named `x` @@ -34,7 +34,7 @@ pub fn use_X() -> u32 { //[cfail2]~^ ERROR no field `x` on type `X` } -#[rustc_clean(except="typeck", cfg="cfail2")] +#[rustc_clean(except="typeck_root", cfg="cfail2")] pub fn use_EmbedX(embed: EmbedX) -> u32 { embed.x.x as u32 //[cfail2]~^ ERROR no field `x` on type `X` diff --git a/tests/incremental/struct_change_field_type.rs b/tests/incremental/struct_change_field_type.rs index 0291b34e3622..9414790303b3 100644 --- a/tests/incremental/struct_change_field_type.rs +++ b/tests/incremental/struct_change_field_type.rs @@ -25,13 +25,13 @@ pub struct Y { pub y: char } -#[rustc_clean(except="typeck", cfg="rpass2")] +#[rustc_clean(except="typeck_root", cfg="rpass2")] pub fn use_X() -> u32 { let x: X = X { x: 22 }; x.x as u32 } -#[rustc_clean(except="typeck", cfg="rpass2")] +#[rustc_clean(except="typeck_root", cfg="rpass2")] pub fn use_EmbedX(x: EmbedX) -> u32 { let x: X = X { x: 22 }; x.x as u32 diff --git a/tests/incremental/struct_change_field_type_cross_crate/b.rs b/tests/incremental/struct_change_field_type_cross_crate/b.rs index 5307d0af9d0a..ccd604717389 100644 --- a/tests/incremental/struct_change_field_type_cross_crate/b.rs +++ b/tests/incremental/struct_change_field_type_cross_crate/b.rs @@ -9,13 +9,13 @@ use a::*; -#[rustc_clean(except="typeck", cfg="rpass2")] +#[rustc_clean(except="typeck_root", cfg="rpass2")] pub fn use_X() -> u32 { let x: X = X { x: 22 }; x.x as u32 } -#[rustc_clean(except="typeck", cfg="rpass2")] +#[rustc_clean(except="typeck_root", cfg="rpass2")] pub fn use_EmbedX(embed: EmbedX) -> u32 { embed.x.x as u32 } diff --git a/tests/incremental/struct_remove_field.rs b/tests/incremental/struct_remove_field.rs index 23ba27344f9c..eeb0dff8f422 100644 --- a/tests/incremental/struct_remove_field.rs +++ b/tests/incremental/struct_remove_field.rs @@ -26,12 +26,12 @@ pub struct Y { pub y: char } -#[rustc_clean(except="typeck,fn_sig", cfg="rpass2")] +#[rustc_clean(except="typeck_root,fn_sig", cfg="rpass2")] pub fn use_X(x: X) -> u32 { x.x as u32 } -#[rustc_clean(except="typeck", cfg="rpass2")] +#[rustc_clean(except="typeck_root", cfg="rpass2")] pub fn use_EmbedX(embed: EmbedX) -> u32 { embed.x.x as u32 } diff --git a/tests/incremental/type_alias_cross_crate/b.rs b/tests/incremental/type_alias_cross_crate/b.rs index 7fa7073e3da9..095312c6cfe8 100644 --- a/tests/incremental/type_alias_cross_crate/b.rs +++ b/tests/incremental/type_alias_cross_crate/b.rs @@ -7,7 +7,7 @@ extern crate a; -#[rustc_clean(except="typeck", cfg="rpass2")] +#[rustc_clean(except="typeck_root", cfg="rpass2")] #[rustc_clean(cfg="rpass3")] pub fn use_X() -> u32 { let x: a::X = 22; From 1792232d01c1f4f336640c913e21bab4d0e7db78 Mon Sep 17 00:00:00 2001 From: Daria Sukhonina Date: Wed, 25 Mar 2026 13:59:59 +0300 Subject: [PATCH 08/19] fix tests/incremental/hashes --- tests/incremental/hashes/inherent_impls.rs | 24 +++++++++++----------- tests/incremental/hashes/trait_defs.rs | 2 +- tests/incremental/hashes/trait_impls.rs | 10 ++++----- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/incremental/hashes/inherent_impls.rs b/tests/incremental/hashes/inherent_impls.rs index c0d1c9a7b652..ad871e5965ea 100644 --- a/tests/incremental/hashes/inherent_impls.rs +++ b/tests/incremental/hashes/inherent_impls.rs @@ -55,7 +55,7 @@ pub fn method_body() { #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { #[rustc_clean(cfg="cfail2",except="opt_hir_owner_nodes,optimized_mir,promoted_mir,typeck_root")] @@ -86,7 +86,7 @@ pub fn method_body_inlined() { #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")] @@ -171,7 +171,7 @@ pub fn method_selfmutness(& self) { } #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir")] @@ -221,7 +221,7 @@ pub fn add_method_parameter(&self ) { } #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir")] @@ -271,7 +271,7 @@ pub fn change_method_return_type(&self) -> u16 { 0 } #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,optimized_mir,typeck_root")] @@ -348,7 +348,7 @@ pub fn make_method_unsafe(&self) { } #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck_root")] @@ -373,7 +373,7 @@ pub fn make_method_extern(&self) { } #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck_root")] @@ -398,7 +398,7 @@ pub extern "C" fn change_method_calling_convention(&self) { } #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck_root")] @@ -432,7 +432,7 @@ pub fn add_lifetime_parameter_to_method (&self) { } #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { // Warning: Note that `typeck_root` are coming up clean here. @@ -481,7 +481,7 @@ pub fn add_type_parameter_to_method (&self) { } #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { // Warning: Note that `typeck_root` are coming up clean here. @@ -573,7 +573,7 @@ pub fn add_lifetime_bound_to_type_param_of_method<'a, T >(&self) { } #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { // Warning: Note that `typeck_root` are coming up clean here. @@ -622,7 +622,7 @@ pub fn add_trait_bound_to_type_param_of_method(&self) { } #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl Foo { // Warning: Note that `typeck_root` are coming up clean here. diff --git a/tests/incremental/hashes/trait_defs.rs b/tests/incremental/hashes/trait_defs.rs index 28f0c8633b4d..0842fbadd1c4 100644 --- a/tests/incremental/hashes/trait_defs.rs +++ b/tests/incremental/hashes/trait_defs.rs @@ -353,7 +353,7 @@ fn method( self) {} #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] trait TraitChangeModeSelfOwnToMut: Sized { #[rustc_clean(except="opt_hir_owner_nodes,typeck_root,optimized_mir", cfg="cfail2")] diff --git a/tests/incremental/hashes/trait_impls.rs b/tests/incremental/hashes/trait_impls.rs index 26a87ef5d723..3e13212e5fd1 100644 --- a/tests/incremental/hashes/trait_impls.rs +++ b/tests/incremental/hashes/trait_impls.rs @@ -76,7 +76,7 @@ fn method_name() { #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl ChangeMethodBodyTrait for Foo { #[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail2")] @@ -111,7 +111,7 @@ fn method_name() { #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl ChangeMethodBodyTraitInlined for Foo { #[rustc_clean(except="opt_hir_owner_nodes,typeck_root,optimized_mir", cfg="cfail2")] @@ -222,7 +222,7 @@ pub trait ChangeMethodSelfmutnessTrait { #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl ChangeMethodSelfmutnessTrait for Foo { #[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir", cfg="cfail2")] @@ -404,7 +404,7 @@ pub trait AddArgumentTrait { #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl AddArgumentTrait for Foo { #[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir", cfg="cfail2")] @@ -438,7 +438,7 @@ pub trait ChangeArgumentTypeTrait { #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(cfg="cfail5")] +#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] impl ChangeArgumentTypeTrait for Foo { #[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir", cfg="cfail2")] From 024acdd4b6e04efde74559f9a9416558d89aa165 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Sat, 28 Mar 2026 10:51:02 -0400 Subject: [PATCH 09/19] Fix ambiguous parsing in bootstrap.py --- src/bootstrap/bootstrap.py | 7 ++++++- src/bootstrap/src/utils/change_tracker.rs | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 105e41ca45f6..b893bb3f5821 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -1259,7 +1259,12 @@ class RustBuild(object): def parse_args(args): """Parse the command line arguments that the python script needs.""" - parser = argparse.ArgumentParser(add_help=False) + + # Pass allow_abbrev=False to remove support for inexact matches (e.g., + # `--json` turning on `--json-output`). The argument list here is partial, + # most flags are matched in the Rust bootstrap code. This prevents the the + # default ambiguity checks in argparse from functioning correctly. + parser = argparse.ArgumentParser(add_help=False, allow_abbrev=False) parser.add_argument("-h", "--help", action="store_true") parser.add_argument("--config") parser.add_argument("--build-dir") diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs index f8af8f3bec03..3ae2373e1da2 100644 --- a/src/bootstrap/src/utils/change_tracker.rs +++ b/src/bootstrap/src/utils/change_tracker.rs @@ -616,4 +616,9 @@ pub fn human_readable_changes(changes: &[ChangeInfo]) -> String { severity: ChangeSeverity::Warning, summary: "`x.py test --no-doc` is renamed to `--all-targets`. Additionally `--tests` is added which only executes unit and integration tests.", }, + ChangeInfo { + change_id: 154508, + severity: ChangeSeverity::Info, + summary: "`x.py` stopped accepting partial argument names. Use full names to avoid errors.", + }, ]; From 1a320616e9d090e7ef7ac90e5ceabd7e2248d97f Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sat, 28 Mar 2026 17:43:29 +0100 Subject: [PATCH 10/19] [perf] Revert FastISel patch This change caused a significant compile-time regression for debug builds. --- src/llvm-project | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llvm-project b/src/llvm-project index 05918363362b..1cb4e3833c19 160000 --- a/src/llvm-project +++ b/src/llvm-project @@ -1 +1 @@ -Subproject commit 05918363362b439b9b0bced3daa14badd75da790 +Subproject commit 1cb4e3833c1919c2e6fb579a23ac0e2b22587b7e From 27242aa3196c1aa7b58fa744231f76362b0ecf2c Mon Sep 17 00:00:00 2001 From: Stepan Koltsov Date: Sat, 28 Mar 2026 21:00:03 +0000 Subject: [PATCH 11/19] Panic in Hermit clock_gettime --- library/std/src/sys/time/hermit.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/sys/time/hermit.rs b/library/std/src/sys/time/hermit.rs index 8e8a656ab61e..4e8e5dfe21c8 100644 --- a/library/std/src/sys/time/hermit.rs +++ b/library/std/src/sys/time/hermit.rs @@ -6,7 +6,7 @@ fn clock_gettime(clock: hermit_abi::clockid_t) -> Timespec { let mut t = hermit_abi::timespec { tv_sec: 0, tv_nsec: 0 }; - let _ = unsafe { hermit_abi::clock_gettime(clock, &raw mut t) }; + unsafe { hermit_abi::clock_gettime(clock, &raw mut t) }.unwrap(); Timespec::new(t.tv_sec, t.tv_nsec.into()).unwrap() } From 64ee85d511782d70d39626c5b9514108a0998295 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Sun, 29 Mar 2026 01:02:48 -0400 Subject: [PATCH 12/19] update zulip link in `std` documentation #docs doesn't seem to exist anymore, so point people to `t-libs`. Also include direct link to topic since Zulip is world-viewable now. --- library/std/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index c8c8a6c89714..e831d7b46653 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -94,8 +94,8 @@ //! pull-requests for your suggested changes. //! //! Contributions are appreciated! If you see a part of the docs that can be -//! improved, submit a PR, or chat with us first on [Zulip][rust-zulip] -//! #docs. +//! improved, submit a PR, or chat with us first on [Zulip][t-libs-zulip] +//! #t-libs. //! //! # A Tour of The Rust Standard Library //! @@ -209,7 +209,7 @@ //! [multithreading]: thread //! [other]: #what-is-in-the-standard-library-documentation //! [primitive types]: ../book/ch03-02-data-types.html -//! [rust-zulip]: https://rust-lang.zulipchat.com/ +//! [t-libs-zulip]: https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/ //! [array]: prim@array //! [slice]: prim@slice From 69b6d26d05006dca7556abc555fb0e029ecf1f4e Mon Sep 17 00:00:00 2001 From: yukang Date: Sun, 29 Mar 2026 16:23:14 +0800 Subject: [PATCH 13/19] fix invalid type suggestion for item nested in function --- .../rustc_hir_analysis/src/collect/type_of.rs | 4 ++-- compiler/rustc_middle/src/ty/print/mod.rs | 17 +++++++++++++++-- compiler/rustc_middle/src/ty/print/pretty.rs | 13 +++++++++++++ ...ocal-item-type-suggestion-issue-146786.fixed | 11 +++++++++++ ...n-local-item-type-suggestion-issue-146786.rs | 11 +++++++++++ ...cal-item-type-suggestion-issue-146786.stderr | 8 ++++++++ 6 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 tests/ui/suggestions/function-local-item-type-suggestion-issue-146786.fixed create mode 100644 tests/ui/suggestions/function-local-item-type-suggestion-issue-146786.rs create mode 100644 tests/ui/suggestions/function-local-item-type-suggestion-issue-146786.stderr diff --git a/compiler/rustc_hir_analysis/src/collect/type_of.rs b/compiler/rustc_hir_analysis/src/collect/type_of.rs index f2ae5c1f928d..e65efd6880b8 100644 --- a/compiler/rustc_hir_analysis/src/collect/type_of.rs +++ b/compiler/rustc_hir_analysis/src/collect/type_of.rs @@ -4,7 +4,7 @@ use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_hir::intravisit::VisitorExt; use rustc_hir::{self as hir, AmbigArg, HirId}; -use rustc_middle::ty::print::with_forced_trimmed_paths; +use rustc_middle::ty::print::{with_forced_trimmed_paths, with_types_for_suggestion}; use rustc_middle::ty::util::IntTypeExt; use rustc_middle::ty::{self, DefiningScopeKind, IsSuggestable, Ty, TyCtxt, TypeVisitableExt}; use rustc_middle::{bug, span_bug}; @@ -451,7 +451,7 @@ fn infer_placeholder_type<'tcx>( err.span_suggestion( ty_span, format!("provide a type for the {kind}"), - format!("{colon} {ty}"), + with_types_for_suggestion!(format!("{colon} {ty}")), Applicability::MachineApplicable, ); } else { diff --git a/compiler/rustc_middle/src/ty/print/mod.rs b/compiler/rustc_middle/src/ty/print/mod.rs index 0fd68e74e044..20e40dd6b2fe 100644 --- a/compiler/rustc_middle/src/ty/print/mod.rs +++ b/compiler/rustc_middle/src/ty/print/mod.rs @@ -133,8 +133,15 @@ fn print_coroutine_with_kind( self.print_path_with_generic_args(|p| p.print_def_path(def_id, parent_args), &[kind.into()]) } - // Defaults (should not be overridden): + fn reset_path(&mut self) -> Result<(), PrintError> { + Ok(()) + } + fn should_omit_parent_def_path(&self, _parent_def_id: DefId) -> bool { + false + } + + // Defaults (should not be overridden): #[instrument(skip(self), level = "debug")] fn default_print_def_path( &mut self, @@ -210,9 +217,15 @@ fn default_print_def_path( && self.tcx().generics_of(parent_def_id).parent_count == 0; } + let omit_parent = matches!(key.disambiguated_data.data, DefPathData::TypeNs(..)) + && self.should_omit_parent_def_path(parent_def_id); + self.print_path_with_simple( |p: &mut Self| { - if trait_qualify_parent { + if omit_parent { + p.reset_path()?; + Ok(()) + } else if trait_qualify_parent { let trait_ref = ty::TraitRef::new( p.tcx(), parent_def_id, diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index 2c14c37609d4..b196327763f0 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -2224,6 +2224,19 @@ fn tcx<'a>(&'a self) -> TyCtxt<'tcx> { self.tcx } + fn reset_path(&mut self) -> Result<(), PrintError> { + self.empty_path = true; + Ok(()) + } + + fn should_omit_parent_def_path(&self, parent_def_id: DefId) -> bool { + RTN_MODE.with(|mode| mode.get()) == RtnMode::ForSuggestion + && matches!( + self.tcx().def_key(parent_def_id).disambiguated_data.data, + DefPathData::ValueNs(..) | DefPathData::Closure | DefPathData::AnonConst + ) + } + fn print_def_path( &mut self, def_id: DefId, diff --git a/tests/ui/suggestions/function-local-item-type-suggestion-issue-146786.fixed b/tests/ui/suggestions/function-local-item-type-suggestion-issue-146786.fixed new file mode 100644 index 000000000000..50beced2940b --- /dev/null +++ b/tests/ui/suggestions/function-local-item-type-suggestion-issue-146786.fixed @@ -0,0 +1,11 @@ +//@ run-rustfix +#![allow(dead_code)] + +fn main() { + struct Error; + + const ERROR: Error = Error; + //~^ ERROR missing type for `const` item + //~| HELP provide a type for the constant + //~| SUGGESTION : Error +} diff --git a/tests/ui/suggestions/function-local-item-type-suggestion-issue-146786.rs b/tests/ui/suggestions/function-local-item-type-suggestion-issue-146786.rs new file mode 100644 index 000000000000..f3c4aed435da --- /dev/null +++ b/tests/ui/suggestions/function-local-item-type-suggestion-issue-146786.rs @@ -0,0 +1,11 @@ +//@ run-rustfix +#![allow(dead_code)] + +fn main() { + struct Error; + + const ERROR = Error; + //~^ ERROR missing type for `const` item + //~| HELP provide a type for the constant + //~| SUGGESTION : Error +} diff --git a/tests/ui/suggestions/function-local-item-type-suggestion-issue-146786.stderr b/tests/ui/suggestions/function-local-item-type-suggestion-issue-146786.stderr new file mode 100644 index 000000000000..4111f9d35306 --- /dev/null +++ b/tests/ui/suggestions/function-local-item-type-suggestion-issue-146786.stderr @@ -0,0 +1,8 @@ +error: missing type for `const` item + --> $DIR/function-local-item-type-suggestion-issue-146786.rs:7:16 + | +LL | const ERROR = Error; + | ^ help: provide a type for the constant: `: Error` + +error: aborting due to 1 previous error + From 51816efcc02d36d6f4c1a9149f655869ee6bc58d Mon Sep 17 00:00:00 2001 From: dianne Date: Wed, 18 Mar 2026 20:06:02 -0700 Subject: [PATCH 14/19] don't drop arguments' temporaries in `dbg!` --- library/std/src/macros.rs | 82 ++++++++++--------- library/std/src/macros/tests.rs | 13 +++ .../clippy/clippy_lints/src/dbg_macro.rs | 47 ++--------- .../dangling_primitive.stderr | 2 +- .../return_pointer_on_unwind.stderr | 2 +- tests/ui/borrowck/dbg-issue-120327.stderr | 40 ++++----- tests/ui/liveness/liveness-upvars.rs | 2 +- tests/ui/liveness/liveness-upvars.stderr | 10 ++- .../dbg-macro-move-semantics.stderr | 16 ++-- 9 files changed, 103 insertions(+), 111 deletions(-) create mode 100644 library/std/src/macros/tests.rs diff --git a/library/std/src/macros.rs b/library/std/src/macros.rs index 0bb14552432d..5f9b383c2da3 100644 --- a/library/std/src/macros.rs +++ b/library/std/src/macros.rs @@ -5,6 +5,9 @@ //! library. // ignore-tidy-dbg +#[cfg(test)] +mod tests; + #[doc = include_str!("../../core/src/macros/panic.md")] #[macro_export] #[rustc_builtin_macro(std_panic)] @@ -359,19 +362,16 @@ macro_rules! dbg { }; } -/// Internal macro that processes a list of expressions and produces a chain of -/// nested `match`es, one for each expression, before finally calling `eprint!` -/// with the collected information and returning all the evaluated expressions -/// in a tuple. +/// Internal macro that processes a list of expressions, binds their results +/// with `match`, calls `eprint!` with the collected information, and returns +/// all the evaluated expressions in a tuple. /// /// E.g. `dbg_internal!(() () (1, 2))` expands into /// ```rust, ignore -/// match 1 { -/// tmp_1 => match 2 { -/// tmp_2 => { -/// eprint!("...", &tmp_1, &tmp_2, /* some other arguments */); -/// (tmp_1, tmp_2) -/// } +/// match (1, 2) { +/// (tmp_1, tmp_2) => { +/// eprint!("...", &tmp_1, &tmp_2, /* some other arguments */); +/// (tmp_1, tmp_2) /// } /// } /// ``` @@ -380,37 +380,41 @@ macro_rules! dbg { #[doc(hidden)] #[rustc_macro_transparency = "semiopaque"] pub macro dbg_internal { - (($($piece:literal),+) ($($processed:expr => $bound:expr),+) ()) => {{ - $crate::eprint!( - $crate::concat!($($piece),+), - $( - $crate::stringify!($processed), - // The `&T: Debug` check happens here (not in the format literal desugaring) - // to avoid format literal related messages and suggestions. - &&$bound as &dyn $crate::fmt::Debug - ),+, - // The location returned here is that of the macro invocation, so - // it will be the same for all expressions. Thus, label these - // arguments so that they can be reused in every piece of the - // formatting template. - file=$crate::file!(), - line=$crate::line!(), - column=$crate::column!() - ); - // Comma separate the variables only when necessary so that this will - // not yield a tuple for a single expression, but rather just parenthesize - // the expression. - ($($bound),+) - }}, - (($($piece:literal),*) ($($processed:expr => $bound:expr),*) ($val:expr $(,$rest:expr)*)) => { + (($($piece:literal),+) ($($processed:expr => $bound:ident),+) ()) => { // Use of `match` here is intentional because it affects the lifetimes // of temporaries - https://stackoverflow.com/a/48732525/1063961 - match $val { - tmp => $crate::macros::dbg_internal!( - ($($piece,)* "[{file}:{line}:{column}] {} = {:#?}\n") - ($($processed => $bound,)* $val => tmp) - ($($rest),*) - ), + // Always put the arguments in a tuple to avoid an unused parens lint on the pattern. + match ($($processed,)+) { + ($($bound,)+) => { + $crate::eprint!( + $crate::concat!($($piece),+), + $( + $crate::stringify!($processed), + // The `&T: Debug` check happens here (not in the format literal desugaring) + // to avoid format literal related messages and suggestions. + &&$bound as &dyn $crate::fmt::Debug + ),+, + // The location returned here is that of the macro invocation, so + // it will be the same for all expressions. Thus, label these + // arguments so that they can be reused in every piece of the + // formatting template. + file=$crate::file!(), + line=$crate::line!(), + column=$crate::column!() + ); + // Comma separate the variables only when necessary so that this will + // not yield a tuple for a single expression, but rather just parenthesize + // the expression. + ($($bound),+) + + } } }, + (($($piece:literal),*) ($($processed:expr => $bound:ident),*) ($val:expr $(,$rest:expr)*)) => { + $crate::macros::dbg_internal!( + ($($piece,)* "[{file}:{line}:{column}] {} = {:#?}\n") + ($($processed => $bound,)* $val => tmp) + ($($rest),*) + ) + }, } diff --git a/library/std/src/macros/tests.rs b/library/std/src/macros/tests.rs new file mode 100644 index 000000000000..db2be925ff30 --- /dev/null +++ b/library/std/src/macros/tests.rs @@ -0,0 +1,13 @@ +// ignore-tidy-dbg + +/// Test for : +/// `dbg!` shouldn't drop arguments' temporaries. +#[test] +fn no_dropping_temps() { + fn temp() {} + + *dbg!(&temp()); + *dbg!(&temp(), 1).0; + *dbg!(0, &temp()).1; + *dbg!(0, &temp(), 2).1; +} diff --git a/src/tools/clippy/clippy_lints/src/dbg_macro.rs b/src/tools/clippy/clippy_lints/src/dbg_macro.rs index eb14ef18c03d..63968a8b5e04 100644 --- a/src/tools/clippy/clippy_lints/src/dbg_macro.rs +++ b/src/tools/clippy/clippy_lints/src/dbg_macro.rs @@ -5,7 +5,7 @@ use clippy_utils::{is_in_test, sym}; use rustc_data_structures::fx::FxHashSet; use rustc_errors::Applicability; -use rustc_hir::{Arm, Closure, ClosureKind, CoroutineKind, Expr, ExprKind, LetStmt, LocalSource, Node, Stmt, StmtKind}; +use rustc_hir::{Closure, ClosureKind, CoroutineKind, Expr, ExprKind, LetStmt, LocalSource, Node, Stmt, StmtKind}; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_session::impl_lint_pass; use rustc_span::{Span, SyntaxContext}; @@ -92,16 +92,15 @@ fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { (macro_call.span, String::from("()")) } }, - ExprKind::Match(first, arms, _) => { - let vals = collect_vals(first, arms); - let suggestion = match *vals.as_slice() { + ExprKind::Match(args, _, _) => { + let suggestion = match args.kind { // dbg!(1) => 1 - [val] => { + ExprKind::Tup([val]) => { snippet_with_applicability(cx, val.span.source_callsite(), "..", &mut applicability) .to_string() }, // dbg!(2, 3) => (2, 3) - [first, .., last] => { + ExprKind::Tup([first, .., last]) => { let snippet = snippet_with_applicability( cx, first.span.source_callsite().to(last.span.source_callsite()), @@ -165,39 +164,3 @@ fn is_async_move_desugar<'tcx>(expr: &'tcx Expr<'tcx>) -> Option<&'tcx Expr<'tcx fn first_dbg_macro_in_expansion(cx: &LateContext<'_>, span: Span) -> Option { macro_backtrace(span).find(|mc| cx.tcx.is_diagnostic_item(sym::dbg_macro, mc.def_id)) } - -/// Extracts all value expressions from the `match`-tree generated by `dbg!`. -/// -/// E.g. from -/// ```rust, ignore -/// match 1 { -/// tmp_1 => match 2 { -/// tmp_2 => { -/// /* printing */ -/// (tmp_1, tmp_2) -/// } -/// } -/// } -/// ``` -/// this extracts `1` and `2`. -fn collect_vals<'hir>(first: &'hir Expr<'hir>, mut arms: &'hir [Arm<'hir>]) -> Vec<&'hir Expr<'hir>> { - let mut vals = vec![first]; - loop { - let [arm] = arms else { - unreachable!("dbg! macro expansion only has single-arm matches") - }; - - match is_async_move_desugar(arm.body) - .unwrap_or(arm.body) - .peel_drop_temps() - .kind - { - ExprKind::Block(..) => return vals, - ExprKind::Match(val, a, _) => { - vals.push(val); - arms = a; - }, - _ => unreachable!("dbg! macro expansion only results in block or match expressions"), - } - } -} diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_primitive.stderr b/src/tools/miri/tests/fail/dangling_pointers/dangling_primitive.stderr index afc2cb214842..4f06a1afa50f 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/dangling_primitive.stderr +++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_primitive.stderr @@ -2,7 +2,7 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this p --> tests/fail/dangling_pointers/dangling_primitive.rs:LL:CC | LL | dbg!(*ptr); - | ^^^^^^^^^^ Undefined Behavior occurred here + | ^^^^ Undefined Behavior occurred here | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr index 364a4b4a7441..88d5694c4736 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr @@ -7,7 +7,7 @@ error: Undefined Behavior: reading memory at ALLOC[0x0..0x4], but memory is unin --> tests/fail/function_calls/return_pointer_on_unwind.rs:LL:CC | LL | dbg!(x.0); - | ^^^^^^^^^ Undefined Behavior occurred here + | ^^^ Undefined Behavior occurred here | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/ui/borrowck/dbg-issue-120327.stderr b/tests/ui/borrowck/dbg-issue-120327.stderr index efacc0c3f134..685a530a1fe5 100644 --- a/tests/ui/borrowck/dbg-issue-120327.stderr +++ b/tests/ui/borrowck/dbg-issue-120327.stderr @@ -4,14 +4,14 @@ error[E0382]: use of moved value: `a` LL | let a = String::new(); | - move occurs because `a` has type `String`, which does not implement the `Copy` trait LL | dbg!(a); - | ------- value moved here + | - value moved here LL | return a; | ^ value used here after move | -help: consider borrowing instead of transferring ownership +help: consider cloning the value if the performance cost is acceptable | -LL | dbg!(&a); - | + +LL | dbg!(a.clone()); + | ++++++++ error[E0382]: use of moved value: `a` --> $DIR/dbg-issue-120327.rs:10:12 @@ -19,14 +19,14 @@ error[E0382]: use of moved value: `a` LL | let a = String::new(); | - move occurs because `a` has type `String`, which does not implement the `Copy` trait LL | dbg!(1, 2, a, 1, 2); - | ------------------- value moved here + | - value moved here LL | return a; | ^ value used here after move | -help: consider borrowing instead of transferring ownership +help: consider cloning the value if the performance cost is acceptable | -LL | dbg!(1, 2, &a, 1, 2); - | + +LL | dbg!(1, 2, a.clone(), 1, 2); + | ++++++++ error[E0382]: use of moved value: `b` --> $DIR/dbg-issue-120327.rs:16:12 @@ -34,14 +34,14 @@ error[E0382]: use of moved value: `b` LL | let b: String = "".to_string(); | - move occurs because `b` has type `String`, which does not implement the `Copy` trait LL | dbg!(a, b); - | ---------- value moved here + | - value moved here LL | return b; | ^ value used here after move | -help: consider borrowing instead of transferring ownership +help: consider cloning the value if the performance cost is acceptable | -LL | dbg!(a, &b); - | + +LL | dbg!(a, b.clone()); + | ++++++++ error[E0382]: use of moved value: `a` --> $DIR/dbg-issue-120327.rs:22:12 @@ -50,14 +50,14 @@ LL | fn x(a: String) -> String { | - move occurs because `a` has type `String`, which does not implement the `Copy` trait LL | let b: String = "".to_string(); LL | dbg!(a, b); - | ---------- value moved here + | - value moved here LL | return a; | ^ value used here after move | -help: consider borrowing instead of transferring ownership +help: consider cloning the value if the performance cost is acceptable | -LL | dbg!(&a, b); - | + +LL | dbg!(a.clone(), b); + | ++++++++ error[E0382]: use of moved value: `b` --> $DIR/dbg-issue-120327.rs:46:12 @@ -103,14 +103,14 @@ error[E0382]: borrow of moved value: `a` LL | let a: String = "".to_string(); | - move occurs because `a` has type `String`, which does not implement the `Copy` trait LL | let _res = get_expr(dbg!(a)); - | ------- value moved here + | - value moved here LL | let _l = a.len(); | ^ value borrowed here after move | -help: consider borrowing instead of transferring ownership +help: consider cloning the value if the performance cost is acceptable | -LL | let _res = get_expr(dbg!(&a)); - | + +LL | let _res = get_expr(dbg!(a.clone())); + | ++++++++ error: aborting due to 7 previous errors diff --git a/tests/ui/liveness/liveness-upvars.rs b/tests/ui/liveness/liveness-upvars.rs index be58b48a4057..0e198f1dea10 100644 --- a/tests/ui/liveness/liveness-upvars.rs +++ b/tests/ui/liveness/liveness-upvars.rs @@ -98,7 +98,7 @@ pub fn g(mut v: T) { } pub fn h() { - let mut z = T::default(); + let mut z = T::default(); //~ WARN unused variable: `z` let _ = move |b| { loop { if b { diff --git a/tests/ui/liveness/liveness-upvars.stderr b/tests/ui/liveness/liveness-upvars.stderr index cfed2830164a..0bb5786ab3e2 100644 --- a/tests/ui/liveness/liveness-upvars.stderr +++ b/tests/ui/liveness/liveness-upvars.stderr @@ -156,6 +156,14 @@ LL | z = T::default(); | = help: maybe it is overwritten before being read? +warning: unused variable: `z` + --> $DIR/liveness-upvars.rs:101:9 + | +LL | let mut z = T::default(); + | ^^^^^ help: if this is intentional, prefix it with an underscore: `_z` + | + = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]` + warning: value captured by `state` is never read --> $DIR/liveness-upvars.rs:131:9 | @@ -196,5 +204,5 @@ LL | s = yield (); | = help: maybe it is overwritten before being read? -warning: 24 warnings emitted +warning: 25 warnings emitted diff --git a/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr index f8ef315b9cc7..76b2d1be2779 100644 --- a/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr +++ b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr @@ -1,17 +1,21 @@ error[E0382]: use of moved value: `a` - --> $DIR/dbg-macro-move-semantics.rs:9:13 + --> $DIR/dbg-macro-move-semantics.rs:9:18 | LL | let a = NoCopy(0); | - move occurs because `a` has type `NoCopy`, which does not implement the `Copy` trait LL | let _ = dbg!(a); - | ------- value moved here + | - value moved here LL | let _ = dbg!(a); - | ^^^^^^^ value used here after move + | ^ value used here after move | -help: consider borrowing instead of transferring ownership +note: if `NoCopy` implemented `Clone`, you could clone the value + --> $DIR/dbg-macro-move-semantics.rs:4:1 | -LL | let _ = dbg!(&a); - | + +LL | struct NoCopy(usize); + | ^^^^^^^^^^^^^ consider implementing `Clone` for this type +... +LL | let _ = dbg!(a); + | - you could clone this value error: aborting due to 1 previous error From 9fd2c9ef01d859ac3eaa04d68804140a988d75ae Mon Sep 17 00:00:00 2001 From: Jean IBARZ Date: Sun, 29 Mar 2026 14:15:57 +0200 Subject: [PATCH 15/19] Add regression test for recursive lazy type alias normalization ICE Exercises a self-referencing type alias with lazy_type_alias and min_generic_const_args, which previously caused an ICE during normalization. --- .../recursive-lazy-type-alias-ice-152633.rs | 14 ++++++++++++++ .../recursive-lazy-type-alias-ice-152633.stderr | 11 +++++++++++ 2 files changed, 25 insertions(+) create mode 100644 tests/ui/type-alias/recursive-lazy-type-alias-ice-152633.rs create mode 100644 tests/ui/type-alias/recursive-lazy-type-alias-ice-152633.stderr diff --git a/tests/ui/type-alias/recursive-lazy-type-alias-ice-152633.rs b/tests/ui/type-alias/recursive-lazy-type-alias-ice-152633.rs new file mode 100644 index 000000000000..4b3633653133 --- /dev/null +++ b/tests/ui/type-alias/recursive-lazy-type-alias-ice-152633.rs @@ -0,0 +1,14 @@ +//! Ensure a self-referencing lazy type alias with `min_generic_const_args` +//! doesn't ICE during normalization. +//! +//! Regression test for . + +#![feature(lazy_type_alias)] +#![feature(min_generic_const_args)] + +trait Trait { + type const ASSOC: (); +} +type Arr2 = [usize; ::ASSOC]; //~ ERROR E0275 + +fn main() {} diff --git a/tests/ui/type-alias/recursive-lazy-type-alias-ice-152633.stderr b/tests/ui/type-alias/recursive-lazy-type-alias-ice-152633.stderr new file mode 100644 index 000000000000..a8e68a05253b --- /dev/null +++ b/tests/ui/type-alias/recursive-lazy-type-alias-ice-152633.stderr @@ -0,0 +1,11 @@ +error[E0275]: overflow normalizing the type alias `Arr2` + --> $DIR/recursive-lazy-type-alias-ice-152633.rs:12:1 + | +LL | type Arr2 = [usize; ::ASSOC]; + | ^^^^^^^^^ + | + = note: in case this is a recursive type alias, consider using a struct, enum, or union instead + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0275`. From c67380d6fe272b985bc8fdb4a54abfca5d51bf97 Mon Sep 17 00:00:00 2001 From: Sasha Pourcelot Date: Thu, 19 Mar 2026 21:35:58 +0000 Subject: [PATCH 16/19] rustdoc: add test showing cfg pretty-printing of all targets --- tests/rustdoc-html/doc-cfg/all-targets.rs | 144 ++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 tests/rustdoc-html/doc-cfg/all-targets.rs diff --git a/tests/rustdoc-html/doc-cfg/all-targets.rs b/tests/rustdoc-html/doc-cfg/all-targets.rs new file mode 100644 index 000000000000..ab6e6c216eef --- /dev/null +++ b/tests/rustdoc-html/doc-cfg/all-targets.rs @@ -0,0 +1,144 @@ +#![feature(doc_cfg)] + +//@ has all_targets/fn.foo.html \ +// '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ +// 'Available on GNU or target_env=macabi or target_env=mlibc or MSVC or musl or \ +// Newlib or target_env=nto70 or target_env=nto71 or target_env=nto71_iosock or \ +// target_env=nto80 or target_env=ohos or target_env=relibc or SGX or \ +// target_env=sim or target_env=p1 or target_env=p2 or target_env=p3 or uClibc or \ +// target_env=v5 or target_env=fake_env only.' +#[doc(cfg(any( + target_env = "gnu", + target_env = "macabi", + target_env = "mlibc", + target_env = "msvc", + target_env = "musl", + target_env = "newlib", + target_env = "nto70", + target_env = "nto71", + target_env = "nto71_iosock", + target_env = "nto80", + target_env = "ohos", + target_env = "relibc", + target_env = "sgx", + target_env = "sim", + target_env = "p1", + target_env = "p2", + target_env = "p3", + target_env = "uclibc", + target_env = "v5", + target_env = "fake_env", +)))] +pub fn foo() {} + +//@ has all_targets/fn.bar.html \ +// '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ +// 'Available on AArch64 or target_arch=amdgpu or ARM or target_arch=arm64ec or \ +// target_arch=avr or target_arch=bpf or CSKY or target_arch=hexagon or LoongArch \ +// LA32 or LoongArch LA64 or M68k or MIPS or MIPS Release 6 or MIPS-64 or MIPS-64 \ +// Release 6 or MSP430 or target_arch=nvptx64 or PowerPC or PowerPC-64 or RISC-V \ +// RV32 or RISC-V RV64 or s390x or target_arch=sparc or SPARC64 or \ +// target_arch=spirv or WebAssembly or WebAssembly or x86 or x86-64 or \ +// target_arch=xtensa or target_arch=fake_arch only.' +#[doc(cfg(any( + target_arch = "aarch64", + target_arch = "amdgpu", + target_arch = "arm", + target_arch = "arm64ec", + target_arch = "avr", + target_arch = "bpf", + target_arch = "csky", + target_arch = "hexagon", + target_arch = "loongarch32", + target_arch = "loongarch64", + target_arch = "m68k", + target_arch = "mips", + target_arch = "mips32r6", + target_arch = "mips64", + target_arch = "mips64r6", + target_arch = "msp430", + target_arch = "nvptx64", + target_arch = "powerpc", + target_arch = "powerpc64", + target_arch = "riscv32", + target_arch = "riscv64", + target_arch = "s390x", + target_arch = "sparc", + target_arch = "sparc64", + target_arch = "spirv", + target_arch = "wasm32", + target_arch = "wasm64", + target_arch = "x86", + target_arch = "x86_64", + target_arch = "xtensa", + target_arch = "fake_arch", +)))] +pub fn bar() {} + +//@ has all_targets/fn.baz.html \ +// '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ +// 'Available on target_os=aix and target_os=amdhsa and Android and target_os=cuda \ +// and Cygwin and DragonFly BSD and Emscripten and target_os=espidf and FreeBSD \ +// and Fuchsia and Haiku and target_os=helenos and Hermit and target_os=horizon \ +// and target_os=hurd and illumos and iOS and L4Re and Linux and \ +// target_os=lynxos178 and macOS and target_os=managarm and target_os=motor and \ +// NetBSD and target_os=none and target_os=nto and target_os=nuttx and OpenBSD and \ +// target_os=psp and target_os=psx and target_os=qurt and Redox and \ +// target_os=rtems and Solaris and target_os=solid_asp3 and target_os=teeos and \ +// target_os=trusty and tvOS and target_os=uefi and target_os=vexos and visionOS \ +// and target_os=vita and target_os=vxworks and WASI and watchOS and Windows and \ +// target_os=xous and target_os=zkvm and target_os=unknown and target_os=fake_os \ +// only.' +#[doc(cfg(all( + target_os = "aix", + target_os = "amdhsa", + target_os = "android", + target_os = "cuda", + target_os = "cygwin", + target_os = "dragonfly", + target_os = "emscripten", + target_os = "espidf", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "haiku", + target_os = "helenos", + target_os = "hermit", + target_os = "horizon", + target_os = "hurd", + target_os = "illumos", + target_os = "ios", + target_os = "l4re", + target_os = "linux", + target_os = "lynxos178", + target_os = "macos", + target_os = "managarm", + target_os = "motor", + target_os = "netbsd", + target_os = "none", + target_os = "nto", + target_os = "nuttx", + target_os = "openbsd", + target_os = "psp", + target_os = "psx", + target_os = "qurt", + target_os = "redox", + target_os = "rtems", + target_os = "solaris", + target_os = "solid_asp3", + target_os = "teeos", + target_os = "trusty", + target_os = "tvos", + target_os = "uefi", + target_os = "vexos", + target_os = "visionos", + target_os = "vita", + target_os = "vxworks", + target_os = "wasi", + target_os = "watchos", + target_os = "windows", + target_os = "xous", + target_os = "zkvm", + target_os = "unknown", + target_os = "fake_os", +)))] +pub fn baz() {} From 9f0944832b62279adba24c702e5d6f7a94880485 Mon Sep 17 00:00:00 2001 From: Sasha Pourcelot Date: Thu, 19 Mar 2026 21:35:58 +0000 Subject: [PATCH 17/19] rustdoc: add missing target_{os,arch,env} values for cfg pretty printer --- src/librustdoc/clean/cfg.rs | 195 +++++++++++++++------- tests/rustdoc-gui/item-info-overflow.goml | 4 +- tests/rustdoc-html/doc-cfg/all-targets.rs | 43 +++-- 3 files changed, 159 insertions(+), 83 deletions(-) diff --git a/src/librustdoc/clean/cfg.rs b/src/librustdoc/clean/cfg.rs index 3ec2bc3af8d4..ee03431d036b 100644 --- a/src/librustdoc/clean/cfg.rs +++ b/src/librustdoc/clean/cfg.rs @@ -3,6 +3,7 @@ // FIXME: Once the portability lint RFC is implemented (see tracking issue #41619), // switch to use those structures instead. +use std::str::FromStr; use std::sync::Arc; use std::{fmt, mem, ops}; @@ -15,6 +16,7 @@ use rustc_middle::ty::TyCtxt; use rustc_span::symbol::{Symbol, sym}; use rustc_span::{DUMMY_SP, Span}; +use rustc_target::spec; use crate::display::{Joined as _, MaybeDisplay, Wrapped}; use crate::html::escape::Escape; @@ -421,54 +423,10 @@ fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { (sym::unix, None) => "Unix", (sym::windows, None) => "Windows", (sym::debug_assertions, None) => "debug-assertions enabled", - (sym::target_os, Some(os)) => match os.as_str() { - "android" => "Android", - "cygwin" => "Cygwin", - "dragonfly" => "DragonFly BSD", - "emscripten" => "Emscripten", - "freebsd" => "FreeBSD", - "fuchsia" => "Fuchsia", - "haiku" => "Haiku", - "hermit" => "Hermit", - "illumos" => "illumos", - "ios" => "iOS", - "l4re" => "L4Re", - "linux" => "Linux", - "macos" => "macOS", - "netbsd" => "NetBSD", - "openbsd" => "OpenBSD", - "redox" => "Redox", - "solaris" => "Solaris", - "tvos" => "tvOS", - "wasi" => "WASI", - "watchos" => "watchOS", - "windows" => "Windows", - "visionos" => "visionOS", - _ => "", - }, - (sym::target_arch, Some(arch)) => match arch.as_str() { - "aarch64" => "AArch64", - "arm" => "ARM", - "loongarch32" => "LoongArch LA32", - "loongarch64" => "LoongArch LA64", - "m68k" => "M68k", - "csky" => "CSKY", - "mips" => "MIPS", - "mips32r6" => "MIPS Release 6", - "mips64" => "MIPS-64", - "mips64r6" => "MIPS-64 Release 6", - "msp430" => "MSP430", - "powerpc" => "PowerPC", - "powerpc64" => "PowerPC-64", - "riscv32" => "RISC-V RV32", - "riscv64" => "RISC-V RV64", - "s390x" => "s390x", - "sparc64" => "SPARC64", - "wasm32" | "wasm64" => "WebAssembly", - "x86" => "x86", - "x86_64" => "x86-64", - _ => "", - }, + (sym::target_os, Some(os)) => human_readable_target_os(*os).unwrap_or_default(), + (sym::target_arch, Some(arch)) => { + human_readable_target_arch(*arch).unwrap_or_default() + } (sym::target_vendor, Some(vendor)) => match vendor.as_str() { "apple" => "Apple", "pc" => "PC", @@ -476,15 +434,9 @@ fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { "fortanix" => "Fortanix", _ => "", }, - (sym::target_env, Some(env)) => match env.as_str() { - "gnu" => "GNU", - "msvc" => "MSVC", - "musl" => "musl", - "newlib" => "Newlib", - "uclibc" => "uClibc", - "sgx" => "SGX", - _ => "", - }, + (sym::target_env, Some(env)) => { + human_readable_target_env(*env).unwrap_or_default() + } (sym::target_endian, Some(endian)) => { return write!(fmt, "{endian}-endian"); } @@ -527,6 +479,135 @@ fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { } } +fn human_readable_target_os(os: Symbol) -> Option<&'static str> { + let os = spec::Os::from_str(os.as_str()).ok()?; + + use spec::Os::*; + Some(match os { + // tidy-alphabetical-start + Aix => "AIX", + AmdHsa => "AMD HSA", + Android => "Android", + Cuda => "CUDA", + Cygwin => "Cygwin", + Dragonfly => "DragonFly BSD", + Emscripten => "Emscripten", + EspIdf => "ESP-IDF", + FreeBsd => "FreeBSD", + Fuchsia => "Fuchsia", + Haiku => "Haiku", + HelenOs => "HelenOS", + Hermit => "Hermit", + Horizon => "Horizon", + Hurd => "GNU/Hurd", + IOs => "iOS", + Illumos => "illumos", + L4Re => "L4Re", + Linux => "Linux", + LynxOs178 => "LynxOS-178", + MacOs => "macOS", + Managarm => "Managarm", + Motor => "Motor OS", + NetBsd => "NetBSD", + None => "bare-metal", // FIXME(scrabsha): is this appropriate? + Nto => "QNX Neutrino", + NuttX => "NuttX", + OpenBsd => "OpenBSD", + Psp => "Play Station Portable", + Psx => "Play Station 1", + Qurt => "QuRT", + Redox => "Redox OS", + Rtems => "RTEMS OS", + Solaris => "Solaris", + SolidAsp3 => "SOLID ASP3", + TeeOs => "TEEOS", + Trusty => "Trusty", + TvOs => "tvOS", + Uefi => "UEFI", + VexOs => "VEXos", + VisionOs => "visionOS", + Vita => "Play Station Vita", + VxWorks => "VxWorks", + Wasi => "WASI", + WatchOs => "watchOS", + Windows => "Windows", + Xous => "Xous", + Zkvm => "zero knowledge Virtual Machine", + // tidy-alphabetical-end + Unknown | Other(_) => return Option::None, + }) +} + +fn human_readable_target_arch(os: Symbol) -> Option<&'static str> { + let arch = spec::Arch::from_str(os.as_str()).ok()?; + + use spec::Arch::*; + Some(match arch { + // tidy-alphabetical-start + AArch64 => "AArch64", + AmdGpu => "AMG GPU", + Arm => "ARM", + Arm64EC => "ARM64EC", + Avr => "AVR", + Bpf => "BPF", + CSky => "C-SKY", + Hexagon => "Hexagon", + LoongArch32 => "LoongArch64", + LoongArch64 => "LoongArch32", + M68k => "Motorola 680x0", + Mips => "MIPS", + Mips32r6 => "MIPS release 6", + Mips64 => "MIPS-64", + Mips64r6 => "MIPS-64 release 6", + Msp430 => "MSP430", + Nvptx64 => "NVidia GPU", + PowerPC => "PowerPC", + PowerPC64 => "PowerPC64", + RiscV32 => "RISC-V RV32", + RiscV64 => "RISC-V RV64", + S390x => "s390x", + Sparc => "SPARC", + Sparc64 => "SPARC-64", + SpirV => "SPIR-V", + Wasm32 | Wasm64 => "WebAssembly", + X86 => "x86", + X86_64 => "x86-64", + Xtensa => "Xtensa", + // tidy-alphabetical-end + Other(_) => return None, + }) +} + +fn human_readable_target_env(env: Symbol) -> Option<&'static str> { + let env = spec::Env::from_str(env.as_str()).ok()?; + + use spec::Env::*; + Some(match env { + // tidy-alphabetical-start + Gnu => "GNU", + MacAbi => "Catalyst", + Mlibc => "mac ABI", + Msvc => "MSVC", + Musl => "musl", + Newlib => "Newlib", + Nto70 => "Neutrino 7.0", + Nto71 => "Neutrino 7.1", + Nto71IoSock => "Neutrino 7.1 with io-sock", + Nto80 => "Neutrino 8.0", + Ohos => "OpenHarmony", + P1 => "WASIp1", + P2 => "WASIp2", + P3 => "WASIp3", + Relibc => "relibc", + Sgx => "SGX", + Sim => "Simulator", + Uclibc => "uClibc", + V5 => "V5", + // tidy-alphabetical-end + Unspecified | Other(_) => return None, + }) +} + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] struct NameValueCfg { name: Symbol, diff --git a/tests/rustdoc-gui/item-info-overflow.goml b/tests/rustdoc-gui/item-info-overflow.goml index 2c4e06e297c7..b53ffb00f1c3 100644 --- a/tests/rustdoc-gui/item-info-overflow.goml +++ b/tests/rustdoc-gui/item-info-overflow.goml @@ -8,7 +8,7 @@ assert-property: (".item-info", {"scrollWidth": "940"}) // Just to be sure we're comparing the correct "item-info": assert-text: ( ".item-info", - "Available on Android or Linux or Emscripten or DragonFly BSD", + "Available on Android or Linux or Emscripten or DragonFly BSD or FreeBSD or NetBSD or OpenBSD", STARTS_WITH, ) @@ -26,6 +26,6 @@ assert-property: ( // Just to be sure we're comparing the correct "item-info": assert-text: ( "#impl-SimpleTrait-for-LongItemInfo2 .item-info", - "Available on Android or Linux or Emscripten or DragonFly BSD", + "Available on Android or Linux or Emscripten or DragonFly BSD or FreeBSD or NetBSD or OpenBSD", STARTS_WITH, ) diff --git a/tests/rustdoc-html/doc-cfg/all-targets.rs b/tests/rustdoc-html/doc-cfg/all-targets.rs index ab6e6c216eef..4db41e1f8344 100644 --- a/tests/rustdoc-html/doc-cfg/all-targets.rs +++ b/tests/rustdoc-html/doc-cfg/all-targets.rs @@ -2,11 +2,10 @@ //@ has all_targets/fn.foo.html \ // '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ -// 'Available on GNU or target_env=macabi or target_env=mlibc or MSVC or musl or \ -// Newlib or target_env=nto70 or target_env=nto71 or target_env=nto71_iosock or \ -// target_env=nto80 or target_env=ohos or target_env=relibc or SGX or \ -// target_env=sim or target_env=p1 or target_env=p2 or target_env=p3 or uClibc or \ -// target_env=v5 or target_env=fake_env only.' +// 'Available on GNU or Catalyst or mac ABI or MSVC or musl or Newlib or \ +// Neutrino 7.0 or Neutrino 7.1 or Neutrino 7.1 with io-sock or Neutrino 8.0 or \ +// OpenHarmony or relibc or SGX or Simulator or WASIp1 or WASIp2 or WASIp3 or \ +// uClibc or V5 or target_env=fake_env only.' #[doc(cfg(any( target_env = "gnu", target_env = "macabi", @@ -33,13 +32,12 @@ pub fn foo() {} //@ has all_targets/fn.bar.html \ // '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ -// 'Available on AArch64 or target_arch=amdgpu or ARM or target_arch=arm64ec or \ -// target_arch=avr or target_arch=bpf or CSKY or target_arch=hexagon or LoongArch \ -// LA32 or LoongArch LA64 or M68k or MIPS or MIPS Release 6 or MIPS-64 or MIPS-64 \ -// Release 6 or MSP430 or target_arch=nvptx64 or PowerPC or PowerPC-64 or RISC-V \ -// RV32 or RISC-V RV64 or s390x or target_arch=sparc or SPARC64 or \ -// target_arch=spirv or WebAssembly or WebAssembly or x86 or x86-64 or \ -// target_arch=xtensa or target_arch=fake_arch only.' +// 'Available on AArch64 or AMG GPU or ARM or ARM64EC or AVR or BPF or C-SKY or \ +// Hexagon or LoongArch64 or LoongArch32 or Motorola 680x0 or MIPS or MIPS release \ +// 6 or MIPS-64 or MIPS-64 release 6 or MSP430 or NVidia GPU or PowerPC or \ +// PowerPC64 or RISC-V RV32 or RISC-V RV64 or s390x or SPARC or SPARC-64 or SPIR-V \ +// or WebAssembly or WebAssembly or x86 or x86-64 or Xtensa or \ +// target_arch=fake_arch only.' #[doc(cfg(any( target_arch = "aarch64", target_arch = "amdgpu", @@ -77,18 +75,15 @@ pub fn bar() {} //@ has all_targets/fn.baz.html \ // '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ -// 'Available on target_os=aix and target_os=amdhsa and Android and target_os=cuda \ -// and Cygwin and DragonFly BSD and Emscripten and target_os=espidf and FreeBSD \ -// and Fuchsia and Haiku and target_os=helenos and Hermit and target_os=horizon \ -// and target_os=hurd and illumos and iOS and L4Re and Linux and \ -// target_os=lynxos178 and macOS and target_os=managarm and target_os=motor and \ -// NetBSD and target_os=none and target_os=nto and target_os=nuttx and OpenBSD and \ -// target_os=psp and target_os=psx and target_os=qurt and Redox and \ -// target_os=rtems and Solaris and target_os=solid_asp3 and target_os=teeos and \ -// target_os=trusty and tvOS and target_os=uefi and target_os=vexos and visionOS \ -// and target_os=vita and target_os=vxworks and WASI and watchOS and Windows and \ -// target_os=xous and target_os=zkvm and target_os=unknown and target_os=fake_os \ -// only.' +// 'Available on AIX and AMD HSA and Android and CUDA and Cygwin and DragonFly \ +// BSD and Emscripten and ESP-IDF and FreeBSD and Fuchsia and Haiku and HelenOS \ +// and Hermit and Horizon and GNU/Hurd and illumos and iOS and L4Re and Linux \ +// and LynxOS-178 and macOS and Managarm and Motor OS and NetBSD and bare-metal \ +// and QNX Neutrino and NuttX and OpenBSD and Play Station Portable and Play \ +// Station 1 and QuRT and Redox OS and RTEMS OS and Solaris and SOLID ASP3 and \ +// TEEOS and Trusty and tvOS and UEFI and VEXos and visionOS and Play Station \ +// Vita and VxWorks and WASI and watchOS and Windows and Xous and zero knowledge \ +// Virtual Machine and target_os=unknown and target_os=fake_os only.' #[doc(cfg(all( target_os = "aix", target_os = "amdhsa", From 7d1b41cbb386fef7763885f738f7f89b48de10e2 Mon Sep 17 00:00:00 2001 From: dianne Date: Sun, 29 Mar 2026 08:08:51 -0700 Subject: [PATCH 18/19] update diagnostic for variables moved by `dbg!` --- .../src/diagnostics/conflict_errors.rs | 40 +++++---- compiler/rustc_span/src/symbol.rs | 1 + src/tools/clippy/clippy_utils/src/sym.rs | 1 - tests/ui/borrowck/dbg-issue-120327.rs | 53 ++++------- tests/ui/borrowck/dbg-issue-120327.stderr | 87 ++++++++++++------- .../dbg-macro-move-semantics.stderr | 4 + 6 files changed, 99 insertions(+), 87 deletions(-) diff --git a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs index 641121597848..56facbb70e64 100644 --- a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs @@ -545,8 +545,6 @@ fn visit_pat(&mut self, p: &'hir hir::Pat<'hir>) { } // for dbg!(x) which may take ownership, suggest dbg!(&x) instead - // but here we actually do not check whether the macro name is `dbg!` - // so that we may extend the scope a bit larger to cover more cases fn suggest_ref_for_dbg_args( &self, body: &hir::Expr<'_>, @@ -560,29 +558,41 @@ fn suggest_ref_for_dbg_args( }); let Some(var_info) = var_info else { return }; let arg_name = var_info.name; - struct MatchArgFinder { - expr_span: Span, - match_arg_span: Option, + struct MatchArgFinder<'tcx> { + tcx: TyCtxt<'tcx>, + move_span: Span, arg_name: Symbol, + match_arg_span: Option = None, } - impl Visitor<'_> for MatchArgFinder { + impl Visitor<'_> for MatchArgFinder<'_> { fn visit_expr(&mut self, e: &hir::Expr<'_>) { // dbg! is expanded into a match pattern, we need to find the right argument span - if let hir::ExprKind::Match(expr, ..) = &e.kind - && let hir::ExprKind::Path(hir::QPath::Resolved( - _, - path @ Path { segments: [seg], .. }, - )) = &expr.kind - && seg.ident.name == self.arg_name - && self.expr_span.source_callsite().contains(expr.span) + if let hir::ExprKind::Match(scrutinee, ..) = &e.kind + && let hir::ExprKind::Tup(args) = scrutinee.kind + && e.span.macro_backtrace().any(|expn| { + expn.macro_def_id.is_some_and(|macro_def_id| { + self.tcx.is_diagnostic_item(sym::dbg_macro, macro_def_id) + }) + }) { - self.match_arg_span = Some(path.span); + for arg in args { + if let hir::ExprKind::Path(hir::QPath::Resolved( + _, + path @ Path { segments: [seg], .. }, + )) = &arg.kind + && seg.ident.name == self.arg_name + && self.move_span.source_equal(arg.span) + { + self.match_arg_span = Some(path.span); + return; + } + } } hir::intravisit::walk_expr(self, e); } } - let mut finder = MatchArgFinder { expr_span: move_span, match_arg_span: None, arg_name }; + let mut finder = MatchArgFinder { tcx: self.infcx.tcx, move_span, arg_name, .. }; finder.visit_expr(body); if let Some(macro_arg_span) = finder.match_arg_span { err.span_suggestion_verbose( diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 286fea7d9050..e6658fc0eec1 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -746,6 +746,7 @@ custom_mir, custom_test_frameworks, d32, + dbg_macro, dead_code, dealloc, debug, diff --git a/src/tools/clippy/clippy_utils/src/sym.rs b/src/tools/clippy/clippy_utils/src/sym.rs index d6ba678434bc..909dc3956d5f 100644 --- a/src/tools/clippy/clippy_utils/src/sym.rs +++ b/src/tools/clippy/clippy_utils/src/sym.rs @@ -199,7 +199,6 @@ macro_rules! generate { cx, cycle, cyclomatic_complexity, - dbg_macro, de, debug_struct, deprecated_in_future, diff --git a/tests/ui/borrowck/dbg-issue-120327.rs b/tests/ui/borrowck/dbg-issue-120327.rs index 2de43f634877..45605acc3433 100644 --- a/tests/ui/borrowck/dbg-issue-120327.rs +++ b/tests/ui/borrowck/dbg-issue-120327.rs @@ -1,67 +1,44 @@ +//! Diagnostic test for : suggest borrowing +//! variables passed to `dbg!` that are later used. +//@ dont-require-annotations: HELP + fn s() -> String { let a = String::new(); - dbg!(a); + dbg!(a); //~ HELP consider borrowing instead of transferring ownership return a; //~ ERROR use of moved value: } fn m() -> String { let a = String::new(); - dbg!(1, 2, a, 1, 2); + dbg!(1, 2, a, 1, 2); //~ HELP consider borrowing instead of transferring ownership return a; //~ ERROR use of moved value: } fn t(a: String) -> String { let b: String = "".to_string(); - dbg!(a, b); + dbg!(a, b); //~ HELP consider borrowing instead of transferring ownership return b; //~ ERROR use of moved value: } fn x(a: String) -> String { let b: String = "".to_string(); - dbg!(a, b); + dbg!(a, b); //~ HELP consider borrowing instead of transferring ownership return a; //~ ERROR use of moved value: } -macro_rules! my_dbg { - () => { - eprintln!("[{}:{}:{}]", file!(), line!(), column!()) - }; - ($val:expr $(,)?) => { - match $val { - tmp => { - eprintln!("[{}:{}:{}] {} = {:#?}", - file!(), line!(), column!(), stringify!($val), &tmp); - tmp - } - } - }; - ($($val:expr),+ $(,)?) => { - ($(my_dbg!($val)),+,) - }; -} - -fn test_my_dbg() -> String { - let b: String = "".to_string(); - my_dbg!(b, 1); - return b; //~ ERROR use of moved value: -} - -fn test_not_macro() -> String { - let a = String::new(); - let _b = match a { - tmp => { - eprintln!("dbg: {}", tmp); - tmp - } - }; - return a; //~ ERROR use of moved value: +fn two_of_them(a: String) -> String { + dbg!(a, a); //~ ERROR use of moved value + //~| HELP consider borrowing instead of transferring ownership + //~| HELP consider borrowing instead of transferring ownership + return a; //~ ERROR use of moved value } fn get_expr(_s: String) {} +// The suggestion is purely syntactic; applying it here will result in a type error. fn test() { let a: String = "".to_string(); - let _res = get_expr(dbg!(a)); + let _res = get_expr(dbg!(a)); //~ HELP consider borrowing instead of transferring ownership let _l = a.len(); //~ ERROR borrow of moved value } diff --git a/tests/ui/borrowck/dbg-issue-120327.stderr b/tests/ui/borrowck/dbg-issue-120327.stderr index 685a530a1fe5..e7a7151e541d 100644 --- a/tests/ui/borrowck/dbg-issue-120327.stderr +++ b/tests/ui/borrowck/dbg-issue-120327.stderr @@ -1,5 +1,5 @@ error[E0382]: use of moved value: `a` - --> $DIR/dbg-issue-120327.rs:4:12 + --> $DIR/dbg-issue-120327.rs:8:12 | LL | let a = String::new(); | - move occurs because `a` has type `String`, which does not implement the `Copy` trait @@ -12,9 +12,13 @@ help: consider cloning the value if the performance cost is acceptable | LL | dbg!(a.clone()); | ++++++++ +help: consider borrowing instead of transferring ownership + | +LL | dbg!(&a); + | + error[E0382]: use of moved value: `a` - --> $DIR/dbg-issue-120327.rs:10:12 + --> $DIR/dbg-issue-120327.rs:14:12 | LL | let a = String::new(); | - move occurs because `a` has type `String`, which does not implement the `Copy` trait @@ -27,9 +31,13 @@ help: consider cloning the value if the performance cost is acceptable | LL | dbg!(1, 2, a.clone(), 1, 2); | ++++++++ +help: consider borrowing instead of transferring ownership + | +LL | dbg!(1, 2, &a, 1, 2); + | + error[E0382]: use of moved value: `b` - --> $DIR/dbg-issue-120327.rs:16:12 + --> $DIR/dbg-issue-120327.rs:20:12 | LL | let b: String = "".to_string(); | - move occurs because `b` has type `String`, which does not implement the `Copy` trait @@ -42,9 +50,13 @@ help: consider cloning the value if the performance cost is acceptable | LL | dbg!(a, b.clone()); | ++++++++ +help: consider borrowing instead of transferring ownership + | +LL | dbg!(a, &b); + | + error[E0382]: use of moved value: `a` - --> $DIR/dbg-issue-120327.rs:22:12 + --> $DIR/dbg-issue-120327.rs:26:12 | LL | fn x(a: String) -> String { | - move occurs because `a` has type `String`, which does not implement the `Copy` trait @@ -58,47 +70,52 @@ help: consider cloning the value if the performance cost is acceptable | LL | dbg!(a.clone(), b); | ++++++++ - -error[E0382]: use of moved value: `b` - --> $DIR/dbg-issue-120327.rs:46:12 - | -LL | tmp => { - | --- value moved here -... -LL | let b: String = "".to_string(); - | - move occurs because `b` has type `String`, which does not implement the `Copy` trait -LL | my_dbg!(b, 1); -LL | return b; - | ^ value used here after move - | help: consider borrowing instead of transferring ownership | -LL | my_dbg!(&b, 1); - | + -help: borrow this binding in the pattern to avoid moving the value - | -LL | ref tmp => { - | +++ +LL | dbg!(&a, b); + | + error[E0382]: use of moved value: `a` - --> $DIR/dbg-issue-120327.rs:57:12 + --> $DIR/dbg-issue-120327.rs:30:13 | -LL | let a = String::new(); - | - move occurs because `a` has type `String`, which does not implement the `Copy` trait -LL | let _b = match a { -LL | tmp => { - | --- value moved here +LL | fn two_of_them(a: String) -> String { + | - move occurs because `a` has type `String`, which does not implement the `Copy` trait +LL | dbg!(a, a); + | - ^ value used here after move + | | + | value moved here + | +help: consider cloning the value if the performance cost is acceptable + | +LL | dbg!(a.clone(), a); + | ++++++++ +help: consider borrowing instead of transferring ownership + | +LL | dbg!(&a, a); + | + + +error[E0382]: use of moved value: `a` + --> $DIR/dbg-issue-120327.rs:33:12 + | +LL | fn two_of_them(a: String) -> String { + | - move occurs because `a` has type `String`, which does not implement the `Copy` trait +LL | dbg!(a, a); + | - value moved here ... LL | return a; | ^ value used here after move | -help: borrow this binding in the pattern to avoid moving the value +help: consider cloning the value if the performance cost is acceptable | -LL | ref tmp => { - | +++ +LL | dbg!(a, a.clone()); + | ++++++++ +help: consider borrowing instead of transferring ownership + | +LL | dbg!(a, &a); + | + error[E0382]: borrow of moved value: `a` - --> $DIR/dbg-issue-120327.rs:65:14 + --> $DIR/dbg-issue-120327.rs:42:14 | LL | let a: String = "".to_string(); | - move occurs because `a` has type `String`, which does not implement the `Copy` trait @@ -111,6 +128,10 @@ help: consider cloning the value if the performance cost is acceptable | LL | let _res = get_expr(dbg!(a.clone())); | ++++++++ +help: consider borrowing instead of transferring ownership + | +LL | let _res = get_expr(dbg!(&a)); + | + error: aborting due to 7 previous errors diff --git a/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr index 76b2d1be2779..7ce5ebf81e31 100644 --- a/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr +++ b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr @@ -16,6 +16,10 @@ LL | struct NoCopy(usize); ... LL | let _ = dbg!(a); | - you could clone this value +help: consider borrowing instead of transferring ownership + | +LL | let _ = dbg!(&a); + | + error: aborting due to 1 previous error From 77199806b7ca6ccbe57e5692e861d6bab131b10e Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Mon, 30 Mar 2026 05:38:07 +0000 Subject: [PATCH 19/19] Prepare for merging from rust-lang/rust This updates the rust-version file to 116458d0a5ae01cd517cabd2d1aee7f5457018ab. --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index c98397c1c67f..85571d95f742 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -148adf223edb0444eb1f99753919dd2080c2a534 +116458d0a5ae01cd517cabd2d1aee7f5457018ab