@@ -14,7 +14,7 @@ use crate::middle::stability;
1414use crate :: mir:: interpret:: { self , Allocation , ConstValue , Scalar } ;
1515use crate :: mir:: { Body , Field , Local , Place , PlaceElem , ProjectionKind , Promoted } ;
1616use crate :: traits;
17- use crate :: ty:: query:: { self , OnDiskCache , TyCtxtAt } ;
17+ use crate :: ty:: query:: { self , OnDiskCache , Queries , TyCtxtAt } ;
1818use crate :: ty:: subst:: { GenericArg , GenericArgKind , InternalSubsts , Subst , SubstsRef , UserSubsts } ;
1919use crate :: ty:: TyKind :: * ;
2020use crate :: ty:: {
@@ -968,7 +968,7 @@ pub struct GlobalCtxt<'tcx> {
968968 /// This is `None` if we are not incremental compilation mode
969969 pub ( crate ) on_disk_cache : Option < OnDiskCache < ' tcx > > ,
970970
971- pub queries : query:: Queries < ' tcx > ,
971+ pub queries : & ' tcx query:: Queries < ' tcx > ,
972972 pub query_caches : query:: QueryCaches < ' tcx > ,
973973
974974 maybe_unused_trait_imports : FxHashSet < LocalDefId > ,
@@ -1109,14 +1109,13 @@ impl<'tcx> TyCtxt<'tcx> {
11091109 pub fn create_global_ctxt (
11101110 s : & ' tcx Session ,
11111111 lint_store : Lrc < dyn Any + sync:: Send + sync:: Sync > ,
1112- local_providers : ty:: query:: Providers ,
1113- extern_providers : ty:: query:: Providers ,
11141112 arena : & ' tcx WorkerLocal < Arena < ' tcx > > ,
11151113 resolutions : ty:: ResolverOutputs ,
11161114 krate : & ' tcx hir:: Crate < ' tcx > ,
11171115 definitions : & ' tcx Definitions ,
11181116 dep_graph : DepGraph ,
11191117 on_disk_cache : Option < query:: OnDiskCache < ' tcx > > ,
1118+ queries : & ' tcx Queries < ' tcx > ,
11201119 crate_name : & str ,
11211120 output_filenames : & OutputFilenames ,
11221121 ) -> GlobalCtxt < ' tcx > {
@@ -1128,10 +1127,6 @@ impl<'tcx> TyCtxt<'tcx> {
11281127 let common_lifetimes = CommonLifetimes :: new ( & interners) ;
11291128 let common_consts = CommonConsts :: new ( & interners, & common_types) ;
11301129 let cstore = resolutions. cstore ;
1131- let crates = cstore. crates_untracked ( ) ;
1132- let max_cnum = crates. iter ( ) . map ( |c| c. as_usize ( ) ) . max ( ) . unwrap_or ( 0 ) ;
1133- let mut providers = IndexVec :: from_elem_n ( extern_providers, max_cnum + 1 ) ;
1134- providers[ LOCAL_CRATE ] = local_providers;
11351130
11361131 let mut trait_map: FxHashMap < _ , FxHashMap < _ , _ > > = FxHashMap :: default ( ) ;
11371132 for ( hir_id, v) in krate. trait_map . iter ( ) {
@@ -1161,7 +1156,7 @@ impl<'tcx> TyCtxt<'tcx> {
11611156 untracked_crate : krate,
11621157 definitions,
11631158 on_disk_cache,
1164- queries : query :: Queries :: new ( providers , extern_providers ) ,
1159+ queries,
11651160 query_caches : query:: QueryCaches :: default ( ) ,
11661161 ty_rcache : Default :: default ( ) ,
11671162 pred_rcache : Default :: default ( ) ,
0 commit comments