Skip to content

Commit 8f0ca1d

Browse files
committed
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.
1 parent 25396cf commit 8f0ca1d

2 files changed

Lines changed: 13 additions & 21 deletions

File tree

compiler/rustc_query_impl/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use rustc_span::Span;
1919

2020
pub use crate::dep_kind_vtables::make_dep_kind_vtables;
2121
pub use crate::job::{QueryJobMap, break_query_cycles, print_query_stack};
22-
pub use crate::plumbing::{collect_active_jobs_from_all_queries, query_key_hash_verify_all};
22+
pub use crate::plumbing::collect_active_jobs_from_all_queries;
2323
use crate::plumbing::{encode_all_query_results, try_mark_green};
2424
use crate::profiling_support::QueryKeyStringCache;
2525
pub use crate::profiling_support::alloc_self_profile_query_strings;

compiler/rustc_query_impl/src/plumbing.rs

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,6 @@ pub(super) fn encode_all_query_results<'tcx>(
134134
}
135135
}
136136

137-
pub fn query_key_hash_verify_all<'tcx>(tcx: TyCtxt<'tcx>) {
138-
if tcx.sess.opts.unstable_opts.incremental_verify_ich || cfg!(debug_assertions) {
139-
tcx.sess.time("query_key_hash_verify_all", || {
140-
for verify in super::QUERY_KEY_HASH_VERIFY.iter() {
141-
verify(tcx);
142-
}
143-
})
144-
}
145-
}
146-
147137
macro_rules! cycle_error_handling {
148138
([]) => {{
149139
rustc_middle::query::CycleErrorHandling::Error
@@ -689,13 +679,6 @@ macro_rules! define_queries {
689679
)
690680
}
691681
}
692-
693-
pub(crate) fn query_key_hash_verify<'tcx>(tcx: TyCtxt<'tcx>) {
694-
$crate::plumbing::query_key_hash_verify(
695-
&tcx.query_system.query_vtables.$name,
696-
tcx,
697-
)
698-
}
699682
})*}
700683

701684
pub fn make_query_vtables<'tcx>(incremental: bool) -> queries::QueryVTables<'tcx> {
@@ -744,9 +727,18 @@ macro_rules! define_queries {
744727
),*
745728
];
746729

747-
const QUERY_KEY_HASH_VERIFY: &[
748-
for<'tcx> fn(TyCtxt<'tcx>)
749-
] = &[$(query_impl::$name::query_key_hash_verify),*];
730+
pub fn query_key_hash_verify_all<'tcx>(tcx: TyCtxt<'tcx>) {
731+
if tcx.sess.opts.unstable_opts.incremental_verify_ich || cfg!(debug_assertions) {
732+
tcx.sess.time("query_key_hash_verify_all", || {
733+
$(
734+
$crate::plumbing::query_key_hash_verify(
735+
&tcx.query_system.query_vtables.$name,
736+
tcx
737+
);
738+
)*
739+
})
740+
}
741+
}
750742

751743
/// Declares a dep-kind vtable constructor for each query.
752744
mod _dep_kind_vtable_ctors_for_queries {

0 commit comments

Comments
 (0)