@@ -19,7 +19,7 @@ use rustc_incremental::setup_dep_graph;
19
19
use rustc_lint:: { BufferedEarlyLint , EarlyCheckNode , LintStore , unerased_lint_store} ;
20
20
use rustc_metadata:: creader:: CStore ;
21
21
use rustc_middle:: arena:: Arena ;
22
- use rustc_middle:: ty:: { self , GlobalCtxt , RegisteredTools , TyCtxt } ;
22
+ use rustc_middle:: ty:: { self , CurrentGcx , GlobalCtxt , RegisteredTools , TyCtxt } ;
23
23
use rustc_middle:: util:: Providers ;
24
24
use rustc_parse:: {
25
25
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>(
770
770
// subtyping for GlobalCtxt::enter to be allowed.
771
771
let inner: Box <
772
772
dyn for < ' tcx > FnOnce (
773
- & ' tcx Compiler ,
773
+ & ' tcx Session ,
774
+ CurrentGcx ,
774
775
& ' tcx OnceLock < GlobalCtxt < ' tcx > > ,
775
776
& ' tcx WorkerLocal < Arena < ' tcx > > ,
776
777
& ' tcx WorkerLocal < rustc_hir:: Arena < ' tcx > > ,
777
778
F ,
778
779
) -> 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| {
782
781
TyCtxt :: create_global_ctxt (
783
782
gcx_cell,
784
783
sess,
@@ -796,15 +795,15 @@ pub fn create_and_enter_global_ctxt<T, F: for<'tcx> FnOnce(TyCtxt<'tcx>) -> T>(
796
795
incremental,
797
796
) ,
798
797
providers. hooks ,
799
- compiler . current_gcx . clone ( ) ,
798
+ current_gcx,
800
799
|tcx| {
801
800
let feed = tcx. create_crate_num ( stable_crate_id) . unwrap ( ) ;
802
801
assert_eq ! ( feed. key( ) , LOCAL_CRATE ) ;
803
802
feed. crate_name ( crate_name) ;
804
803
805
804
let feed = tcx. feed_unit_query ( ) ;
806
805
feed. features_query ( tcx. arena . alloc ( rustc_expand:: config:: features (
807
- sess,
806
+ tcx . sess ,
808
807
& pre_configured_attrs,
809
808
crate_name,
810
809
) ) ) ;
@@ -819,7 +818,7 @@ pub fn create_and_enter_global_ctxt<T, F: for<'tcx> FnOnce(TyCtxt<'tcx>) -> T>(
819
818
)
820
819
} ) ;
821
820
822
- inner ( compiler, & gcx_cell, & arena, & hir_arena, f)
821
+ inner ( & compiler. sess , compiler . current_gcx . clone ( ) , & gcx_cell, & arena, & hir_arena, f)
823
822
}
824
823
825
824
/// Runs all analyses that we guarantee to run, even if errors were reported in earlier analyses.
0 commit comments