about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2023-08-17 17:45:17 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2023-08-17 17:45:17 +0200
commit5875bd2b5f2b593d708459111bff42ba4535cebc (patch)
tree0ead5056e0a8708d69e37b9816eb1f9ee15c578a
parent7e4621736224c07d80a43e771dd0e115676880f8 (diff)
downloadrust-5875bd2b5f2b593d708459111bff42ba4535cebc.tar.gz
rust-5875bd2b5f2b593d708459111bff42ba4535cebc.zip
Use `HirId` from `PlaceWithHirId` rather than using the one provided to the function
-rw-r--r--clippy_lints/src/needless_pass_by_ref_mut.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/needless_pass_by_ref_mut.rs b/clippy_lints/src/needless_pass_by_ref_mut.rs
index 6eb17d675e9..7b00eabf97b 100644
--- a/clippy_lints/src/needless_pass_by_ref_mut.rs
+++ b/clippy_lints/src/needless_pass_by_ref_mut.rs
@@ -305,7 +305,7 @@ impl<'tcx> euv::Delegate<'tcx> for MutablyUsedVariablesCtxt<'tcx> {
         }
     }
 
-    fn borrow(&mut self, cmt: &euv::PlaceWithHirId<'tcx>, id: HirId, borrow: ty::BorrowKind) {
+    fn borrow(&mut self, cmt: &euv::PlaceWithHirId<'tcx>, _id: HirId, borrow: ty::BorrowKind) {
         self.prev_bind = None;
         if let euv::Place {
             base: euv::PlaceBase::Local(vid),
@@ -338,7 +338,7 @@ impl<'tcx> euv::Delegate<'tcx> for MutablyUsedVariablesCtxt<'tcx> {
                         ],
                     ),
                 ..
-            }) = self.tcx.hir().get(id)
+            }) = self.tcx.hir().get(cmt.hir_id)
             {
                 self.async_closures.insert(*def_id);
             }