Skip to content

Commit 5875bd2

Browse files
Use HirId from PlaceWithHirId rather than using the one provided to the function
1 parent 7e46217 commit 5875bd2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/needless_pass_by_ref_mut.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ impl<'tcx> euv::Delegate<'tcx> for MutablyUsedVariablesCtxt<'tcx> {
305305
}
306306
}
307307

308-
fn borrow(&mut self, cmt: &euv::PlaceWithHirId<'tcx>, id: HirId, borrow: ty::BorrowKind) {
308+
fn borrow(&mut self, cmt: &euv::PlaceWithHirId<'tcx>, _id: HirId, borrow: ty::BorrowKind) {
309309
self.prev_bind = None;
310310
if let euv::Place {
311311
base: euv::PlaceBase::Local(vid),
@@ -338,7 +338,7 @@ impl<'tcx> euv::Delegate<'tcx> for MutablyUsedVariablesCtxt<'tcx> {
338338
],
339339
),
340340
..
341-
}) = self.tcx.hir().get(id)
341+
}) = self.tcx.hir().get(cmt.hir_id)
342342
{
343343
self.async_closures.insert(*def_id);
344344
}

0 commit comments

Comments
 (0)