@@ -128,7 +128,6 @@ pub(crate) fn type_check<'a, 'tcx>(
128128 flow_inits : & mut ResultsCursor < ' a , ' tcx , MaybeInitializedPlaces < ' a , ' tcx > > ,
129129 move_data : & MoveData < ' tcx > ,
130130 elements : Rc < DenseLocationMap > ,
131- upvars : & [ & ty:: CapturedPlace < ' tcx > ] ,
132131) -> MirTypeckResults < ' tcx > {
133132 let implicit_region_bound = ty:: Region :: new_var ( infcx. tcx , universal_regions. fr_fn_body ) ;
134133 let mut constraints = MirTypeckRegionConstraints {
@@ -171,7 +170,6 @@ pub(crate) fn type_check<'a, 'tcx>(
171170 all_facts,
172171 borrow_set,
173172 constraints : & mut constraints,
174- upvars,
175173 } ;
176174
177175 checker. check_user_type_annotations ( ) ;
@@ -852,7 +850,6 @@ struct TypeChecker<'a, 'tcx> {
852850 all_facts : & ' a mut Option < AllFacts > ,
853851 borrow_set : & ' a BorrowSet < ' tcx > ,
854852 constraints : & ' a mut MirTypeckRegionConstraints < ' tcx > ,
855- upvars : & ' a [ & ' a ty:: CapturedPlace < ' tcx > ] ,
856853}
857854
858855/// Holder struct for passing results from MIR typeck to the rest of the non-lexical regions
@@ -2629,8 +2626,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
26292626 ) ;
26302627
26312628 let tcx = self . infcx . tcx ;
2629+ let def = self . body . source . def_id ( ) . expect_local ( ) ;
2630+ let upvars = tcx. closure_captures ( def) ;
26322631 let field =
2633- path_utils:: is_upvar_field_projection ( tcx, self . upvars , borrowed_place. as_ref ( ) , body) ;
2632+ path_utils:: is_upvar_field_projection ( tcx, upvars, borrowed_place. as_ref ( ) , body) ;
26342633 let category = if let Some ( field) = field {
26352634 ConstraintCategory :: ClosureUpvar ( field)
26362635 } else {
0 commit comments