1
Fork 0

Tweak MaybeBorrowedLocals::transfer_function usage.

In `MaybeRequiresStorage::apply_before_statement_effect`, call
`transfer_function` directly, as is already done in
`MaybeRequiresStorage::apply_before_terminator_effect`. This makes it clear
that the operation doesn't rely on the `MaybeBorrowedLocals` results.
This commit is contained in:
Nicholas Nethercote 2024-11-18 15:54:50 +11:00
parent dae019dc9d
commit 1914dbe694

View file

@ -135,7 +135,7 @@ impl<'tcx> Analysis<'tcx> for MaybeRequiresStorage<'_, 'tcx> {
loc: Location,
) {
// If a place is borrowed in a statement, it needs storage for that statement.
self.borrowed_locals.mut_analysis().apply_statement_effect(trans, stmt, loc);
MaybeBorrowedLocals::transfer_function(trans).visit_statement(stmt, loc);
match &stmt.kind {
StatementKind::StorageDead(l) => trans.kill(*l),