@@ -31,13 +31,12 @@ use crate::traits::{self, ImplSource};
31
31
use crate :: ty:: subst:: { GenericArg , SubstsRef } ;
32
32
use crate :: ty:: util:: AlwaysRequiresDrop ;
33
33
use crate :: ty:: { self , AdtSizedConstraint , CrateInherentImpls , ParamEnvAnd , Ty , TyCtxt } ;
34
- use rustc_data_structures:: fingerprint:: Fingerprint ;
35
34
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet , FxIndexMap } ;
36
35
use rustc_data_structures:: stable_hasher:: StableVec ;
37
36
use rustc_data_structures:: steal:: Steal ;
38
37
use rustc_data_structures:: svh:: Svh ;
39
38
use rustc_data_structures:: sync:: Lrc ;
40
- use rustc_errors:: { Diagnostic , ErrorReported , Handler , Level } ;
39
+ use rustc_errors:: { ErrorReported , Handler } ;
41
40
use rustc_hir as hir;
42
41
use rustc_hir:: def:: DefKind ;
43
42
use rustc_hir:: def_id:: { CrateNum , DefId , DefIdMap , DefIdSet , LocalDefId } ;
@@ -59,34 +58,12 @@ use std::ops::Deref;
59
58
use std:: path:: PathBuf ;
60
59
use std:: sync:: Arc ;
61
60
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 ;
67
62
use rustc_query_system:: query:: * ;
68
63
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;
85
65
pub use self :: on_disk_cache:: OnDiskCache ;
86
66
87
- mod profiling_support;
88
- pub use self :: profiling_support:: alloc_self_profile_query_strings;
89
-
90
67
#[ derive( Copy , Clone ) ]
91
68
pub struct TyCtxtAt < ' tcx > {
92
69
pub tcx : TyCtxt < ' tcx > ,
@@ -131,6 +108,18 @@ macro_rules! query_helper_param_ty {
131
108
( $K: ty) => { $K } ;
132
109
}
133
110
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
+
134
123
macro_rules! define_callbacks {
135
124
( <$tcx: tt>
136
125
$( $( #[ $attr: meta] ) *
@@ -169,7 +158,7 @@ macro_rules! define_callbacks {
169
158
170
159
#[ derive( Default ) ]
171
160
pub struct QueryCaches <$tcx> {
172
- $( $( #[ $attr] ) * $name: QueryCacheStore <query_storage:: $name<$tcx>>, ) *
161
+ $( $( #[ $attr] ) * pub $name: QueryCacheStore <query_storage:: $name<$tcx>>, ) *
173
162
}
174
163
175
164
impl TyCtxtEnsure <$tcx> {
@@ -288,7 +277,6 @@ macro_rules! define_callbacks {
288
277
// Queries marked with `fatal_cycle` do not need the latter implementation,
289
278
// as they will raise an fatal error on query cycles instead.
290
279
291
- rustc_query_append ! { [ define_queries!] [ <' tcx>] }
292
280
rustc_query_append ! { [ define_callbacks!] [ <' tcx>] }
293
281
294
282
mod sealed {
0 commit comments