diff --git a/compiler/rustc_query_impl/src/lib.rs b/compiler/rustc_query_impl/src/lib.rs index 1b93ffe945b3..f1a4f3cad25a 100644 --- a/compiler/rustc_query_impl/src/lib.rs +++ b/compiler/rustc_query_impl/src/lib.rs @@ -19,7 +19,7 @@ pub use crate::dep_kind_vtables::make_dep_kind_vtables; pub use crate::job::{QueryJobMap, break_query_cycles, print_query_stack}; -pub use crate::plumbing::{collect_active_jobs_from_all_queries, query_key_hash_verify_all}; +pub use crate::plumbing::collect_active_jobs_from_all_queries; use crate::plumbing::{encode_all_query_results, try_mark_green}; use crate::profiling_support::QueryKeyStringCache; pub use crate::profiling_support::alloc_self_profile_query_strings; diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs index 8920f8dba38d..7a69453e2aee 100644 --- a/compiler/rustc_query_impl/src/plumbing.rs +++ b/compiler/rustc_query_impl/src/plumbing.rs @@ -134,16 +134,6 @@ pub(super) fn encode_all_query_results<'tcx>( } } -pub fn query_key_hash_verify_all<'tcx>(tcx: TyCtxt<'tcx>) { - if tcx.sess.opts.unstable_opts.incremental_verify_ich || cfg!(debug_assertions) { - tcx.sess.time("query_key_hash_verify_all", || { - for verify in super::QUERY_KEY_HASH_VERIFY.iter() { - verify(tcx); - } - }) - } -} - macro_rules! cycle_error_handling { ([]) => {{ rustc_middle::query::CycleErrorHandling::Error @@ -689,13 +679,6 @@ pub(crate) fn encode_query_results<'tcx>( ) } } - - pub(crate) fn query_key_hash_verify<'tcx>(tcx: TyCtxt<'tcx>) { - $crate::plumbing::query_key_hash_verify( - &tcx.query_system.query_vtables.$name, - tcx, - ) - } })*} pub fn make_query_vtables<'tcx>(incremental: bool) -> queries::QueryVTables<'tcx> { @@ -744,9 +727,18 @@ pub fn make_query_vtables<'tcx>(incremental: bool) -> queries::QueryVTables<'tcx ),* ]; - const QUERY_KEY_HASH_VERIFY: &[ - for<'tcx> fn(TyCtxt<'tcx>) - ] = &[$(query_impl::$name::query_key_hash_verify),*]; + pub fn query_key_hash_verify_all<'tcx>(tcx: TyCtxt<'tcx>) { + if tcx.sess.opts.unstable_opts.incremental_verify_ich || cfg!(debug_assertions) { + tcx.sess.time("query_key_hash_verify_all", || { + $( + $crate::plumbing::query_key_hash_verify( + &tcx.query_system.query_vtables.$name, + tcx + ); + )* + }) + } + } /// Declares a dep-kind vtable constructor for each query. mod _dep_kind_vtable_ctors_for_queries {