Skip to content

Commit

Permalink
Tweak MaybeBorrowedLocals::transfer_function usage.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nnethercote committed Nov 26, 2024
1 parent dae019d commit 1914dbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 1914dbe

Please sign in to comment.