Remove self
param for MaybeBorrowedLocals::transfer_function
.
It is unnecessary.
This commit is contained in:
parent
7e704afc2d
commit
dae019dc9d
2 changed files with 4 additions and 7 deletions
|
@ -15,7 +15,7 @@ use crate::{Analysis, GenKill};
|
||||||
pub struct MaybeBorrowedLocals;
|
pub struct MaybeBorrowedLocals;
|
||||||
|
|
||||||
impl 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 }
|
TransferFunction { trans }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ impl<'tcx> Analysis<'tcx> for MaybeBorrowedLocals {
|
||||||
statement: &Statement<'tcx>,
|
statement: &Statement<'tcx>,
|
||||||
location: Location,
|
location: Location,
|
||||||
) {
|
) {
|
||||||
self.transfer_function(trans).visit_statement(statement, location);
|
Self::transfer_function(trans).visit_statement(statement, location);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn apply_terminator_effect<'mir>(
|
fn apply_terminator_effect<'mir>(
|
||||||
|
@ -48,7 +48,7 @@ impl<'tcx> Analysis<'tcx> for MaybeBorrowedLocals {
|
||||||
terminator: &'mir Terminator<'tcx>,
|
terminator: &'mir Terminator<'tcx>,
|
||||||
location: Location,
|
location: Location,
|
||||||
) -> TerminatorEdges<'mir, 'tcx> {
|
) -> TerminatorEdges<'mir, 'tcx> {
|
||||||
self.transfer_function(trans).visit_terminator(terminator, location);
|
Self::transfer_function(trans).visit_terminator(terminator, location);
|
||||||
terminator.edges()
|
terminator.edges()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,10 +180,7 @@ impl<'tcx> Analysis<'tcx> for MaybeRequiresStorage<'_, 'tcx> {
|
||||||
loc: Location,
|
loc: Location,
|
||||||
) {
|
) {
|
||||||
// If a place is borrowed in a terminator, it needs storage for that terminator.
|
// If a place is borrowed in a terminator, it needs storage for that terminator.
|
||||||
self.borrowed_locals
|
MaybeBorrowedLocals::transfer_function(trans).visit_terminator(terminator, loc);
|
||||||
.mut_analysis()
|
|
||||||
.transfer_function(trans)
|
|
||||||
.visit_terminator(terminator, loc);
|
|
||||||
|
|
||||||
match &terminator.kind {
|
match &terminator.kind {
|
||||||
TerminatorKind::Call { destination, .. } => {
|
TerminatorKind::Call { destination, .. } => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue