Skip to content

Commit 3dea72a

Browse files
committed
Remove one use of as_results_cursor.
It's currently used because `requires_storage_results` is used in two locations: once with a cursor, and once later on without a cursor. The non-consuming `as_results_cursor` is used for the first location. But we can instead use the consuming `into_results_cursor` and then use `into_results` to extract the `Results` from the finished-with cursor for use at the second location.
1 parent d957c47 commit 3dea72a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/rustc_mir_transform/src/coroutine.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -684,11 +684,11 @@ fn locals_live_across_suspend_points<'tcx>(
684684

685685
// Calculate the MIR locals that we actually need to keep storage around
686686
// for.
687-
let mut requires_storage_results =
687+
let mut requires_storage_cursor =
688688
MaybeRequiresStorage::new(borrowed_locals_results.cloned_results_cursor(body))
689689
.into_engine(tcx, body)
690-
.iterate_to_fixpoint();
691-
let mut requires_storage_cursor = requires_storage_results.as_results_cursor(body);
690+
.iterate_to_fixpoint()
691+
.into_results_cursor(body);
692692

693693
// Calculate the liveness of MIR locals ignoring borrows.
694694
let mut liveness = MaybeLiveLocals
@@ -764,7 +764,7 @@ fn locals_live_across_suspend_points<'tcx>(
764764
body,
765765
&saved_locals,
766766
always_live_locals.clone(),
767-
requires_storage_results,
767+
requires_storage_cursor.into_results(),
768768
);
769769

770770
LivenessInfo {

0 commit comments

Comments
 (0)