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.
This commit is contained in:
Nicholas Nethercote 2023-11-23 17:59:54 +11:00
parent d957c47183
commit 3dea72aa1b

View File

@ -684,11 +684,11 @@ fn locals_live_across_suspend_points<'tcx>(
// Calculate the MIR locals that we actually need to keep storage around
// for.
let mut requires_storage_results =
let mut requires_storage_cursor =
MaybeRequiresStorage::new(borrowed_locals_results.cloned_results_cursor(body))
.into_engine(tcx, body)
.iterate_to_fixpoint();
let mut requires_storage_cursor = requires_storage_results.as_results_cursor(body);
.iterate_to_fixpoint()
.into_results_cursor(body);
// Calculate the liveness of MIR locals ignoring borrows.
let mut liveness = MaybeLiveLocals
@ -764,7 +764,7 @@ fn locals_live_across_suspend_points<'tcx>(
body,
&saved_locals,
always_live_locals.clone(),
requires_storage_results,
requires_storage_cursor.into_results(),
);
LivenessInfo {