Skip to content

Commit

Permalink
Remove self param for MaybeBorrowedLocals::transfer_function.
Browse files Browse the repository at this point in the history
It is unnecessary.
  • Loading branch information
nnethercote committed Nov 26, 2024
1 parent 7e704af commit dae019d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_mir_dataflow/src/impls/borrowed_locals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::{Analysis, GenKill};
pub struct MaybeBorrowedLocals;

impl MaybeBorrowedLocals {
pub(super) fn transfer_function<'a, T>(&'a self, trans: &'a mut T) -> TransferFunction<'a, T> {
pub(super) fn transfer_function<'a, T>(trans: &'a mut T) -> TransferFunction<'a, T> {
TransferFunction { trans }
}
}
Expand All @@ -39,7 +39,7 @@ impl<'tcx> Analysis<'tcx> for MaybeBorrowedLocals {
statement: &Statement<'tcx>,
location: Location,
) {
self.transfer_function(trans).visit_statement(statement, location);
Self::transfer_function(trans).visit_statement(statement, location);
}

fn apply_terminator_effect<'mir>(
Expand All @@ -48,7 +48,7 @@ impl<'tcx> Analysis<'tcx> for MaybeBorrowedLocals {
terminator: &'mir Terminator<'tcx>,
location: Location,
) -> TerminatorEdges<'mir, 'tcx> {
self.transfer_function(trans).visit_terminator(terminator, location);
Self::transfer_function(trans).visit_terminator(terminator, location);
terminator.edges()
}
}
Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,7 @@ impl<'tcx> Analysis<'tcx> for MaybeRequiresStorage<'_, 'tcx> {
loc: Location,
) {
// If a place is borrowed in a terminator, it needs storage for that terminator.
self.borrowed_locals
.mut_analysis()
.transfer_function(trans)
.visit_terminator(terminator, loc);
MaybeBorrowedLocals::transfer_function(trans).visit_terminator(terminator, loc);

match &terminator.kind {
TerminatorKind::Call { destination, .. } => {
Expand Down

0 comments on commit dae019d

Please sign in to comment.