@@ -19,7 +19,7 @@ use rustc_incremental::setup_dep_graph;
1919use rustc_lint:: { BufferedEarlyLint , EarlyCheckNode , LintStore , unerased_lint_store} ;
2020use rustc_metadata:: creader:: CStore ;
2121use rustc_middle:: arena:: Arena ;
22- use rustc_middle:: ty:: { self , GlobalCtxt , RegisteredTools , TyCtxt } ;
22+ use rustc_middle:: ty:: { self , CurrentGcx , GlobalCtxt , RegisteredTools , TyCtxt } ;
2323use rustc_middle:: util:: Providers ;
2424use rustc_parse:: {
2525 new_parser_from_file, new_parser_from_source_str, unwrap_or_emit_fatal, validate_attr,
@@ -770,15 +770,14 @@ pub fn create_and_enter_global_ctxt<T, F: for<'tcx> FnOnce(TyCtxt<'tcx>) -> T>(
770770 // subtyping for GlobalCtxt::enter to be allowed.
771771 let inner: Box <
772772 dyn for < ' tcx > FnOnce (
773- & ' tcx Compiler ,
773+ & ' tcx Session ,
774+ CurrentGcx ,
774775 & ' tcx OnceLock < GlobalCtxt < ' tcx > > ,
775776 & ' tcx WorkerLocal < Arena < ' tcx > > ,
776777 & ' tcx WorkerLocal < rustc_hir:: Arena < ' tcx > > ,
777778 F ,
778779 ) -> T ,
779- > = Box :: new ( move |compiler, gcx_cell, arena, hir_arena, f| {
780- let sess = & compiler. sess ;
781-
780+ > = Box :: new ( move |sess, current_gcx, gcx_cell, arena, hir_arena, f| {
782781 TyCtxt :: create_global_ctxt (
783782 gcx_cell,
784783 sess,
@@ -796,15 +795,15 @@ pub fn create_and_enter_global_ctxt<T, F: for<'tcx> FnOnce(TyCtxt<'tcx>) -> T>(
796795 incremental,
797796 ) ,
798797 providers. hooks ,
799- compiler . current_gcx . clone ( ) ,
798+ current_gcx,
800799 |tcx| {
801800 let feed = tcx. create_crate_num ( stable_crate_id) . unwrap ( ) ;
802801 assert_eq ! ( feed. key( ) , LOCAL_CRATE ) ;
803802 feed. crate_name ( crate_name) ;
804803
805804 let feed = tcx. feed_unit_query ( ) ;
806805 feed. features_query ( tcx. arena . alloc ( rustc_expand:: config:: features (
807- sess,
806+ tcx . sess ,
808807 & pre_configured_attrs,
809808 crate_name,
810809 ) ) ) ;
@@ -819,7 +818,7 @@ pub fn create_and_enter_global_ctxt<T, F: for<'tcx> FnOnce(TyCtxt<'tcx>) -> T>(
819818 )
820819 } ) ;
821820
822- inner ( compiler, & gcx_cell, & arena, & hir_arena, f)
821+ inner ( & compiler. sess , compiler . current_gcx . clone ( ) , & gcx_cell, & arena, & hir_arena, f)
823822}
824823
825824/// Runs all analyses that we guarantee to run, even if errors were reported in earlier analyses.
0 commit comments