@@ -570,7 +570,7 @@ impl<'tcx> fmt::Display for FixupError<'tcx> {
570570/// Necessary because we can't write the following bound:
571571/// `F: for<'b, 'tcx> where 'tcx FnOnce(InferCtxt<'b, 'tcx>)`.
572572pub struct InferCtxtBuilder < ' tcx > {
573- global_tcx : TyCtxt < ' tcx > ,
573+ tcx : TyCtxt < ' tcx > ,
574574 fresh_tables : Option < RefCell < ty:: TypeckTables < ' tcx > > > ,
575575}
576576
@@ -580,7 +580,7 @@ pub trait TyCtxtInferExt<'tcx> {
580580
581581impl TyCtxtInferExt < ' tcx > for TyCtxt < ' tcx > {
582582 fn infer_ctxt ( self ) -> InferCtxtBuilder < ' tcx > {
583- InferCtxtBuilder { global_tcx : self , fresh_tables : None }
583+ InferCtxtBuilder { tcx : self , fresh_tables : None }
584584 }
585585}
586586
@@ -616,24 +616,22 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
616616 }
617617
618618 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 ;
620620 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 ) ,
637635 } )
638636 }
639637}
0 commit comments