@@ -47,7 +47,7 @@ use crate::region_infer::values::{LivenessValues, PlaceholderIndex, PlaceholderI
4747use crate :: session_diagnostics:: { MoveUnsized , SimdIntrinsicArgConst } ;
4848use crate :: type_check:: free_region_relations:: { CreateResult , UniversalRegionRelations } ;
4949use crate :: universal_regions:: { DefiningTy , UniversalRegions } ;
50- use crate :: { BorrowCheckRootCtxt , BorrowckInferCtxt , DeferredClosureRequirements , path_utils} ;
50+ use crate :: { BorrowckInferCtxt , DeferredClosureRequirements , path_utils} ;
5151
5252macro_rules! span_mirbug {
5353 ( $context: expr, $elem: expr, $( $message: tt) * ) => ( {
@@ -94,7 +94,6 @@ mod relate_tys;
9494/// - `move_data` -- move-data constructed when performing the maybe-init dataflow analysis
9595/// - `location_map` -- map between MIR `Location` and `PointIndex`
9696pub ( crate ) fn type_check < ' tcx > (
97- root_cx : & BorrowCheckRootCtxt < ' _ , ' tcx > ,
9897 infcx : & BorrowckInferCtxt < ' tcx > ,
9998 body : & Body < ' tcx > ,
10099 promoted : & IndexSlice < Promoted , Body < ' tcx > > ,
@@ -145,7 +144,6 @@ pub(crate) fn type_check<'tcx>(
145144
146145 let mut deferred_closure_requirements = Default :: default ( ) ;
147146 let mut typeck = TypeChecker {
148- root_cx,
149147 infcx,
150148 last_span : body. span ,
151149 body,
@@ -227,7 +225,6 @@ enum FieldAccessError {
227225/// way, it accrues region constraints -- these can later be used by
228226/// NLL region checking.
229227struct TypeChecker < ' a , ' tcx > {
230- root_cx : & ' a BorrowCheckRootCtxt < ' a , ' tcx > ,
231228 infcx : & ' a BorrowckInferCtxt < ' tcx > ,
232229 last_span : Span ,
233230 body : & ' a Body < ' tcx > ,
@@ -2715,7 +2712,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
27152712 args : GenericArgsRef < ' tcx > ,
27162713 location : Location ,
27172714 ) -> ty:: InstantiatedClauses < ' tcx > {
2718- let root_def_id = self . root_cx . root_def_id ( ) ;
2715+ let root_def_id = self . infcx . root_def_id ;
27192716 // We will have to handle propagated closure requirements for this closure,
27202717 // but need to defer this until the nested body has been fully borrow checked.
27212718 self . deferred_closure_requirements . push ( ( def_id, args, location. to_locations ( ) ) ) ;
0 commit comments