Files
rust/compiler/rustc_mir_transform
Jacob Pratt 108fa3e080 Rollup merge of #160055 - nnethercote:simplify-MaybeRequiresStorage, r=cjgillot
Simplify `MaybeRequiresStorage`

It currently contains a `MaybeBorrowedLocals` cursor. The cursor is within a `RefCell` because cursor traversal requires mutation. The cursor is used in the `MaybeRequiresStorage::check_for_move` operation.

Instead of using this cursor within `MaybeRequiresStorage` it's possible to do a pre-traversal of `MaybeBorrowedLocals` to extract the necessary information and then give that (immutably) to `MaybeRequiresStorage`.

This commit makes that change. The extracted information is in the new `KillableLocals` type, which is computed by the `KillableLocalsVisitor` type within `MaybeRequiresStorage::new`. `MaybeRequiresStorage` no longer needs lifetimes. `MoveVisitor` is no longer needed. And the complicated `locals_live_across_suspend_points` gets a little simpler.

r? @cjgillot
2026-07-28 20:09:35 -04:00
..
2026-06-24 23:18:10 +01:00