diff options
Diffstat (limited to 'compiler/rustc_mir_build/src/build/matches/mod.rs')
-rw-r--r-- | compiler/rustc_mir_build/src/build/matches/mod.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/rustc_mir_build/src/build/matches/mod.rs b/compiler/rustc_mir_build/src/build/matches/mod.rs index 0961ce11e..de2851a1a 100644 --- a/compiler/rustc_mir_build/src/build/matches/mod.rs +++ b/compiler/rustc_mir_build/src/build/matches/mod.rs @@ -1206,7 +1206,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { fake_borrows.insert(Place { local: source.local, - projection: self.tcx.intern_place_elems(proj_base), + projection: self.tcx.mk_place_elems(proj_base), }); } } @@ -1743,12 +1743,14 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { .map(|matched_place_ref| { let matched_place = Place { local: matched_place_ref.local, - projection: tcx.intern_place_elems(matched_place_ref.projection), + projection: tcx.mk_place_elems(matched_place_ref.projection), }; let fake_borrow_deref_ty = matched_place.ty(&self.local_decls, tcx).ty; let fake_borrow_ty = tcx.mk_imm_ref(tcx.lifetimes.re_erased, fake_borrow_deref_ty); - let fake_borrow_temp = - self.local_decls.push(LocalDecl::new(fake_borrow_ty, temp_span)); + let mut fake_borrow_temp = LocalDecl::new(fake_borrow_ty, temp_span); + fake_borrow_temp.internal = self.local_decls[matched_place.local].internal; + fake_borrow_temp.local_info = Some(Box::new(LocalInfo::FakeBorrow)); + let fake_borrow_temp = self.local_decls.push(fake_borrow_temp); (matched_place, fake_borrow_temp) }) |