Remove QUERY_KEY_HASH_VERIFY.

And also `query_key_hash_verify` for each query. This is done by
generating `query_key_hash_verify_all` and having it do things more
directly.
This commit is contained in:
Nicholas Nethercote
2026-02-26 06:16:28 +11:00
parent 25396cf549
commit 8f0ca1d253
2 changed files with 13 additions and 21 deletions
+1 -1
View File
@@ -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;
+12 -20
View File
@@ -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 {