@@ -46,7 +46,7 @@ use ty::{TyVar, TyVid, IntVar, IntVid, FloatVar, FloatVid};
4646use ty:: TypeVariants :: * ;
4747use ty:: GenericParamDefKind ;
4848use ty:: layout:: { LayoutDetails , TargetDataLayout } ;
49- use ty:: maps ;
49+ use ty:: query ;
5050use ty:: steal:: Steal ;
5151use ty:: BindingMode ;
5252use ty:: CanonicalTy ;
@@ -863,11 +863,6 @@ pub struct GlobalCtxt<'tcx> {
863863
864864 pub dep_graph : DepGraph ,
865865
866- /// This provides access to the incr. comp. on-disk cache for query results.
867- /// Do not access this directly. It is only meant to be used by
868- /// `DepGraph::try_mark_green()` and the query infrastructure in `ty::maps`.
869- pub ( crate ) on_disk_query_result_cache : maps:: OnDiskCache < ' tcx > ,
870-
871866 /// Common types, pre-interned for your convenience.
872867 pub types : CommonTypes < ' tcx > ,
873868
@@ -886,7 +881,7 @@ pub struct GlobalCtxt<'tcx> {
886881 /// as well as all upstream crates. Only populated in incremental mode.
887882 pub def_path_hash_to_def_id : Option < FxHashMap < DefPathHash , DefId > > ,
888883
889- pub maps : maps :: Maps < ' tcx > ,
884+ pub ( crate ) queries : query :: Queries < ' tcx > ,
890885
891886 // Records the free variables refrenced by every closure
892887 // expression. Do not track deps for this, just recompute it from
@@ -1074,12 +1069,12 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
10741069 /// reference to the context, to allow formatting values that need it.
10751070 pub fn create_and_enter < F , R > ( s : & ' tcx Session ,
10761071 cstore : & ' tcx CrateStoreDyn ,
1077- local_providers : ty:: maps :: Providers < ' tcx > ,
1078- extern_providers : ty:: maps :: Providers < ' tcx > ,
1072+ local_providers : ty:: query :: Providers < ' tcx > ,
1073+ extern_providers : ty:: query :: Providers < ' tcx > ,
10791074 arenas : & ' tcx AllArenas < ' tcx > ,
10801075 resolutions : ty:: Resolutions ,
10811076 hir : hir_map:: Map < ' tcx > ,
1082- on_disk_query_result_cache : maps :: OnDiskCache < ' tcx > ,
1077+ on_disk_query_result_cache : query :: OnDiskCache < ' tcx > ,
10831078 crate_name : & str ,
10841079 tx : mpsc:: Sender < Box < dyn Any + Send > > ,
10851080 output_filenames : & OutputFilenames ,
@@ -1144,7 +1139,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
11441139 global_arenas : & arenas. global ,
11451140 global_interners : interners,
11461141 dep_graph : dep_graph. clone ( ) ,
1147- on_disk_query_result_cache,
11481142 types : common_types,
11491143 trait_map,
11501144 export_map : resolutions. export_map . into_iter ( ) . map ( |( k, v) | {
@@ -1165,7 +1159,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
11651159 . collect ( ) ,
11661160 hir,
11671161 def_path_hash_to_def_id,
1168- maps : maps :: Maps :: new ( providers) ,
1162+ queries : query :: Queries :: new ( providers, on_disk_query_result_cache ) ,
11691163 rcache : Lock :: new ( FxHashMap ( ) ) ,
11701164 selection_cache : traits:: SelectionCache :: new ( ) ,
11711165 evaluation_cache : traits:: EvaluationCache :: new ( ) ,
@@ -1343,7 +1337,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
13431337 -> Result < ( ) , E :: Error >
13441338 where E : ty:: codec:: TyEncoder
13451339 {
1346- self . on_disk_query_result_cache . serialize ( self . global_tcx ( ) , encoder)
1340+ self . queries . on_disk_cache . serialize ( self . global_tcx ( ) , encoder)
13471341 }
13481342
13491343 /// If true, we should use a naive AST walk to determine if match
@@ -1702,7 +1696,7 @@ pub mod tls {
17021696 use std:: fmt;
17031697 use std:: mem;
17041698 use syntax_pos;
1705- use ty:: maps ;
1699+ use ty:: query ;
17061700 use errors:: { Diagnostic , TRACK_DIAGNOSTICS } ;
17071701 use rustc_data_structures:: OnDrop ;
17081702 use rustc_data_structures:: sync:: { self , Lrc , Lock } ;
@@ -1726,8 +1720,8 @@ pub mod tls {
17261720 pub tcx : TyCtxt < ' a , ' gcx , ' tcx > ,
17271721
17281722 /// The current query job, if any. This is updated by start_job in
1729- /// ty::maps ::plumbing when executing a query
1730- pub query : Option < Lrc < maps :: QueryJob < ' gcx > > > ,
1723+ /// ty::query ::plumbing when executing a query
1724+ pub query : Option < Lrc < query :: QueryJob < ' gcx > > > ,
17311725
17321726 /// Used to prevent layout from recursing too deeply.
17331727 pub layout_depth : usize ,
@@ -2792,7 +2786,7 @@ impl<T, R, E> InternIteratorElement<T, R> for Result<T, E> {
27922786 }
27932787}
27942788
2795- pub fn provide ( providers : & mut ty:: maps :: Providers ) {
2789+ pub fn provide ( providers : & mut ty:: query :: Providers ) {
27962790 // FIXME(#44234) - almost all of these queries have no sub-queries and
27972791 // therefore no actual inputs, they're just reading tables calculated in
27982792 // resolve! Does this work? Unsure! That's what the issue is about
0 commit comments