@@ -31,13 +31,12 @@ use crate::traits::{self, ImplSource};
3131use crate :: ty:: subst:: { GenericArg , SubstsRef } ;
3232use crate :: ty:: util:: AlwaysRequiresDrop ;
3333use crate :: ty:: { self , AdtSizedConstraint , CrateInherentImpls , ParamEnvAnd , Ty , TyCtxt } ;
34- use rustc_data_structures:: fingerprint:: Fingerprint ;
3534use rustc_data_structures:: fx:: { FxHashMap , FxHashSet , FxIndexMap } ;
3635use rustc_data_structures:: stable_hasher:: StableVec ;
3736use rustc_data_structures:: steal:: Steal ;
3837use rustc_data_structures:: svh:: Svh ;
3938use rustc_data_structures:: sync:: Lrc ;
40- use rustc_errors:: { Diagnostic , ErrorReported , Handler , Level } ;
39+ use rustc_errors:: { ErrorReported , Handler } ;
4140use rustc_hir as hir;
4241use rustc_hir:: def:: DefKind ;
4342use rustc_hir:: def_id:: { CrateNum , DefId , DefIdMap , DefIdSet , LocalDefId } ;
@@ -59,34 +58,12 @@ use std::ops::Deref;
5958use std:: path:: PathBuf ;
6059use std:: sync:: Arc ;
6160
62- #[ macro_use]
63- mod plumbing;
64- pub use plumbing:: QueryCtxt ;
65- use plumbing:: QueryStruct ;
66- pub ( crate ) use rustc_query_system:: query:: CycleError ;
61+ pub ( crate ) use rustc_query_system:: query:: QueryJobId ;
6762use rustc_query_system:: query:: * ;
6863
69- mod stats;
70- pub use self :: stats:: print_stats;
71-
72- pub use rustc_query_system:: query:: { QueryInfo , QueryJob , QueryJobId } ;
73-
74- mod keys;
75- use self :: keys:: Key ;
76-
77- mod values;
78- use self :: values:: Value ;
79-
80- use rustc_query_system:: query:: QueryAccessors ;
81- pub use rustc_query_system:: query:: QueryConfig ;
82- pub ( crate ) use rustc_query_system:: query:: QueryDescription ;
83-
84- mod on_disk_cache;
64+ pub mod on_disk_cache;
8565pub use self :: on_disk_cache:: OnDiskCache ;
8666
87- mod profiling_support;
88- pub use self :: profiling_support:: alloc_self_profile_query_strings;
89-
9067#[ derive( Copy , Clone ) ]
9168pub struct TyCtxtAt < ' tcx > {
9269 pub tcx : TyCtxt < ' tcx > ,
@@ -131,6 +108,18 @@ macro_rules! query_helper_param_ty {
131108 ( $K: ty) => { $K } ;
132109}
133110
111+ macro_rules! query_storage {
112+ ( [ ] [ $K: ty, $V: ty] ) => {
113+ <DefaultCacheSelector as CacheSelector <$K, $V>>:: Cache
114+ } ;
115+ ( [ storage( $ty: ty) $( $rest: tt) * ] [ $K: ty, $V: ty] ) => {
116+ <$ty as CacheSelector <$K, $V>>:: Cache
117+ } ;
118+ ( [ $other: ident $( ( $( $other_args: tt) * ) ) * $( , $( $modifiers: tt) * ) * ] [ $( $args: tt) * ] ) => {
119+ query_storage!( [ $( $( $modifiers) * ) * ] [ $( $args) * ] )
120+ } ;
121+ }
122+
134123macro_rules! define_callbacks {
135124 ( <$tcx: tt>
136125 $( $( #[ $attr: meta] ) *
@@ -169,7 +158,7 @@ macro_rules! define_callbacks {
169158
170159 #[ derive( Default ) ]
171160 pub struct QueryCaches <$tcx> {
172- $( $( #[ $attr] ) * $name: QueryCacheStore <query_storage:: $name<$tcx>>, ) *
161+ $( $( #[ $attr] ) * pub $name: QueryCacheStore <query_storage:: $name<$tcx>>, ) *
173162 }
174163
175164 impl TyCtxtEnsure <$tcx> {
@@ -288,7 +277,6 @@ macro_rules! define_callbacks {
288277// Queries marked with `fatal_cycle` do not need the latter implementation,
289278// as they will raise an fatal error on query cycles instead.
290279
291- rustc_query_append ! { [ define_queries!] [ <' tcx>] }
292280rustc_query_append ! { [ define_callbacks!] [ <' tcx>] }
293281
294282mod sealed {
0 commit comments