@@ -37,6 +37,7 @@ use crate::ty::{InferConst, ParamConst};
3737use crate :: ty:: GenericParamDefKind ;
3838use crate :: ty:: layout:: { LayoutDetails , TargetDataLayout , VariantIdx } ;
3939use crate :: ty:: query;
40+ use crate :: ty:: query:: OnDiskCache ;
4041use crate :: ty:: steal:: Steal ;
4142use crate :: ty:: subst:: { UserSubsts , UnpackedKind } ;
4243use crate :: ty:: { BoundVar , BindingMode } ;
@@ -1033,6 +1034,8 @@ pub struct GlobalCtxt<'tcx> {
10331034
10341035 metadata_dep_nodes : Once < ( ) > ,
10351036
1037+ pub on_disk_cache_store : Once < OnDiskCache < ' tcx > > ,
1038+
10361039 pub queries : query:: Queries < ' tcx > ,
10371040
10381041 // Internal cache for metadata decoding. No need to track deps on this.
@@ -1114,7 +1117,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
11141117 #[ inline( always) ]
11151118 pub fn hir ( self ) -> & ' gcx hir_map:: Map < ' gcx > {
11161119 self . hir_map . get_or_init ( || {
1117- // We can use `with_ignore ` here because the hir map does its own tracking
1120+ // We can use `ignore_deps ` here because the hir map does its own tracking
11181121 DepGraph :: ignore_deps ( || self . hir_map ( LOCAL_CRATE ) )
11191122 } )
11201123 }
@@ -1220,7 +1223,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
12201223 local_providers : ty:: query:: Providers < ' tcx > ,
12211224 extern_providers : ty:: query:: Providers < ' tcx > ,
12221225 arenas : & ' tcx AllArenas < ' tcx > ,
1223- on_disk_query_result_cache : query:: OnDiskCache < ' tcx > ,
12241226 crate_name : Option < String > ,
12251227 tx : mpsc:: Sender < Box < dyn Any + Send > > ,
12261228 io : InputsAndOutputs ,
@@ -1247,10 +1249,10 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
12471249 lowered_hir : AtomicOnce :: new ( ) ,
12481250 hir_map : AtomicOnce :: new ( ) ,
12491251 metadata_dep_nodes : Once :: new ( ) ,
1252+ on_disk_cache_store : Once :: new ( ) ,
12501253 queries : query:: Queries :: new (
12511254 providers,
12521255 extern_providers,
1253- on_disk_query_result_cache,
12541256 ) ,
12551257 rcache : Default :: default ( ) ,
12561258 selection_cache : Default :: default ( ) ,
@@ -1437,7 +1439,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
14371439 -> Result < ( ) , E :: Error >
14381440 where E : ty:: codec:: TyEncoder
14391441 {
1440- self . queries . on_disk_cache . serialize ( self . global_tcx ( ) , encoder)
1442+ self . on_disk_cache ( ) . serialize ( self . global_tcx ( ) , encoder)
14411443 }
14421444
14431445 /// This checks whether one is allowed to have pattern bindings
0 commit comments