1
Fork 0

Rollup merge of #105659 - JakobDegen:storage-live-borrow, r=davidtwco

Don't require owned data in `MaybeStorageLive`

Small improvement that avoids a clone. I don't expect this to have any noticeable perf effects, but better to have it than not to.

r? ``@tmiasko``
This commit is contained in:
Matthias Krüger 2022-12-13 19:57:12 +01:00 committed by GitHub
commit e0e9f3a7b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 9 deletions

View file

@ -490,7 +490,7 @@ fn locals_live_across_suspend_points<'tcx>(
// Calculate when MIR locals have live storage. This gives us an upper bound of their
// lifetimes.
let mut storage_live = MaybeStorageLive::new(always_live_locals.clone())
let mut storage_live = MaybeStorageLive::new(std::borrow::Cow::Borrowed(always_live_locals))
.into_engine(tcx, body_ref)
.iterate_to_fixpoint()
.into_results_cursor(body_ref);