Skip to content

Commit dae019d

Browse files
committed
Remove self param for MaybeBorrowedLocals::transfer_function.
It is unnecessary.
1 parent 7e704af commit dae019d

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

compiler/rustc_mir_dataflow/src/impls/borrowed_locals.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::{Analysis, GenKill};
1515
pub struct MaybeBorrowedLocals;
1616

1717
impl MaybeBorrowedLocals {
18-
pub(super) fn transfer_function<'a, T>(&'a self, trans: &'a mut T) -> TransferFunction<'a, T> {
18+
pub(super) fn transfer_function<'a, T>(trans: &'a mut T) -> TransferFunction<'a, T> {
1919
TransferFunction { trans }
2020
}
2121
}
@@ -39,7 +39,7 @@ impl<'tcx> Analysis<'tcx> for MaybeBorrowedLocals {
3939
statement: &Statement<'tcx>,
4040
location: Location,
4141
) {
42-
self.transfer_function(trans).visit_statement(statement, location);
42+
Self::transfer_function(trans).visit_statement(statement, location);
4343
}
4444

4545
fn apply_terminator_effect<'mir>(
@@ -48,7 +48,7 @@ impl<'tcx> Analysis<'tcx> for MaybeBorrowedLocals {
4848
terminator: &'mir Terminator<'tcx>,
4949
location: Location,
5050
) -> TerminatorEdges<'mir, 'tcx> {
51-
self.transfer_function(trans).visit_terminator(terminator, location);
51+
Self::transfer_function(trans).visit_terminator(terminator, location);
5252
terminator.edges()
5353
}
5454
}

compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,7 @@ impl<'tcx> Analysis<'tcx> for MaybeRequiresStorage<'_, 'tcx> {
180180
loc: Location,
181181
) {
182182
// If a place is borrowed in a terminator, it needs storage for that terminator.
183-
self.borrowed_locals
184-
.mut_analysis()
185-
.transfer_function(trans)
186-
.visit_terminator(terminator, loc);
183+
MaybeBorrowedLocals::transfer_function(trans).visit_terminator(terminator, loc);
187184

188185
match &terminator.kind {
189186
TerminatorKind::Call { destination, .. } => {

0 commit comments

Comments
 (0)