@@ -128,7 +128,6 @@ pub(crate) fn type_check<'a, 'tcx>(
128
128
flow_inits : & mut ResultsCursor < ' a , ' tcx , MaybeInitializedPlaces < ' a , ' tcx > > ,
129
129
move_data : & MoveData < ' tcx > ,
130
130
elements : Rc < DenseLocationMap > ,
131
- upvars : & [ & ty:: CapturedPlace < ' tcx > ] ,
132
131
) -> MirTypeckResults < ' tcx > {
133
132
let implicit_region_bound = ty:: Region :: new_var ( infcx. tcx , universal_regions. fr_fn_body ) ;
134
133
let mut constraints = MirTypeckRegionConstraints {
@@ -171,7 +170,6 @@ pub(crate) fn type_check<'a, 'tcx>(
171
170
all_facts,
172
171
borrow_set,
173
172
constraints : & mut constraints,
174
- upvars,
175
173
} ;
176
174
177
175
checker. check_user_type_annotations ( ) ;
@@ -852,7 +850,6 @@ struct TypeChecker<'a, 'tcx> {
852
850
all_facts : & ' a mut Option < AllFacts > ,
853
851
borrow_set : & ' a BorrowSet < ' tcx > ,
854
852
constraints : & ' a mut MirTypeckRegionConstraints < ' tcx > ,
855
- upvars : & ' a [ & ' a ty:: CapturedPlace < ' tcx > ] ,
856
853
}
857
854
858
855
/// 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> {
2629
2626
) ;
2630
2627
2631
2628
let tcx = self . infcx . tcx ;
2629
+ let def = self . body . source . def_id ( ) . expect_local ( ) ;
2630
+ let upvars = tcx. closure_captures ( def) ;
2632
2631
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) ;
2634
2633
let category = if let Some ( field) = field {
2635
2634
ConstraintCategory :: ClosureUpvar ( field)
2636
2635
} else {
0 commit comments