@@ -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 , TyCtxtAt } ;
17+ use crate :: ty:: query:: { self , OnDiskCache , TyCtxtAt } ;
1818use crate :: ty:: subst:: { GenericArg , GenericArgKind , InternalSubsts , Subst , SubstsRef , UserSubsts } ;
1919use crate :: ty:: TyKind :: * ;
2020use crate :: ty:: {
@@ -962,6 +962,12 @@ pub struct GlobalCtxt<'tcx> {
962962 pub ( crate ) untracked_crate : & ' tcx hir:: Crate < ' tcx > ,
963963 pub ( crate ) definitions : & ' tcx Definitions ,
964964
965+ /// This provides access to the incremental compilation on-disk cache for query results.
966+ /// Do not access this directly. It is only meant to be used by
967+ /// `DepGraph::try_mark_green()` and the query infrastructure.
968+ /// This is `None` if we are not incremental compilation mode
969+ pub ( crate ) on_disk_cache : Option < OnDiskCache < ' tcx > > ,
970+
965971 pub queries : query:: Queries < ' tcx > ,
966972 pub query_caches : query:: QueryCaches < ' tcx > ,
967973
@@ -1110,7 +1116,7 @@ impl<'tcx> TyCtxt<'tcx> {
11101116 krate : & ' tcx hir:: Crate < ' tcx > ,
11111117 definitions : & ' tcx Definitions ,
11121118 dep_graph : DepGraph ,
1113- on_disk_query_result_cache : Option < query:: OnDiskCache < ' tcx > > ,
1119+ on_disk_cache : Option < query:: OnDiskCache < ' tcx > > ,
11141120 crate_name : & str ,
11151121 output_filenames : & OutputFilenames ,
11161122 ) -> GlobalCtxt < ' tcx > {
@@ -1154,7 +1160,8 @@ impl<'tcx> TyCtxt<'tcx> {
11541160 extern_prelude : resolutions. extern_prelude ,
11551161 untracked_crate : krate,
11561162 definitions,
1157- queries : query:: Queries :: new ( providers, extern_providers, on_disk_query_result_cache) ,
1163+ on_disk_cache,
1164+ queries : query:: Queries :: new ( providers, extern_providers) ,
11581165 query_caches : query:: QueryCaches :: default ( ) ,
11591166 ty_rcache : Default :: default ( ) ,
11601167 pred_rcache : Default :: default ( ) ,
@@ -1320,7 +1327,7 @@ impl<'tcx> TyCtxt<'tcx> {
13201327 }
13211328
13221329 pub fn serialize_query_result_cache ( self , encoder : & mut FileEncoder ) -> FileEncodeResult {
1323- self . queries . on_disk_cache . as_ref ( ) . map_or ( Ok ( ( ) ) , |c| c. serialize ( self , encoder) )
1330+ self . on_disk_cache . as_ref ( ) . map_or ( Ok ( ( ) ) , |c| c. serialize ( self , encoder) )
13241331 }
13251332
13261333 /// If `true`, we should use the MIR-based borrowck, but also
0 commit comments