From b41b0c494c35b314cd8f6e9d0a84976e68415db2 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 12 Mar 2026 17:39:01 +1100 Subject: [PATCH 1/3] Rename all-query functions. There are four functions that use `for_each_query_vtable!` to call an "inner" function. They are: - collect_active_jobs_from_all_queries -> gather_active_jobs - alloc_self_profile_query_strings -> alloc_self_profile_query_strings_for_query_cache - encode_all_query_results -> encode_query_results - query_key_hash_verify_all -> query_key_hash_verify These names are all over the place. This commit renames them as follows: - collect_active_query_jobs{,_inner} - alloc_self_profile_query_strings{,_inner} - encode_query_values{,_inner} - verify_query_key_hashes{,_inner} This: - puts the verb at the start - uses "inner" for all the inners (which makes sense now that the inners are all next to their callers) - uses `_query_` consistently - avoids `all`, because the plurals are enough - uses `values` instead of `results` - removes the `collect`/`gather` distinction, which is no longer important --- compiler/rustc_interface/src/util.rs | 4 ++-- compiler/rustc_middle/src/hooks/mod.rs | 4 ++-- .../rustc_middle/src/query/on_disk_cache.rs | 4 ++-- compiler/rustc_middle/src/ty/context.rs | 2 +- compiler/rustc_query_impl/src/execution.rs | 23 +++++++------------ compiler/rustc_query_impl/src/job.rs | 8 +++---- compiler/rustc_query_impl/src/lib.rs | 6 ++--- compiler/rustc_query_impl/src/plumbing.rs | 18 +++++++-------- .../rustc_query_impl/src/profiling_support.rs | 4 ++-- 9 files changed, 33 insertions(+), 40 deletions(-) diff --git a/compiler/rustc_interface/src/util.rs b/compiler/rustc_interface/src/util.rs index e81f0133e3b6b..c5344ee66cd03 100644 --- a/compiler/rustc_interface/src/util.rs +++ b/compiler/rustc_interface/src/util.rs @@ -18,7 +18,7 @@ use rustc_data_structures::sync; use rustc_metadata::{DylibError, EncodedMetadata, load_symbol_from_dylib}; use rustc_middle::dep_graph::{WorkProduct, WorkProductId}; use rustc_middle::ty::{CurrentGcx, TyCtxt}; -use rustc_query_impl::{CollectActiveJobsKind, collect_active_jobs_from_all_queries}; +use rustc_query_impl::{CollectActiveJobsKind, collect_active_query_jobs}; use rustc_session::config::{ Cfg, CrateType, OutFileName, OutputFilenames, OutputTypes, Sysroot, host_tuple, }; @@ -255,7 +255,7 @@ internal compiler error: query cycle handler thread panicked, aborting process"; // Ensure there were no errors collecting all active jobs. // We need the complete map to ensure we find a cycle to // break. - collect_active_jobs_from_all_queries( + collect_active_query_jobs( tcx, CollectActiveJobsKind::FullNoContention, ) diff --git a/compiler/rustc_middle/src/hooks/mod.rs b/compiler/rustc_middle/src/hooks/mod.rs index 2ab03adf6aaf6..60327be6f6f81 100644 --- a/compiler/rustc_middle/src/hooks/mod.rs +++ b/compiler/rustc_middle/src/hooks/mod.rs @@ -98,7 +98,7 @@ declare_hooks! { /// Trying to execute a query afterwards would attempt to read the result cache we just dropped. hook save_dep_graph() -> (); - hook query_key_hash_verify_all() -> (); + hook verify_query_key_hashes() -> (); /// Ensure the given scalar is valid for the given type. /// This checks non-recursive runtime validity. @@ -109,7 +109,7 @@ declare_hooks! { /// Creates the MIR for a given `DefId`, including unreachable code. hook build_mir_inner_impl(def: LocalDefId) -> mir::Body<'tcx>; - hook encode_all_query_results( + hook encode_query_values( encoder: &mut CacheEncoder<'_, 'tcx>, query_result_index: &mut EncodedDepNodeIndex ) -> (); diff --git a/compiler/rustc_middle/src/query/on_disk_cache.rs b/compiler/rustc_middle/src/query/on_disk_cache.rs index 8f4e4564c5830..607891d4d19d9 100644 --- a/compiler/rustc_middle/src/query/on_disk_cache.rs +++ b/compiler/rustc_middle/src/query/on_disk_cache.rs @@ -246,10 +246,10 @@ impl OnDiskCache { // Encode query results. let mut query_result_index = EncodedDepNodeIndex::new(); - tcx.sess.time("encode_query_results", || { + tcx.sess.time("encode_query_values", || { let enc = &mut encoder; let qri = &mut query_result_index; - tcx.encode_all_query_results(enc, qri); + tcx.encode_query_values(enc, qri); }); // Encode side effects. diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 91105f416c8f8..04dbca23b412c 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -1678,7 +1678,7 @@ impl<'tcx> TyCtxt<'tcx> { self.alloc_self_profile_query_strings(); self.save_dep_graph(); - self.query_key_hash_verify_all(); + self.verify_query_key_hashes(); if let Err((path, error)) = self.dep_graph.finish_encoding() { self.sess.dcx().emit_fatal(crate::error::FailedWritingFile { path: &path, error }); diff --git a/compiler/rustc_query_impl/src/execution.rs b/compiler/rustc_query_impl/src/execution.rs index eae91a2b2e566..96d6ca51ec99c 100644 --- a/compiler/rustc_query_impl/src/execution.rs +++ b/compiler/rustc_query_impl/src/execution.rs @@ -56,14 +56,14 @@ pub enum CollectActiveJobsKind { /// Prefer passing `false` to `require_complete` to avoid potential deadlocks, /// especially when called from within a deadlock handler, unless a /// complete map is needed and no deadlock is possible at this call site. -pub fn collect_active_jobs_from_all_queries<'tcx>( +pub fn collect_active_query_jobs<'tcx>( tcx: TyCtxt<'tcx>, collect_kind: CollectActiveJobsKind, ) -> QueryJobMap<'tcx> { let mut job_map = QueryJobMap::default(); for_each_query_vtable!(ALL, tcx, |query| { - gather_active_jobs(query, collect_kind, &mut job_map); + collect_active_query_jobs_inner(query, collect_kind, &mut job_map); }); job_map @@ -71,14 +71,8 @@ pub fn collect_active_jobs_from_all_queries<'tcx>( /// Internal plumbing for collecting the set of active jobs for this query. /// -/// Should only be called from `collect_active_jobs_from_all_queries`. -/// -/// (We arbitrarily use the word "gather" when collecting the jobs for -/// each individual query, so that we have distinct function names to -/// grep for.) -/// /// Aborts if jobs can't be gathered as specified by `collect_kind`. -fn gather_active_jobs<'tcx, C>( +fn collect_active_query_jobs_inner<'tcx, C>( query: &'tcx QueryVTable<'tcx, C>, collect_kind: CollectActiveJobsKind, job_map: &mut QueryJobMap<'tcx>, @@ -86,7 +80,7 @@ fn gather_active_jobs<'tcx, C>( C: QueryCache, QueryVTable<'tcx, C>: DynSync, { - let mut gather_shard_jobs = |shard: &HashTable<(C::Key, ActiveKeyStatus<'tcx>)>| { + let mut collect_shard_jobs = |shard: &HashTable<(C::Key, ActiveKeyStatus<'tcx>)>| { for (key, status) in shard.iter() { if let ActiveKeyStatus::Started(job) = status { // This function is safe to call with the shard locked because it is very simple. @@ -99,13 +93,13 @@ fn gather_active_jobs<'tcx, C>( match collect_kind { CollectActiveJobsKind::Full => { for shard in query.state.active.lock_shards() { - gather_shard_jobs(&shard); + collect_shard_jobs(&shard); } } CollectActiveJobsKind::FullNoContention => { for shard in query.state.active.try_lock_shards() { match shard { - Some(shard) => gather_shard_jobs(&shard), + Some(shard) => collect_shard_jobs(&shard), None => panic!("Failed to collect active jobs for query `{}`!", query.name), } } @@ -113,7 +107,7 @@ fn gather_active_jobs<'tcx, C>( CollectActiveJobsKind::PartialAllowed => { for shard in query.state.active.try_lock_shards() { match shard { - Some(shard) => gather_shard_jobs(&shard), + Some(shard) => collect_shard_jobs(&shard), None => warn!("Failed to collect active jobs for query `{}`!", query.name), } } @@ -218,8 +212,7 @@ fn cycle_error<'tcx, C: QueryCache>( ) -> (C::Value, Option) { // Ensure there were no errors collecting all active jobs. // We need the complete map to ensure we find a cycle to break. - let job_map = - collect_active_jobs_from_all_queries(tcx, CollectActiveJobsKind::FullNoContention); + let job_map = collect_active_query_jobs(tcx, CollectActiveJobsKind::FullNoContention); let error = find_cycle_in_stack(try_execute, job_map, ¤t_query_job(), span); (mk_cycle(query, tcx, key, error), None) diff --git a/compiler/rustc_query_impl/src/job.rs b/compiler/rustc_query_impl/src/job.rs index 90fb1c26910ad..4d3dbe6621cf3 100644 --- a/compiler/rustc_query_impl/src/job.rs +++ b/compiler/rustc_query_impl/src/job.rs @@ -12,10 +12,10 @@ use rustc_middle::query::{ use rustc_middle::ty::TyCtxt; use rustc_span::{DUMMY_SP, Span}; -use crate::{CollectActiveJobsKind, collect_active_jobs_from_all_queries}; +use crate::{CollectActiveJobsKind, collect_active_query_jobs}; /// Map from query job IDs to job information collected by -/// `collect_active_jobs_from_all_queries`. +/// `collect_active_query_jobs`. #[derive(Debug, Default)] pub struct QueryJobMap<'tcx> { map: FxHashMap>, @@ -24,7 +24,7 @@ pub struct QueryJobMap<'tcx> { impl<'tcx> QueryJobMap<'tcx> { /// Adds information about a job ID to the job map. /// - /// Should only be called by `gather_active_jobs`. + /// Should only be called by `collect_active_query_jobs_inner`. pub(crate) fn insert(&mut self, id: QueryJobId, info: QueryJobInfo<'tcx>) { self.map.insert(id, info); } @@ -407,7 +407,7 @@ pub fn print_query_stack<'tcx>( let mut count_total = 0; // Make use of a partial query job map if we fail to take locks collecting active queries. - let job_map = collect_active_jobs_from_all_queries(tcx, CollectActiveJobsKind::PartialAllowed); + let job_map = collect_active_query_jobs(tcx, CollectActiveJobsKind::PartialAllowed); if let Some(ref mut file) = file { let _ = writeln!(file, "\n\nquery stack during panic:"); diff --git a/compiler/rustc_query_impl/src/lib.rs b/compiler/rustc_query_impl/src/lib.rs index c62ea3e289fcb..cd16071f34fa2 100644 --- a/compiler/rustc_query_impl/src/lib.rs +++ b/compiler/rustc_query_impl/src/lib.rs @@ -17,7 +17,7 @@ use rustc_middle::query::plumbing::{QuerySystem, QueryVTable}; use rustc_middle::ty::TyCtxt; pub use crate::dep_kind_vtables::make_dep_kind_vtables; -pub use crate::execution::{CollectActiveJobsKind, collect_active_jobs_from_all_queries}; +pub use crate::execution::{CollectActiveJobsKind, collect_active_query_jobs}; pub use crate::job::{QueryJobMap, break_query_cycles, print_query_stack}; mod dep_kind_vtables; @@ -64,6 +64,6 @@ pub fn query_system<'tcx>( pub fn provide(providers: &mut rustc_middle::util::Providers) { providers.hooks.alloc_self_profile_query_strings = profiling_support::alloc_self_profile_query_strings; - providers.hooks.query_key_hash_verify_all = plumbing::query_key_hash_verify_all; - providers.hooks.encode_all_query_results = plumbing::encode_all_query_results; + providers.hooks.verify_query_key_hashes = plumbing::verify_query_key_hashes; + providers.hooks.encode_query_values = plumbing::encode_query_values; } diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs index c9cd08648b1b1..f7abffb29f828 100644 --- a/compiler/rustc_query_impl/src/plumbing.rs +++ b/compiler/rustc_query_impl/src/plumbing.rs @@ -26,10 +26,10 @@ use crate::error::{QueryOverflow, QueryOverflowNote}; use crate::execution::{all_inactive, force_query}; use crate::job::find_dep_kind_root; use crate::query_impl::for_each_query_vtable; -use crate::{CollectActiveJobsKind, GetQueryVTable, collect_active_jobs_from_all_queries}; +use crate::{CollectActiveJobsKind, GetQueryVTable, collect_active_query_jobs}; fn depth_limit_error<'tcx>(tcx: TyCtxt<'tcx>, job: QueryJobId) { - let job_map = collect_active_jobs_from_all_queries(tcx, CollectActiveJobsKind::Full); + let job_map = collect_active_query_jobs(tcx, CollectActiveJobsKind::Full); let (span, desc, depth) = find_dep_kind_root(tcx, job, job_map); let suggested_limit = match tcx.recursion_limit() { @@ -99,17 +99,17 @@ where } } -pub(crate) fn encode_all_query_results<'tcx>( +pub(crate) fn encode_query_values<'tcx>( tcx: TyCtxt<'tcx>, encoder: &mut CacheEncoder<'_, 'tcx>, query_result_index: &mut EncodedDepNodeIndex, ) { for_each_query_vtable!(CACHE_ON_DISK, tcx, |query| { - encode_query_results(tcx, query, encoder, query_result_index) + encode_query_values_inner(tcx, query, encoder, query_result_index) }); } -fn encode_query_results<'a, 'tcx, C, V>( +fn encode_query_values_inner<'a, 'tcx, C, V>( tcx: TyCtxt<'tcx>, query: &'tcx QueryVTable<'tcx, C>, encoder: &mut CacheEncoder<'a, 'tcx>, @@ -135,17 +135,17 @@ fn encode_query_results<'a, 'tcx, C, V>( }); } -pub(crate) fn query_key_hash_verify_all<'tcx>(tcx: TyCtxt<'tcx>) { +pub(crate) fn verify_query_key_hashes<'tcx>(tcx: TyCtxt<'tcx>) { if tcx.sess.opts.unstable_opts.incremental_verify_ich || cfg!(debug_assertions) { - tcx.sess.time("query_key_hash_verify_all", || { + tcx.sess.time("verify_query_key_hashes", || { for_each_query_vtable!(ALL, tcx, |query| { - query_key_hash_verify(query, tcx); + verify_query_key_hashes_inner(query, tcx); }); }); } } -fn query_key_hash_verify<'tcx, C: QueryCache>( +fn verify_query_key_hashes_inner<'tcx, C: QueryCache>( query: &'tcx QueryVTable<'tcx, C>, tcx: TyCtxt<'tcx>, ) { diff --git a/compiler/rustc_query_impl/src/profiling_support.rs b/compiler/rustc_query_impl/src/profiling_support.rs index c34938cdb3866..582150a7bafa9 100644 --- a/compiler/rustc_query_impl/src/profiling_support.rs +++ b/compiler/rustc_query_impl/src/profiling_support.rs @@ -192,7 +192,7 @@ pub(crate) fn alloc_self_profile_query_strings(tcx: TyCtxt<'_>) { let mut string_cache = QueryKeyStringCache::new(); for_each_query_vtable!(ALL, tcx, |query| { - alloc_self_profile_query_strings_for_query_cache(tcx, query, &mut string_cache); + alloc_self_profile_query_strings_inner(tcx, query, &mut string_cache); }); tcx.sess.prof.store_query_cache_hits(); @@ -201,7 +201,7 @@ pub(crate) fn alloc_self_profile_query_strings(tcx: TyCtxt<'_>) { /// Allocate the self-profiling query strings for a single query cache. This /// method is called from `alloc_self_profile_query_strings` which knows all /// the queries via macro magic. -fn alloc_self_profile_query_strings_for_query_cache<'tcx, C>( +fn alloc_self_profile_query_strings_inner<'tcx, C>( tcx: TyCtxt<'tcx>, query: &'tcx QueryVTable<'tcx, C>, string_cache: &mut QueryKeyStringCache, From a8024fc1d783fbbf8c098b23d3f66b8cfa74c9f7 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 16 Mar 2026 16:33:52 +1100 Subject: [PATCH 2/3] Remove an out-of-date comment. It should have been removed in #153650. (The comments on `CollectActiveJobsKind` suffice now.) --- compiler/rustc_query_impl/src/execution.rs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/compiler/rustc_query_impl/src/execution.rs b/compiler/rustc_query_impl/src/execution.rs index 96d6ca51ec99c..dc7a847003b03 100644 --- a/compiler/rustc_query_impl/src/execution.rs +++ b/compiler/rustc_query_impl/src/execution.rs @@ -47,15 +47,6 @@ pub enum CollectActiveJobsKind { } /// Returns a map of currently active query jobs, collected from all queries. -/// -/// If `require_complete` is `true`, this function locks all shards of the -/// query results to produce a complete map, which always returns `Ok`. -/// Otherwise, it may return an incomplete map as an error if any shard -/// lock cannot be acquired. -/// -/// Prefer passing `false` to `require_complete` to avoid potential deadlocks, -/// especially when called from within a deadlock handler, unless a -/// complete map is needed and no deadlock is possible at this call site. pub fn collect_active_query_jobs<'tcx>( tcx: TyCtxt<'tcx>, collect_kind: CollectActiveJobsKind, From aa223a022022aa050dd8e424cd241c8bb7648c0f Mon Sep 17 00:00:00 2001 From: Zalathar Date: Sat, 14 Mar 2026 16:19:30 +1100 Subject: [PATCH 3/3] Re-export `rustc_middle::query::{QuerySystem, QueryVTable}` All of the other public items in `rustc_middle::query::plumbing` are re-exported from `query`, except for these two, for no particular reason that I can see. Re-exporting them allows `rustc_middle::query::plumbing` to have its visibility reduced to pub(crate). Imports within `rustc_middle` have also been updated to consistently use the re-exports in `crate::query`. --- compiler/rustc_middle/src/query/inner.rs | 3 +-- compiler/rustc_middle/src/query/job.rs | 2 +- compiler/rustc_middle/src/query/mod.rs | 6 +++--- compiler/rustc_middle/src/query/plumbing.rs | 2 +- compiler/rustc_middle/src/ty/context.rs | 3 +-- compiler/rustc_query_impl/src/execution.rs | 3 +-- compiler/rustc_query_impl/src/lib.rs | 3 +-- compiler/rustc_query_impl/src/plumbing.rs | 5 +++-- compiler/rustc_query_impl/src/profiling_support.rs | 3 +-- compiler/rustc_query_impl/src/query_impl.rs | 7 +++---- 10 files changed, 16 insertions(+), 21 deletions(-) diff --git a/compiler/rustc_middle/src/query/inner.rs b/compiler/rustc_middle/src/query/inner.rs index 7395c5476dc1e..c2525d26d4c67 100644 --- a/compiler/rustc_middle/src/query/inner.rs +++ b/compiler/rustc_middle/src/query/inner.rs @@ -6,8 +6,7 @@ use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span}; use crate::dep_graph; use crate::dep_graph::DepNodeKey; use crate::query::erase::{self, Erasable, Erased}; -use crate::query::plumbing::QueryVTable; -use crate::query::{EnsureMode, QueryCache, QueryMode}; +use crate::query::{EnsureMode, QueryCache, QueryMode, QueryVTable}; use crate::ty::TyCtxt; /// Checks whether there is already a value for this key in the in-memory diff --git a/compiler/rustc_middle/src/query/job.rs b/compiler/rustc_middle/src/query/job.rs index 574a671fd640f..3bf37a782ee8a 100644 --- a/compiler/rustc_middle/src/query/job.rs +++ b/compiler/rustc_middle/src/query/job.rs @@ -6,7 +6,7 @@ use std::sync::Arc; use parking_lot::{Condvar, Mutex}; use rustc_span::Span; -use crate::query::plumbing::CycleError; +use crate::query::CycleError; use crate::ty::TyCtxt; /// A value uniquely identifying an active query job. diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index 517999baba1ec..1723a853ea750 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -4,8 +4,8 @@ pub use self::caches::{DefIdCache, DefaultCache, QueryCache, SingleCache, VecCac pub use self::job::{QueryJob, QueryJobId, QueryLatch, QueryWaiter}; pub use self::keys::{AsLocalQueryKey, LocalCrate, QueryKey}; pub use self::plumbing::{ - ActiveKeyStatus, CycleError, EnsureMode, IntoQueryParam, QueryMode, QueryState, TyCtxtAt, - TyCtxtEnsureDone, TyCtxtEnsureOk, TyCtxtEnsureResult, + ActiveKeyStatus, CycleError, EnsureMode, IntoQueryParam, QueryMode, QueryState, QuerySystem, + QueryVTable, TyCtxtAt, TyCtxtEnsureDone, TyCtxtEnsureOk, TyCtxtEnsureResult, }; pub use self::stack::QueryStackFrame; pub use crate::queries::Providers; @@ -19,7 +19,7 @@ mod job; mod keys; pub(crate) mod modifiers; pub mod on_disk_cache; -pub mod plumbing; +pub(crate) mod plumbing; mod stack; pub fn describe_as_module(def_id: impl Into, tcx: TyCtxt<'_>) -> String { diff --git a/compiler/rustc_middle/src/query/plumbing.rs b/compiler/rustc_middle/src/query/plumbing.rs index 6f18c01577da2..e88c20f02537b 100644 --- a/compiler/rustc_middle/src/query/plumbing.rs +++ b/compiler/rustc_middle/src/query/plumbing.rs @@ -569,7 +569,7 @@ macro_rules! define_callbacks { /// Holds a `QueryVTable` for each query. pub struct QueryVTables<'tcx> { $( - pub $name: ::rustc_middle::query::plumbing::QueryVTable<'tcx, $name::Cache<'tcx>>, + pub $name: crate::query::QueryVTable<'tcx, $name::Cache<'tcx>>, )* } diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 91105f416c8f8..074ce6c246a64 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -61,8 +61,7 @@ use crate::middle::codegen_fn_attrs::{CodegenFnAttrs, TargetFeature}; use crate::middle::resolve_bound_vars; use crate::mir::interpret::{self, Allocation, ConstAllocation}; use crate::mir::{Body, Local, Place, PlaceElem, ProjectionKind, Promoted}; -use crate::query::plumbing::QuerySystem; -use crate::query::{IntoQueryParam, LocalCrate, Providers, TyCtxtAt}; +use crate::query::{IntoQueryParam, LocalCrate, Providers, QuerySystem, TyCtxtAt}; use crate::thir::Thir; use crate::traits; use crate::traits::solve::{ExternalConstraints, ExternalConstraintsData, PredefinedOpaques}; diff --git a/compiler/rustc_query_impl/src/execution.rs b/compiler/rustc_query_impl/src/execution.rs index eae91a2b2e566..10c47fd73de11 100644 --- a/compiler/rustc_query_impl/src/execution.rs +++ b/compiler/rustc_query_impl/src/execution.rs @@ -7,10 +7,9 @@ use rustc_data_structures::sync::{DynSend, DynSync}; use rustc_data_structures::{outline, sharded, sync}; use rustc_errors::FatalError; use rustc_middle::dep_graph::{DepGraphData, DepNodeKey, SerializedDepNodeIndex}; -use rustc_middle::query::plumbing::QueryVTable; use rustc_middle::query::{ ActiveKeyStatus, CycleError, EnsureMode, QueryCache, QueryJob, QueryJobId, QueryKey, - QueryLatch, QueryMode, QueryState, + QueryLatch, QueryMode, QueryState, QueryVTable, }; use rustc_middle::ty::TyCtxt; use rustc_middle::verify_ich::incremental_verify_ich; diff --git a/compiler/rustc_query_impl/src/lib.rs b/compiler/rustc_query_impl/src/lib.rs index c62ea3e289fcb..27b0a253145f4 100644 --- a/compiler/rustc_query_impl/src/lib.rs +++ b/compiler/rustc_query_impl/src/lib.rs @@ -11,9 +11,8 @@ use rustc_data_structures::sync::AtomicU64; use rustc_middle::dep_graph; use rustc_middle::queries::{ExternProviders, Providers}; -use rustc_middle::query::QueryCache; use rustc_middle::query::on_disk_cache::OnDiskCache; -use rustc_middle::query::plumbing::{QuerySystem, QueryVTable}; +use rustc_middle::query::{QueryCache, QuerySystem, QueryVTable}; use rustc_middle::ty::TyCtxt; pub use crate::dep_kind_vtables::make_dep_kind_vtables; diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs index c9cd08648b1b1..21910068a1385 100644 --- a/compiler/rustc_query_impl/src/plumbing.rs +++ b/compiler/rustc_query_impl/src/plumbing.rs @@ -13,8 +13,9 @@ use rustc_middle::query::erase::{Erasable, Erased}; use rustc_middle::query::on_disk_cache::{ AbsoluteBytePos, CacheDecoder, CacheEncoder, EncodedDepNodeIndex, }; -use rustc_middle::query::plumbing::QueryVTable; -use rustc_middle::query::{QueryCache, QueryJobId, QueryKey, QueryMode, QueryStackFrame, erase}; +use rustc_middle::query::{ + QueryCache, QueryJobId, QueryKey, QueryMode, QueryStackFrame, QueryVTable, erase, +}; use rustc_middle::ty::TyCtxt; use rustc_middle::ty::codec::TyEncoder; use rustc_middle::ty::tls::{self, ImplicitCtxt}; diff --git a/compiler/rustc_query_impl/src/profiling_support.rs b/compiler/rustc_query_impl/src/profiling_support.rs index c34938cdb3866..53577e0a9bd1d 100644 --- a/compiler/rustc_query_impl/src/profiling_support.rs +++ b/compiler/rustc_query_impl/src/profiling_support.rs @@ -6,8 +6,7 @@ use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::profiling::SelfProfiler; use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LOCAL_CRATE, LocalDefId}; use rustc_hir::definitions::DefPathData; -use rustc_middle::query::QueryCache; -use rustc_middle::query::plumbing::QueryVTable; +use rustc_middle::query::{QueryCache, QueryVTable}; use rustc_middle::ty::TyCtxt; use crate::query_impl::for_each_query_vtable; diff --git a/compiler/rustc_query_impl/src/query_impl.rs b/compiler/rustc_query_impl/src/query_impl.rs index 23f678e1c9f73..caf4c7dde7e67 100644 --- a/compiler/rustc_query_impl/src/query_impl.rs +++ b/compiler/rustc_query_impl/src/query_impl.rs @@ -1,7 +1,6 @@ use rustc_middle::queries::TaggedQueryKey; use rustc_middle::query::erase::{self, Erased}; -use rustc_middle::query::plumbing::QueryVTable; -use rustc_middle::query::{AsLocalQueryKey, QueryMode}; +use rustc_middle::query::{AsLocalQueryKey, QueryMode, QueryVTable}; use rustc_middle::ty::TyCtxt; use rustc_span::Span; @@ -245,7 +244,7 @@ macro_rules! define_queries { (ALL, $tcx:expr, $closure:expr) => {{ let tcx: rustc_middle::ty::TyCtxt<'_> = $tcx; $( - let query: &rustc_middle::query::plumbing::QueryVTable<'_, _> = + let query: &rustc_middle::query::QueryVTable<'_, _> = &tcx.query_system.query_vtables.$name; $closure(query); )* @@ -260,7 +259,7 @@ macro_rules! define_queries { $( #[cfg($cache_on_disk)] { - let query: &rustc_middle::query::plumbing::QueryVTable<'_, _> = + let query: &rustc_middle::query::QueryVTable<'_, _> = &tcx.query_system.query_vtables.$name; $closure(query); }