@@ -458,15 +458,9 @@ pub fn lower_to_hir<'res, 'tcx>(
458458 sess : & ' tcx Session ,
459459 lint_store : & LintStore ,
460460 resolver : & ' res mut Resolver < ' _ > ,
461- dep_graph : & ' res DepGraph ,
462461 krate : & ' res ast:: Crate ,
463462 arena : & ' tcx rustc_ast_lowering:: Arena < ' tcx > ,
464463) -> 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-
470464 // Lower AST to HIR.
471465 let hir_crate = rustc_ast_lowering:: lower_crate (
472466 sess,
@@ -783,17 +777,27 @@ impl<'tcx> QueryContext<'tcx> {
783777pub fn create_global_ctxt < ' tcx > (
784778 compiler : & ' tcx Compiler ,
785779 lint_store : Lrc < LintStore > ,
786- krate : & ' tcx Crate < ' tcx > ,
780+ krate : & ast :: Crate ,
787781 dep_graph : DepGraph ,
788- resolver_outputs : ResolverOutputs ,
782+ resolver : Rc < RefCell < BoxedResolver > > ,
789783 outputs : OutputFilenames ,
790784 crate_name : & str ,
791785 queries : & ' tcx OnceCell < TcxQueries < ' tcx > > ,
792786 global_ctxt : & ' tcx OnceCell < GlobalCtxt < ' tcx > > ,
793787 arena : & ' tcx WorkerLocal < Arena < ' tcx > > ,
788+ hir_arena : & ' tcx WorkerLocal < rustc_ast_lowering:: Arena < ' tcx > > ,
794789) -> 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+
795795 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) ;
797801
798802 let query_result_on_disk_cache = rustc_incremental:: load_query_result_cache ( sess) ;
799803
@@ -812,7 +816,7 @@ pub fn create_global_ctxt<'tcx>(
812816 let queries = queries. get_or_init ( || TcxQueries :: new ( local_providers, extern_providers) ) ;
813817
814818 let gcx = sess. time ( "setup_global_ctxt" , || {
815- global_ctxt. get_or_init ( || {
819+ global_ctxt. get_or_init ( move || {
816820 TyCtxt :: create_global_ctxt (
817821 sess,
818822 lint_store,
0 commit comments