Skip to content

Commit 85801f5

Browse files
committed
fixed fp caused by moving &mut reference inside of a closure
1 parent ddbe110 commit 85801f5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

clippy_lints/src/needless_pass_by_ref_mut.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,12 @@ impl<'tcx> euv::Delegate<'tcx> for MutablyUsedVariablesCtxt<'tcx> {
336336
fn borrow(&mut self, cmt: &euv::PlaceWithHirId<'tcx>, _id: HirId, borrow: ty::BorrowKind) {
337337
self.prev_bind = None;
338338
if let euv::Place {
339-
base: euv::PlaceBase::Local(vid),
339+
base:
340+
euv::PlaceBase::Local(vid)
341+
| euv::PlaceBase::Upvar(UpvarId {
342+
var_path: UpvarPath { hir_id: vid },
343+
..
344+
}),
340345
base_ty,
341346
..
342347
} = &cmt.place

0 commit comments

Comments
 (0)