Skip to content

Commit

Permalink
consider copy_deref a possible borrower
Browse files Browse the repository at this point in the history
  • Loading branch information
y21 committed May 9, 2024
1 parent 68dbc84 commit dff9164
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clippy_utils/src/mir/possible_borrower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
let lhs = place.local;
match rvalue {
mir::Rvalue::Ref(_, _, borrowed) => {
mir::Rvalue::Ref(_, _, borrowed) | mir::Rvalue::CopyForDeref(borrowed) => {
self.possible_borrower.add(borrowed.local, lhs);
},
other => {
Expand Down

0 comments on commit dff9164

Please sign in to comment.