diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs index 8f8a566d533..1d17f422196 100644 --- a/compiler/rustc_query_impl/src/plumbing.rs +++ b/compiler/rustc_query_impl/src/plumbing.rs @@ -298,7 +298,7 @@ pub(crate) fn create_query_frame< K: Copy + Key + for<'a> HashStable>, >( tcx: QueryCtxt<'tcx>, - do_describe: fn(QueryCtxt<'tcx>, K) -> String, + do_describe: fn(TyCtxt<'tcx>, K) -> String, key: K, kind: DepKind, name: &'static str, @@ -307,7 +307,7 @@ pub(crate) fn create_query_frame< // Showing visible path instead of any path is not that important in production. let description = ty::print::with_no_visible_paths!( // Force filename-line mode to avoid invoking `type_of` query. - ty::print::with_forced_impl_filename_line!(do_describe(tcx, key)) + ty::print::with_forced_impl_filename_line!(do_describe(tcx.tcx, key)) ); let description = if tcx.sess.verbose() { format!("{} [{}]", description, name) } else { description }; @@ -466,10 +466,6 @@ mod queries { } impl<'tcx> QueryDescription> for queries::$name<'tcx> { - fn describe(tcx: QueryCtxt<'tcx>, key: Self::Key) -> String { - ::rustc_middle::query::descs::$name(tcx.tcx, key) - } - #[inline] fn cache_on_disk(tcx: TyCtxt<'tcx>, key: &Self::Key) -> bool { ::rustc_middle::query::cached::$name(tcx, key) @@ -583,7 +579,7 @@ mod query_structs { use rustc_middle::ty::TyCtxt; use $crate::plumbing::{QueryStruct, QueryCtxt}; use $crate::profiling_support::QueryKeyStringCache; - use rustc_query_system::query::{QueryDescription, QueryMap}; + use rustc_query_system::query::QueryMap; pub(super) const fn dummy_query_struct<'tcx>() -> QueryStruct<'tcx> { fn noop_try_collect_active_jobs(_: QueryCtxt<'_>, _: &mut QueryMap) -> Option<()> { @@ -610,7 +606,7 @@ pub(super) const fn $name<'tcx>() -> QueryStruct<'tcx> { QueryStruct { let make_query = |tcx, key| { let kind = rustc_middle::dep_graph::DepKind::$name; let name = stringify!($name); - $crate::plumbing::create_query_frame(tcx, super::queries::$name::describe, key, kind, name) + $crate::plumbing::create_query_frame(tcx, rustc_middle::query::descs::$name, key, kind, name) }; tcx.queries.$name.try_collect_active_jobs( tcx, diff --git a/compiler/rustc_query_system/src/query/config.rs b/compiler/rustc_query_system/src/query/config.rs index c4549cc9eb4..0a1cffa3b33 100644 --- a/compiler/rustc_query_system/src/query/config.rs +++ b/compiler/rustc_query_system/src/query/config.rs @@ -49,8 +49,6 @@ pub(crate) fn compute(&self, tcx: CTX::DepContext, key: K) -> V { pub trait QueryDescription: QueryConfig { type Cache: QueryCache; - fn describe(tcx: CTX, key: Self::Key) -> String; - // Don't use this method to access query results, instead use the methods on TyCtxt fn query_state<'a>(tcx: CTX) -> &'a QueryState where