1
Fork 0

Remove uses of ResultsClonedCursor.

By just cloning the entire `Results` in the one place where
`ResultsClonedCursor` was used. This is extra allocations but the
performance effect is negligible.
This commit is contained in:
Nicholas Nethercote 2023-11-24 11:14:00 +11:00
parent 5f5263bfc8
commit 500e55ba8c
4 changed files with 17 additions and 17 deletions

View file

@ -680,12 +680,12 @@ fn locals_live_across_suspend_points<'tcx>(
let borrowed_locals_results =
MaybeBorrowedLocals.into_engine(tcx, body).pass_name("coroutine").iterate_to_fixpoint();
let mut borrowed_locals_cursor = borrowed_locals_results.cloned_results_cursor(body);
let mut borrowed_locals_cursor = borrowed_locals_results.clone().into_results_cursor(body);
// Calculate the MIR locals that we actually need to keep storage around
// for.
let mut requires_storage_cursor =
MaybeRequiresStorage::new(borrowed_locals_results.cloned_results_cursor(body))
MaybeRequiresStorage::new(borrowed_locals_results.into_results_cursor(body))
.into_engine(tcx, body)
.iterate_to_fixpoint()
.into_results_cursor(body);
@ -829,7 +829,7 @@ fn compute_storage_conflicts<'mir, 'tcx>(
body: &'mir Body<'tcx>,
saved_locals: &CoroutineSavedLocals,
always_live_locals: BitSet<Local>,
mut requires_storage: rustc_mir_dataflow::Results<'tcx, MaybeRequiresStorage<'_, 'mir, 'tcx>>,
mut requires_storage: rustc_mir_dataflow::Results<'tcx, MaybeRequiresStorage<'mir, 'tcx>>,
) -> BitMatrix<CoroutineSavedLocal, CoroutineSavedLocal> {
assert_eq!(body.local_decls.len(), saved_locals.domain_size());