diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-11-23 17:59:54 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-11-27 10:35:43 +1100 |
| commit | 3dea72aa1bf0ed5e5ccd36e8ee6c1c97976e5d25 (patch) | |
| tree | 50c1c7dc21685a950d8246ce1c48efc3f3d08f01 | |
| parent | d957c4718377b8cb0dacc58cdbaa5a3fe82c53cc (diff) | |
| download | rust-3dea72aa1bf0ed5e5ccd36e8ee6c1c97976e5d25.tar.gz rust-3dea72aa1bf0ed5e5ccd36e8ee6c1c97976e5d25.zip | |
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.
| -rw-r--r-- | compiler/rustc_mir_transform/src/coroutine.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_mir_transform/src/coroutine.rs b/compiler/rustc_mir_transform/src/coroutine.rs index 1cb1a9886a0..8d9555c63cf 100644 --- a/compiler/rustc_mir_transform/src/coroutine.rs +++ b/compiler/rustc_mir_transform/src/coroutine.rs @@ -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 { |
