diff --git a/src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs b/src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs index 3b4a853aa21c..f49ddbced2ef 100644 --- a/src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs +++ b/src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs @@ -699,7 +699,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { let root_place_projection = self.infcx.tcx.intern_place_elems(root_place.projection); if self.access_place_error_reported.contains(&( - Place { local: *root_place.local, projection: root_place_projection }, + Place { local: root_place.local, projection: root_place_projection }, borrow_span, )) { debug!( @@ -710,7 +710,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { } self.access_place_error_reported.insert(( - Place { local: *root_place.local, projection: root_place_projection }, + Place { local: root_place.local, projection: root_place_projection }, borrow_span, )); diff --git a/src/librustc_mir_build/build/matches/mod.rs b/src/librustc_mir_build/build/matches/mod.rs index 0b0e6f33bd74..ad55a9fb7b81 100644 --- a/src/librustc_mir_build/build/matches/mod.rs +++ b/src/librustc_mir_build/build/matches/mod.rs @@ -1258,7 +1258,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { .into_iter() .map(|matched_place_ref| { let matched_place = Place { - local: *matched_place_ref.local, + local: matched_place_ref.local, projection: tcx.intern_place_elems(matched_place_ref.projection), }; let fake_borrow_deref_ty = matched_place.ty(&self.local_decls, tcx).ty;