From 72a001bc25217104f9de5ff4b35c280c95adcb28 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 27 Feb 2026 10:09:39 +1100 Subject: [PATCH] Remove `DepKindVTable::is_anon`. It's unused. --- compiler/rustc_middle/src/dep_graph/dep_node.rs | 5 ----- compiler/rustc_query_impl/src/dep_kind_vtables.rs | 9 --------- 2 files changed, 14 deletions(-) diff --git a/compiler/rustc_middle/src/dep_graph/dep_node.rs b/compiler/rustc_middle/src/dep_graph/dep_node.rs index 599c84597a8b..c356d566626d 100644 --- a/compiler/rustc_middle/src/dep_graph/dep_node.rs +++ b/compiler/rustc_middle/src/dep_graph/dep_node.rs @@ -174,11 +174,6 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { /// of the `DepKind`. Overall, this allows to implement `DepContext` using this manual /// jump table instead of large matches. pub struct DepKindVTable<'tcx> { - /// Anonymous queries cannot be replayed from one compiler invocation to the next. - /// When their result is needed, it is recomputed. They are useful for fine-grained - /// dependency tracking, and caching within one compiler invocation. - pub is_anon: bool, - /// Eval-always queries do not track their dependencies, and are always recomputed, even if /// their inputs have not changed since the last compiler invocation. The result is still /// cached within one compiler invocation. diff --git a/compiler/rustc_query_impl/src/dep_kind_vtables.rs b/compiler/rustc_query_impl/src/dep_kind_vtables.rs index fa82a0413b1a..01e37ca3e3ee 100644 --- a/compiler/rustc_query_impl/src/dep_kind_vtables.rs +++ b/compiler/rustc_query_impl/src/dep_kind_vtables.rs @@ -13,7 +13,6 @@ mod non_query { // We use this for most things when incr. comp. is turned off. pub(crate) fn Null<'tcx>() -> DepKindVTable<'tcx> { DepKindVTable { - is_anon: false, is_eval_always: false, key_fingerprint_style: KeyFingerprintStyle::Unit, force_from_dep_node_fn: Some(|_, dep_node, _| { @@ -26,7 +25,6 @@ pub(crate) fn Null<'tcx>() -> DepKindVTable<'tcx> { // We use this for the forever-red node. pub(crate) fn Red<'tcx>() -> DepKindVTable<'tcx> { DepKindVTable { - is_anon: false, is_eval_always: false, key_fingerprint_style: KeyFingerprintStyle::Unit, force_from_dep_node_fn: Some(|_, dep_node, _| { @@ -38,7 +36,6 @@ pub(crate) fn Red<'tcx>() -> DepKindVTable<'tcx> { pub(crate) fn SideEffect<'tcx>() -> DepKindVTable<'tcx> { DepKindVTable { - is_anon: false, is_eval_always: false, key_fingerprint_style: KeyFingerprintStyle::Unit, force_from_dep_node_fn: Some(|tcx, _, prev_index| { @@ -51,7 +48,6 @@ pub(crate) fn SideEffect<'tcx>() -> DepKindVTable<'tcx> { pub(crate) fn AnonZeroDeps<'tcx>() -> DepKindVTable<'tcx> { DepKindVTable { - is_anon: true, is_eval_always: false, key_fingerprint_style: KeyFingerprintStyle::Opaque, force_from_dep_node_fn: Some(|_, _, _| bug!("cannot force an anon node")), @@ -61,7 +57,6 @@ pub(crate) fn AnonZeroDeps<'tcx>() -> DepKindVTable<'tcx> { pub(crate) fn TraitSelect<'tcx>() -> DepKindVTable<'tcx> { DepKindVTable { - is_anon: true, is_eval_always: false, key_fingerprint_style: KeyFingerprintStyle::Unit, force_from_dep_node_fn: None, @@ -71,7 +66,6 @@ pub(crate) fn TraitSelect<'tcx>() -> DepKindVTable<'tcx> { pub(crate) fn CompileCodegenUnit<'tcx>() -> DepKindVTable<'tcx> { DepKindVTable { - is_anon: false, is_eval_always: false, key_fingerprint_style: KeyFingerprintStyle::Opaque, force_from_dep_node_fn: None, @@ -81,7 +75,6 @@ pub(crate) fn CompileCodegenUnit<'tcx>() -> DepKindVTable<'tcx> { pub(crate) fn CompileMonoItem<'tcx>() -> DepKindVTable<'tcx> { DepKindVTable { - is_anon: false, is_eval_always: false, key_fingerprint_style: KeyFingerprintStyle::Opaque, force_from_dep_node_fn: None, @@ -91,7 +84,6 @@ pub(crate) fn CompileMonoItem<'tcx>() -> DepKindVTable<'tcx> { pub(crate) fn Metadata<'tcx>() -> DepKindVTable<'tcx> { DepKindVTable { - is_anon: false, is_eval_always: false, key_fingerprint_style: KeyFingerprintStyle::Unit, force_from_dep_node_fn: None, @@ -124,7 +116,6 @@ pub(crate) fn make_dep_kind_vtable_for_query<'tcx, Q>( } DepKindVTable { - is_anon, is_eval_always, key_fingerprint_style, force_from_dep_node_fn: can_recover.then_some(force_from_dep_node_inner::),