Skip to content

Commit 943a380

Browse files
committed
Elide storage markers when elaborating box derefs
1 parent 38528d4 commit 943a380

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

compiler/rustc_mir_transform/src/elaborate_box_derefs.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ impl<'tcx, 'a> MutVisitor<'tcx> for ElaborateBoxDerefVisitor<'tcx, 'a> {
6969
let (unique_ty, nonnull_ty, ptr_ty) =
7070
build_ptr_tys(tcx, base_ty.boxed_ty(), self.unique_did, self.nonnull_did);
7171

72-
let ptr_local = self.patch.new_temp(ptr_ty, source_info.span);
73-
74-
self.patch.add_statement(location, StatementKind::StorageLive(ptr_local));
72+
let ptr_local = self.patch.new_internal(ptr_ty, source_info.span);
7573

7674
self.patch.add_assign(
7775
location,
@@ -83,11 +81,6 @@ impl<'tcx, 'a> MutVisitor<'tcx> for ElaborateBoxDerefVisitor<'tcx, 'a> {
8381
);
8482

8583
place.local = ptr_local;
86-
87-
self.patch.add_statement(
88-
Location { block: location.block, statement_index: location.statement_index + 1 },
89-
StatementKind::StorageDead(ptr_local),
90-
);
9184
}
9285

9386
self.super_place(place, context, location);

0 commit comments

Comments
 (0)