@@ -458,15 +458,9 @@ pub fn lower_to_hir<'res, 'tcx>(
458
458
sess : & ' tcx Session ,
459
459
lint_store : & LintStore ,
460
460
resolver : & ' res mut Resolver < ' _ > ,
461
- dep_graph : & ' res DepGraph ,
462
461
krate : & ' res ast:: Crate ,
463
462
arena : & ' tcx rustc_ast_lowering:: Arena < ' tcx > ,
464
463
) -> Crate < ' tcx > {
465
- // We're constructing the HIR here; we don't care what we will
466
- // read, since we haven't even constructed the *input* to
467
- // incr. comp. yet.
468
- dep_graph. assert_ignored ( ) ;
469
-
470
464
// Lower AST to HIR.
471
465
let hir_crate = rustc_ast_lowering:: lower_crate (
472
466
sess,
@@ -783,17 +777,27 @@ impl<'tcx> QueryContext<'tcx> {
783
777
pub fn create_global_ctxt < ' tcx > (
784
778
compiler : & ' tcx Compiler ,
785
779
lint_store : Lrc < LintStore > ,
786
- krate : & ' tcx Crate < ' tcx > ,
780
+ krate : & ast :: Crate ,
787
781
dep_graph : DepGraph ,
788
- resolver_outputs : ResolverOutputs ,
782
+ resolver : Rc < RefCell < BoxedResolver > > ,
789
783
outputs : OutputFilenames ,
790
784
crate_name : & str ,
791
785
queries : & ' tcx OnceCell < TcxQueries < ' tcx > > ,
792
786
global_ctxt : & ' tcx OnceCell < GlobalCtxt < ' tcx > > ,
793
787
arena : & ' tcx WorkerLocal < Arena < ' tcx > > ,
788
+ hir_arena : & ' tcx WorkerLocal < rustc_ast_lowering:: Arena < ' tcx > > ,
794
789
) -> QueryContext < ' tcx > {
790
+ // We're constructing the HIR here; we don't care what we will
791
+ // read, since we haven't even constructed the *input* to
792
+ // incr. comp. yet.
793
+ dep_graph. assert_ignored ( ) ;
794
+
795
795
let sess = & compiler. session ( ) ;
796
- let _timer = sess. timer ( "create_global_ctxt" ) ;
796
+ let krate = resolver
797
+ . borrow_mut ( )
798
+ . access ( |resolver| lower_to_hir ( sess, & lint_store, resolver, krate, hir_arena) ) ;
799
+ let krate = & * hir_arena. alloc ( krate) ;
800
+ let resolver_outputs = BoxedResolver :: to_resolver_outputs ( resolver) ;
797
801
798
802
let query_result_on_disk_cache = rustc_incremental:: load_query_result_cache ( sess) ;
799
803
@@ -812,7 +816,7 @@ pub fn create_global_ctxt<'tcx>(
812
816
let queries = queries. get_or_init ( || TcxQueries :: new ( local_providers, extern_providers) ) ;
813
817
814
818
let gcx = sess. time ( "setup_global_ctxt" , || {
815
- global_ctxt. get_or_init ( || {
819
+ global_ctxt. get_or_init ( move || {
816
820
TyCtxt :: create_global_ctxt (
817
821
sess,
818
822
lint_store,
0 commit comments