about summary refs log tree commit diff
diff options
context:
space:
mode:
authory21 <30553356+y21@users.noreply.github.com>2024-05-02 23:32:53 +0200
committery21 <30553356+y21@users.noreply.github.com>2024-05-10 00:33:29 +0200
commitdff9164ac5a0118e78285869c16f35447b720354 (patch)
tree79845ef27e1d470bf680b53f6209d35dce2a3d4e
parent68dbc84ec49ef9a2d3f34973ec7a6c5e8cfa26e7 (diff)
downloadrust-dff9164ac5a0118e78285869c16f35447b720354.tar.gz
rust-dff9164ac5a0118e78285869c16f35447b720354.zip
consider `copy_deref` a possible borrower
-rw-r--r--clippy_utils/src/mir/possible_borrower.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_utils/src/mir/possible_borrower.rs b/clippy_utils/src/mir/possible_borrower.rs
index 06229ac938f..b3210fa155c 100644
--- a/clippy_utils/src/mir/possible_borrower.rs
+++ b/clippy_utils/src/mir/possible_borrower.rs
@@ -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 => {