consider copy_deref a possible borrower

This commit is contained in:
y21 2024-05-02 23:32:53 +02:00
parent 68dbc84ec4
commit dff9164ac5

View File

@ -69,7 +69,7 @@ impl<'a, 'b, 'tcx> mir::visit::Visitor<'tcx> for PossibleBorrowerVisitor<'a, 'b,
fn visit_assign(&mut self, place: &mir::Place<'tcx>, rvalue: &mir::Rvalue<'_>, _location: mir::Location) { fn visit_assign(&mut self, place: &mir::Place<'tcx>, rvalue: &mir::Rvalue<'_>, _location: mir::Location) {
let lhs = place.local; let lhs = place.local;
match rvalue { match rvalue {
mir::Rvalue::Ref(_, _, borrowed) => { mir::Rvalue::Ref(_, _, borrowed) | mir::Rvalue::CopyForDeref(borrowed) => {
self.possible_borrower.add(borrowed.local, lhs); self.possible_borrower.add(borrowed.local, lhs);
}, },
other => { other => {