@@ -490,7 +490,7 @@ fn locals_live_across_suspend_points(
490
490
491
491
fn compute_layout < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
492
492
source : MirSource < ' tcx > ,
493
- upvars : Vec < Ty < ' tcx > > ,
493
+ upvars : & Vec < Ty < ' tcx > > ,
494
494
interior : Ty < ' tcx > ,
495
495
movable : bool ,
496
496
mir : & mut Mir < ' tcx > )
@@ -505,7 +505,7 @@ fn compute_layout<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
505
505
movable) ;
506
506
// Erase regions from the types passed in from typeck so we can compare them with
507
507
// MIR types
508
- let allowed_upvars = tcx. erase_regions ( & upvars) ;
508
+ let allowed_upvars = tcx. erase_regions ( upvars) ;
509
509
let allowed = match interior. sty {
510
510
ty:: GeneratorWitness ( s) => tcx. erase_late_bound_regions ( & s) ,
511
511
_ => bug ! ( ) ,
@@ -528,7 +528,7 @@ fn compute_layout<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
528
528
}
529
529
}
530
530
531
- let upvar_len = mir . upvar_decls . len ( ) ;
531
+ let upvar_len = upvars . len ( ) ;
532
532
let dummy_local = LocalDecl :: new_internal ( tcx. mk_unit ( ) , mir. span ) ;
533
533
534
534
// Gather live locals and their indices replacing values in mir.local_decls with a dummy
@@ -917,12 +917,12 @@ impl MirPass for StateTransform {
917
917
let ( remap, layout, storage_liveness) = compute_layout (
918
918
tcx,
919
919
source,
920
- upvars,
920
+ & upvars,
921
921
interior,
922
922
movable,
923
923
mir) ;
924
924
925
- let state_field = mir . upvar_decls . len ( ) ;
925
+ let state_field = upvars . len ( ) ;
926
926
927
927
// Run the transformation which converts Places from Local to generator struct
928
928
// accesses for locals in `remap`.
0 commit comments