@@ -570,7 +570,7 @@ impl<'tcx> fmt::Display for FixupError<'tcx> {
570
570
/// Necessary because we can't write the following bound:
571
571
/// `F: for<'b, 'tcx> where 'tcx FnOnce(InferCtxt<'b, 'tcx>)`.
572
572
pub struct InferCtxtBuilder < ' tcx > {
573
- global_tcx : TyCtxt < ' tcx > ,
573
+ tcx : TyCtxt < ' tcx > ,
574
574
fresh_tables : Option < RefCell < ty:: TypeckTables < ' tcx > > > ,
575
575
}
576
576
@@ -580,7 +580,7 @@ pub trait TyCtxtInferExt<'tcx> {
580
580
581
581
impl TyCtxtInferExt < ' tcx > for TyCtxt < ' tcx > {
582
582
fn infer_ctxt ( self ) -> InferCtxtBuilder < ' tcx > {
583
- InferCtxtBuilder { global_tcx : self , fresh_tables : None }
583
+ InferCtxtBuilder { tcx : self , fresh_tables : None }
584
584
}
585
585
}
586
586
@@ -616,24 +616,22 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
616
616
}
617
617
618
618
pub fn enter < R > ( & mut self , f : impl for < ' a > FnOnce ( InferCtxt < ' a , ' tcx > ) -> R ) -> R {
619
- let InferCtxtBuilder { global_tcx , ref fresh_tables } = * self ;
619
+ let InferCtxtBuilder { tcx , ref fresh_tables } = * self ;
620
620
let in_progress_tables = fresh_tables. as_ref ( ) ;
621
- global_tcx. enter_local ( |tcx| {
622
- f ( InferCtxt {
623
- tcx,
624
- in_progress_tables,
625
- inner : RefCell :: new ( InferCtxtInner :: new ( ) ) ,
626
- lexical_region_resolutions : RefCell :: new ( None ) ,
627
- selection_cache : Default :: default ( ) ,
628
- evaluation_cache : Default :: default ( ) ,
629
- reported_trait_errors : Default :: default ( ) ,
630
- reported_closure_mismatch : Default :: default ( ) ,
631
- tainted_by_errors_flag : Cell :: new ( false ) ,
632
- err_count_on_creation : tcx. sess . err_count ( ) ,
633
- in_snapshot : Cell :: new ( false ) ,
634
- skip_leak_check : Cell :: new ( false ) ,
635
- universe : Cell :: new ( ty:: UniverseIndex :: ROOT ) ,
636
- } )
621
+ f ( InferCtxt {
622
+ tcx,
623
+ in_progress_tables,
624
+ inner : RefCell :: new ( InferCtxtInner :: new ( ) ) ,
625
+ lexical_region_resolutions : RefCell :: new ( None ) ,
626
+ selection_cache : Default :: default ( ) ,
627
+ evaluation_cache : Default :: default ( ) ,
628
+ reported_trait_errors : Default :: default ( ) ,
629
+ reported_closure_mismatch : Default :: default ( ) ,
630
+ tainted_by_errors_flag : Cell :: new ( false ) ,
631
+ err_count_on_creation : tcx. sess . err_count ( ) ,
632
+ in_snapshot : Cell :: new ( false ) ,
633
+ skip_leak_check : Cell :: new ( false ) ,
634
+ universe : Cell :: new ( ty:: UniverseIndex :: ROOT ) ,
637
635
} )
638
636
}
639
637
}
0 commit comments