$(pub type $name<$tcx> = <query_storage::$name<$tcx> as QueryStorage>::Stored;)*
}
+ #[derive(Default)]
+ pub struct QueryCaches<$tcx> {
+ $($(#[$attr])* $name: QueryCacheStore<query_storage::$name<$tcx>>,)*
+ }
+
$(impl<$tcx> QueryConfig for queries::$name<$tcx> {
type Key = $($K)*;
type Value = $V;
type Cache = query_storage::$name<$tcx>;
#[inline(always)]
- fn query_state<'a>(tcx: TyCtxt<$tcx>) -> &'a QueryState<crate::dep_graph::DepKind, <TyCtxt<$tcx> as QueryContext>::Query, Self::Cache> {
+ fn query_state<'a>(tcx: TyCtxt<$tcx>) -> &'a QueryState<crate::dep_graph::DepKind, Query<$tcx>, Self::Key> {
&tcx.queries.$name
}
+ #[inline(always)]
+ fn query_cache<'a>(tcx: TyCtxt<$tcx>) -> &'a QueryCacheStore<Self::Cache>
+ where 'tcx:'a
+ {
+ &tcx.query_caches.$name
+ }
+
#[inline]
fn compute(tcx: TyCtxt<'tcx>, key: Self::Key) -> Self::Value {
let provider = tcx.queries.providers.get(key.query_crate())
alloc_self_profile_query_strings_for_query_cache(
self,
stringify!($name),
- &self.queries.$name,
+ &self.query_caches.$name,
&mut string_cache,
);
})*
$($(#[$attr])* $name: QueryState<
crate::dep_graph::DepKind,
- <TyCtxt<$tcx> as QueryContext>::Query,
- query_storage::$name<$tcx>,
+ Query<$tcx>,
+ query_keys::$name<$tcx>,
>,)*
}