@@ -672,18 +672,17 @@ fn locals_live_across_suspend_points<'tcx>(
672
672
673
673
// Calculate the MIR locals which have been previously
674
674
// borrowed (even if they are still active).
675
- let borrowed_locals_results =
675
+ let borrowed_locals =
676
676
MaybeBorrowedLocals . into_engine ( tcx, body) . pass_name ( "coroutine" ) . iterate_to_fixpoint ( ) ;
677
677
678
- let mut borrowed_locals_cursor = borrowed_locals_results. clone ( ) . into_results_cursor ( body) ;
679
-
680
- // Calculate the MIR locals that we actually need to keep storage around
681
- // for.
682
- let mut requires_storage_cursor = MaybeRequiresStorage :: new ( body, borrowed_locals_results)
678
+ // Calculate the MIR locals for which we need to keep storage around.
679
+ let mut requires_storage = MaybeRequiresStorage :: new ( body, borrowed_locals. clone ( ) )
683
680
. into_engine ( tcx, body)
684
681
. iterate_to_fixpoint ( )
685
682
. into_results_cursor ( body) ;
686
683
684
+ let mut borrowed_locals = borrowed_locals. into_results_cursor ( body) ;
685
+
687
686
// Calculate the liveness of MIR locals ignoring borrows.
688
687
let mut liveness = MaybeLiveLocals
689
688
. into_engine ( tcx, body)
@@ -715,8 +714,8 @@ fn locals_live_across_suspend_points<'tcx>(
715
714
// If a borrow is converted to a raw reference, we must also assume that it lives
716
715
// forever. Note that the final liveness is still bounded by the storage liveness
717
716
// of the local, which happens using the `intersect` operation below.
718
- borrowed_locals_cursor . seek_before_primary_effect ( loc) ;
719
- live_locals. union ( borrowed_locals_cursor . get ( ) ) ;
717
+ borrowed_locals . seek_before_primary_effect ( loc) ;
718
+ live_locals. union ( borrowed_locals . get ( ) ) ;
720
719
}
721
720
722
721
// Store the storage liveness for later use so we can restore the state
@@ -727,8 +726,8 @@ fn locals_live_across_suspend_points<'tcx>(
727
726
// Locals live are live at this point only if they are used across
728
727
// suspension points (the `liveness` variable)
729
728
// and their storage is required (the `storage_required` variable)
730
- requires_storage_cursor . seek_before_primary_effect ( loc) ;
731
- live_locals. intersect ( requires_storage_cursor . get ( ) ) ;
729
+ requires_storage . seek_before_primary_effect ( loc) ;
730
+ live_locals. intersect ( requires_storage . get ( ) ) ;
732
731
733
732
// The coroutine argument is ignored.
734
733
live_locals. remove ( SELF_ARG ) ;
@@ -758,7 +757,7 @@ fn locals_live_across_suspend_points<'tcx>(
758
757
body,
759
758
& saved_locals,
760
759
always_live_locals. clone ( ) ,
761
- requires_storage_cursor . into_results ( ) ,
760
+ requires_storage . into_results ( ) ,
762
761
) ;
763
762
764
763
LivenessInfo {
0 commit comments