@@ -12,6 +12,7 @@ use rustc::middle::{self, reachable, resolve_lifetime, stability};
12
12
use rustc:: middle:: privacy:: AccessLevels ;
13
13
use rustc:: ty:: { self , AllArenas , Resolutions , TyCtxt , GlobalCtxt } ;
14
14
use rustc:: ty:: steal:: Steal ;
15
+ use rustc:: ty:: query:: OnDiskCache ;
15
16
use rustc:: traits;
16
17
use rustc:: util:: common:: { time, ErrorReported } ;
17
18
use rustc:: util:: profiling:: ProfileCategory ;
@@ -895,6 +896,15 @@ fn load_dep_graph<'tcx>(
895
896
} )
896
897
}
897
898
899
+ fn load_query_result_cache < ' tcx > (
900
+ tcx : TyCtxt < ' tcx > ,
901
+ _: ( ) ,
902
+ ) -> & ' tcx OnDiskCache < ' tcx > {
903
+ time ( tcx. sess , "load query result cache" , || {
904
+ tcx. arena . alloc ( rustc_incremental:: load_query_result_cache ( tcx. sess ) )
905
+ } )
906
+ }
907
+
898
908
pub fn default_provide ( providers : & mut ty:: query:: Providers < ' _ > ) {
899
909
providers. analysis = analysis;
900
910
providers. hir_map = hir_map;
@@ -906,6 +916,7 @@ pub fn default_provide(providers: &mut ty::query::Providers<'_>) {
906
916
providers. early_crate_name = early_crate_name;
907
917
providers. dep_graph_future = dep_graph_future;
908
918
providers. load_dep_graph = load_dep_graph;
919
+ providers. load_query_result_cache = load_query_result_cache;
909
920
proc_macro_decls:: provide ( providers) ;
910
921
plugin:: build:: provide ( providers) ;
911
922
hir:: provide ( providers) ;
@@ -966,10 +977,6 @@ pub fn create_global_ctxt(
966
977
let global_ctxt: Option < GlobalCtxt < ' _ > > ;
967
978
let arenas = AllArenas :: new ( ) ;
968
979
969
- let query_result_on_disk_cache = time ( sess, "load query result cache" , || {
970
- rustc_incremental:: load_query_result_cache ( sess)
971
- } ) ;
972
-
973
980
let mut local_providers = ty:: query:: Providers :: default ( ) ;
974
981
default_provide ( & mut local_providers) ;
975
982
codegen_backend. provide ( & mut local_providers) ;
@@ -985,7 +992,6 @@ pub fn create_global_ctxt(
985
992
local_providers,
986
993
extern_providers,
987
994
& arenas,
988
- query_result_on_disk_cache,
989
995
crate_name,
990
996
tx,
991
997
io,
0 commit comments