diff --git a/compiler/rustc_mir_transform/src/ref_prop.rs b/compiler/rustc_mir_transform/src/ref_prop.rs index 368d5340ac34f..be9ad9e7eefde 100644 --- a/compiler/rustc_mir_transform/src/ref_prop.rs +++ b/compiler/rustc_mir_transform/src/ref_prop.rs @@ -79,6 +79,7 @@ impl<'tcx> crate::MirPass<'tcx> for ReferencePropagation { #[instrument(level = "trace", skip(self, tcx, body))] fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { debug!(def_id = ?body.source.def_id()); + move_to_copy_pointers(tcx, body); while propagate_ssa(tcx, body) {} } @@ -87,11 +88,38 @@ impl<'tcx> crate::MirPass<'tcx> for ReferencePropagation { } } +fn move_to_copy_pointers<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { + let mut visitor = MoveToCopyVisitor { tcx, local_decls: &body.local_decls }; + for (bb, data) in body.basic_blocks.as_mut_preserves_cfg().iter_enumerated_mut() { + visitor.visit_basic_block_data(bb, data); + } + + struct MoveToCopyVisitor<'a, 'tcx> { + tcx: TyCtxt<'tcx>, + local_decls: &'a IndexVec>, + } + + impl<'a, 'tcx> MutVisitor<'tcx> for MoveToCopyVisitor<'a, 'tcx> { + fn tcx(&self) -> TyCtxt<'tcx> { + self.tcx + } + + fn visit_operand(&mut self, operand: &mut Operand<'tcx>, loc: Location) { + if let Operand::Move(place) = *operand { + if place.ty(self.local_decls, self.tcx).ty.is_any_ptr() { + *operand = Operand::Copy(place); + } + } + self.super_operand(operand, loc); + } + } +} + fn propagate_ssa<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) -> bool { let typing_env = body.typing_env(tcx); let ssa = SsaLocals::new(tcx, body, typing_env); - let mut replacer = compute_replacement(tcx, body, &ssa); + let mut replacer = compute_replacement(tcx, body, ssa); debug!(?replacer.targets); debug!(?replacer.allowed_replacements); debug!(?replacer.storage_to_remove); @@ -119,7 +147,7 @@ enum Value<'tcx> { fn compute_replacement<'tcx>( tcx: TyCtxt<'tcx>, body: &Body<'tcx>, - ssa: &SsaLocals, + ssa: SsaLocals, ) -> Replacer<'tcx> { let always_live_locals = always_storage_live_locals(body); @@ -138,7 +166,7 @@ fn compute_replacement<'tcx>( // reborrowed references. let mut storage_to_remove = DenseBitSet::new_empty(body.local_decls.len()); - let fully_replacable_locals = fully_replacable_locals(ssa); + let fully_replacable_locals = fully_replacable_locals(&ssa); // Returns true iff we can use `place` as a pointee. // diff --git a/tests/mir-opt/building/index_array_and_slice.rs b/tests/mir-opt/building/index_array_and_slice.rs index f91b37567f79b..42ede66d92ba0 100644 --- a/tests/mir-opt/building/index_array_and_slice.rs +++ b/tests/mir-opt/building/index_array_and_slice.rs @@ -55,7 +55,7 @@ struct WithSliceTail(f64, [i32]); fn index_custom(custom: &WithSliceTail, index: usize) -> &i32 { // CHECK: bb0: // CHECK: [[PTR:_.+]] = &raw const (fake) ((*_1).1: [i32]); - // CHECK: [[LEN:_.+]] = PtrMetadata(move [[PTR]]); + // CHECK: [[LEN:_.+]] = PtrMetadata(copy [[PTR]]); // CHECK: [[LT:_.+]] = Lt(copy _2, copy [[LEN]]); // CHECK: assert(move [[LT]], "index out of bounds{{.+}}", move [[LEN]], copy _2) -> [success: bb1, diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff index 0c52f1e058367..df008ececae30 100644 --- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff @@ -46,7 +46,7 @@ StorageDead(_6); _4 = copy _5 as *mut [u8] (Transmute); StorageDead(_5); - _3 = move _4 as *mut u8 (PtrToPtr); + _3 = copy _4 as *mut u8 (PtrToPtr); StorageDead(_4); StorageDead(_3); - StorageDead(_1); diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir index d1b1e3d7dd73d..ebe8b23354be7 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir @@ -30,7 +30,7 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> { StorageDead(_3); StorageLive(_5); _5 = &mut (*_1)[_2]; - _0 = Option::<&mut u32>::Some(move _5); + _0 = Option::<&mut u32>::Some(copy _5); StorageDead(_5); goto -> bb3; } diff --git a/tests/mir-opt/reference_prop.debuginfo.ReferencePropagation.diff b/tests/mir-opt/reference_prop.debuginfo.ReferencePropagation.diff index 05ad9dbf3cccf..3da795b61f948 100644 --- a/tests/mir-opt/reference_prop.debuginfo.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.debuginfo.ReferencePropagation.diff @@ -99,7 +99,8 @@ _13 = &(*_26); StorageLive(_15); _15 = RangeFull; - _12 = <[i32; 10] as Index>::index(move _13, move _15) -> [return: bb5, unwind continue]; +- _12 = <[i32; 10] as Index>::index(move _13, move _15) -> [return: bb5, unwind continue]; ++ _12 = <[i32; 10] as Index>::index(copy _13, move _15) -> [return: bb5, unwind continue]; } bb5: { diff --git a/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff b/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff index 3c6a9a9614c32..0f90cc40a3d8b 100644 --- a/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff @@ -218,8 +218,9 @@ - StorageLive(_14); - _14 = &_11; - _13 = &(*_14); +- _12 = move _13; + _13 = &_11; - _12 = move _13; ++ _12 = copy _13; StorageDead(_13); - StorageDead(_14); StorageLive(_15); @@ -252,7 +253,8 @@ StorageLive(_23); StorageLive(_24); _24 = copy _21; - _23 = opaque::<&&usize>(move _24) -> [return: bb3, unwind continue]; +- _23 = opaque::<&&usize>(move _24) -> [return: bb3, unwind continue]; ++ _23 = opaque::<&&usize>(copy _24) -> [return: bb3, unwind continue]; } bb3: { @@ -276,7 +278,8 @@ StorageLive(_30); StorageLive(_31); _31 = copy _28; - _30 = opaque::<*mut &usize>(move _31) -> [return: bb4, unwind continue]; +- _30 = opaque::<*mut &usize>(move _31) -> [return: bb4, unwind continue]; ++ _30 = opaque::<*mut &usize>(copy _31) -> [return: bb4, unwind continue]; } bb4: { @@ -299,7 +302,8 @@ StorageLive(_36); StorageLive(_37); _37 = copy _34; - _36 = opaque::<&usize>(move _37) -> [return: bb5, unwind continue]; +- _36 = opaque::<&usize>(move _37) -> [return: bb5, unwind continue]; ++ _36 = opaque::<&usize>(copy _37) -> [return: bb5, unwind continue]; } bb5: { @@ -328,7 +332,8 @@ StorageLive(_45); StorageLive(_46); _46 = copy _44; - _45 = opaque::<&usize>(move _46) -> [return: bb6, unwind continue]; +- _45 = opaque::<&usize>(move _46) -> [return: bb6, unwind continue]; ++ _45 = opaque::<&usize>(copy _46) -> [return: bb6, unwind continue]; } bb6: { @@ -368,8 +373,9 @@ - StorageLive(_55); - _55 = &(*_1); - _54 = &(*_55); +- _2 = move _54; + _54 = &(*_1); - _2 = move _54; ++ _2 = copy _54; StorageDead(_54); - StorageDead(_55); StorageLive(_56); diff --git a/tests/mir-opt/reference_prop.reference_propagation_const_ptr.ReferencePropagation.diff b/tests/mir-opt/reference_prop.reference_propagation_const_ptr.ReferencePropagation.diff index 75fe99de93810..99ef07a212cf0 100644 --- a/tests/mir-opt/reference_prop.reference_propagation_const_ptr.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.reference_propagation_const_ptr.ReferencePropagation.diff @@ -233,7 +233,8 @@ _12 = &raw const _10; StorageLive(_13); _13 = &raw const _11; - _12 = move _13; +- _12 = move _13; ++ _12 = copy _13; StorageDead(_13); StorageLive(_14); _14 = copy (*_12); @@ -265,7 +266,8 @@ StorageLive(_22); StorageLive(_23); _23 = copy _20; - _22 = opaque::<&*const usize>(move _23) -> [return: bb3, unwind continue]; +- _22 = opaque::<&*const usize>(move _23) -> [return: bb3, unwind continue]; ++ _22 = opaque::<&*const usize>(copy _23) -> [return: bb3, unwind continue]; } bb3: { @@ -289,7 +291,8 @@ StorageLive(_29); StorageLive(_30); _30 = copy _27; - _29 = opaque::<*mut *const usize>(move _30) -> [return: bb4, unwind continue]; +- _29 = opaque::<*mut *const usize>(move _30) -> [return: bb4, unwind continue]; ++ _29 = opaque::<*mut *const usize>(copy _30) -> [return: bb4, unwind continue]; } bb4: { @@ -312,7 +315,8 @@ StorageLive(_35); StorageLive(_36); _36 = copy _33; - _35 = opaque::<*const usize>(move _36) -> [return: bb5, unwind continue]; +- _35 = opaque::<*const usize>(move _36) -> [return: bb5, unwind continue]; ++ _35 = opaque::<*const usize>(copy _36) -> [return: bb5, unwind continue]; } bb5: { @@ -341,7 +345,8 @@ StorageLive(_44); StorageLive(_45); _45 = copy _43; - _44 = opaque::<*const usize>(move _45) -> [return: bb6, unwind continue]; +- _44 = opaque::<*const usize>(move _45) -> [return: bb6, unwind continue]; ++ _44 = opaque::<*const usize>(copy _45) -> [return: bb6, unwind continue]; } bb6: { @@ -379,7 +384,8 @@ _52 = &raw const (*_2); StorageLive(_53); _53 = &raw const (*_1); - _2 = move _53; +- _2 = move _53; ++ _2 = copy _53; StorageDead(_53); StorageLive(_54); _54 = copy (*_52); diff --git a/tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff b/tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff index f35b4974d6eba..e2fab8a5f2e4d 100644 --- a/tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff @@ -218,8 +218,9 @@ - StorageLive(_14); - _14 = &mut _11; - _13 = &mut (*_14); +- _12 = move _13; + _13 = &mut _11; - _12 = move _13; ++ _12 = copy _13; StorageDead(_13); - StorageDead(_14); StorageLive(_15); @@ -251,7 +252,8 @@ StorageLive(_23); StorageLive(_24); _24 = copy _21; - _23 = opaque::<&&mut usize>(move _24) -> [return: bb3, unwind continue]; +- _23 = opaque::<&&mut usize>(move _24) -> [return: bb3, unwind continue]; ++ _23 = opaque::<&&mut usize>(copy _24) -> [return: bb3, unwind continue]; } bb3: { @@ -275,7 +277,8 @@ StorageLive(_30); StorageLive(_31); _31 = copy _28; - _30 = opaque::<*mut &mut usize>(move _31) -> [return: bb4, unwind continue]; +- _30 = opaque::<*mut &mut usize>(move _31) -> [return: bb4, unwind continue]; ++ _30 = opaque::<*mut &mut usize>(copy _31) -> [return: bb4, unwind continue]; } bb4: { @@ -296,8 +299,10 @@ _35 = copy (*_34); StorageLive(_36); StorageLive(_37); - _37 = move _34; - _36 = opaque::<&mut usize>(move _37) -> [return: bb5, unwind continue]; +- _37 = move _34; +- _36 = opaque::<&mut usize>(move _37) -> [return: bb5, unwind continue]; ++ _37 = copy _34; ++ _36 = opaque::<&mut usize>(copy _37) -> [return: bb5, unwind continue]; } bb5: { @@ -316,15 +321,19 @@ StorageLive(_41); _41 = copy (*_40); StorageLive(_42); - _42 = move _40; +- _42 = move _40; ++ _42 = copy _40; StorageLive(_43); _43 = copy (*_42); StorageLive(_44); - _44 = move _42; +- _44 = move _42; ++ _44 = copy _42; StorageLive(_45); StorageLive(_46); - _46 = move _44; - _45 = opaque::<&mut usize>(move _46) -> [return: bb6, unwind continue]; +- _46 = move _44; +- _45 = opaque::<&mut usize>(move _46) -> [return: bb6, unwind continue]; ++ _46 = copy _44; ++ _45 = opaque::<&mut usize>(copy _46) -> [return: bb6, unwind continue]; } bb6: { @@ -364,8 +373,9 @@ - StorageLive(_55); - _55 = &mut (*_1); - _54 = &mut (*_55); +- _2 = move _54; + _54 = &mut (*_1); - _2 = move _54; ++ _2 = copy _54; StorageDead(_54); - StorageDead(_55); StorageLive(_56); diff --git a/tests/mir-opt/reference_prop.reference_propagation_mut_ptr.ReferencePropagation.diff b/tests/mir-opt/reference_prop.reference_propagation_mut_ptr.ReferencePropagation.diff index 21b322b721876..c49254ee6c652 100644 --- a/tests/mir-opt/reference_prop.reference_propagation_mut_ptr.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.reference_propagation_mut_ptr.ReferencePropagation.diff @@ -214,7 +214,8 @@ _12 = &raw mut _10; StorageLive(_13); _13 = &raw mut _11; - _12 = move _13; +- _12 = move _13; ++ _12 = copy _13; StorageDead(_13); StorageLive(_14); _14 = copy (*_12); @@ -245,7 +246,8 @@ StorageLive(_22); StorageLive(_23); _23 = copy _20; - _22 = opaque::<&*mut usize>(move _23) -> [return: bb3, unwind continue]; +- _22 = opaque::<&*mut usize>(move _23) -> [return: bb3, unwind continue]; ++ _22 = opaque::<&*mut usize>(copy _23) -> [return: bb3, unwind continue]; } bb3: { @@ -269,7 +271,8 @@ StorageLive(_29); StorageLive(_30); _30 = copy _27; - _29 = opaque::<*mut *mut usize>(move _30) -> [return: bb4, unwind continue]; +- _29 = opaque::<*mut *mut usize>(move _30) -> [return: bb4, unwind continue]; ++ _29 = opaque::<*mut *mut usize>(copy _30) -> [return: bb4, unwind continue]; } bb4: { @@ -291,7 +294,8 @@ StorageLive(_35); StorageLive(_36); _36 = copy _33; - _35 = opaque::<*mut usize>(move _36) -> [return: bb5, unwind continue]; +- _35 = opaque::<*mut usize>(move _36) -> [return: bb5, unwind continue]; ++ _35 = opaque::<*mut usize>(copy _36) -> [return: bb5, unwind continue]; } bb5: { @@ -318,7 +322,8 @@ StorageLive(_44); StorageLive(_45); _45 = copy _43; - _44 = opaque::<*mut usize>(move _45) -> [return: bb6, unwind continue]; +- _44 = opaque::<*mut usize>(move _45) -> [return: bb6, unwind continue]; ++ _44 = opaque::<*mut usize>(copy _45) -> [return: bb6, unwind continue]; } bb6: { @@ -356,7 +361,8 @@ _52 = &raw mut (*_2); StorageLive(_53); _53 = &raw mut (*_1); - _2 = move _53; +- _2 = move _53; ++ _2 = copy _53; StorageDead(_53); StorageLive(_54); _54 = copy (*_52); diff --git a/tests/mir-opt/reference_prop.rs b/tests/mir-opt/reference_prop.rs index 00d4893807163..c4b63b6313c23 100644 --- a/tests/mir-opt/reference_prop.rs +++ b/tests/mir-opt/reference_prop.rs @@ -30,7 +30,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { // CHECK: [[a2:_.*]] = const 7_usize; // CHECK: [[b:_.*]] = &[[a]]; // CHECK: [[btmp:_.*]] = &[[a2]]; - // CHECK: [[b]] = move [[btmp]]; + // CHECK: [[b]] = copy [[btmp]]; // CHECK: [[c:_.*]] = copy (*[[b]]); let a = 5_usize; @@ -122,7 +122,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { // CHECK: bb7: { // CHECK: [[a:_.*]] = &(*_2); // CHECK: [[tmp:_.*]] = &(*_1); - // CHECK: _2 = move [[tmp]]; + // CHECK: _2 = copy [[tmp]]; // CHECK: [[b:_.*]] = copy (*[[a]]); let a = &*multiple; @@ -186,7 +186,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: [[a2:_.*]] = const 7_usize; // CHECK: [[b:_.*]] = &mut [[a]]; // CHECK: [[btmp:_.*]] = &mut [[a2]]; - // CHECK: [[b]] = move [[btmp]]; + // CHECK: [[b]] = copy [[btmp]]; // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; @@ -247,9 +247,9 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: [[a:_.*]] = const 7_usize; // CHECK: [[b1:_.*]] = &mut [[a]]; // CHECK: [[c:_.*]] = copy (*[[b1]]); - // CHECK: [[b2:_.*]] = move [[b1]]; + // CHECK: [[b2:_.*]] = copy [[b1]]; // CHECK: [[c2:_.*]] = copy (*[[b2]]); - // CHECK: [[b3:_.*]] = move [[b2]]; + // CHECK: [[b3:_.*]] = copy [[b2]]; let mut a = 7_usize; let b1 = &mut a; @@ -278,7 +278,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: bb7: { // CHECK: [[a:_.*]] = &mut (*_2); // CHECK: [[tmp:_.*]] = &mut (*_1); - // CHECK: _2 = move [[tmp]]; + // CHECK: _2 = copy [[tmp]]; // CHECK: [[b:_.*]] = copy (*[[a]]); let a = &mut *multiple; @@ -343,7 +343,7 @@ fn reference_propagation_const_ptr(single: *const T, mut multiple: *con // CHECK: [[a2:_.*]] = const 7_usize; // CHECK: [[b:_.*]] = &raw const [[a]]; // CHECK: [[btmp:_.*]] = &raw const [[a2]]; - // CHECK: [[b]] = move [[btmp]]; + // CHECK: [[b]] = copy [[btmp]]; // CHECK: [[c:_.*]] = copy (*[[b]]); let a = 5_usize; @@ -435,7 +435,7 @@ fn reference_propagation_const_ptr(single: *const T, mut multiple: *con // CHECK: bb7: { // CHECK: [[a:_.*]] = &raw const (*_2); // CHECK: [[tmp:_.*]] = &raw const (*_1); - // CHECK: _2 = move [[tmp]]; + // CHECK: _2 = copy [[tmp]]; // CHECK: [[b:_.*]] = copy (*[[a]]); let a = &raw const *multiple; @@ -514,7 +514,7 @@ fn reference_propagation_mut_ptr(single: *mut T, mut multiple: *mut T) // CHECK: [[a2:_.*]] = const 7_usize; // CHECK: [[b:_.*]] = &raw mut [[a]]; // CHECK: [[btmp:_.*]] = &raw mut [[a2]]; - // CHECK: [[b]] = move [[btmp]]; + // CHECK: [[b]] = copy [[btmp]]; // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; @@ -606,7 +606,7 @@ fn reference_propagation_mut_ptr(single: *mut T, mut multiple: *mut T) // CHECK: bb7: { // CHECK: [[a:_.*]] = &raw mut (*_2); // CHECK: [[tmp:_.*]] = &raw mut (*_1); - // CHECK: _2 = move [[tmp]]; + // CHECK: _2 = copy [[tmp]]; // CHECK: [[b:_.*]] = copy (*[[a]]); let a = &raw mut *multiple; diff --git a/tests/mir-opt/reference_prop_do_not_reuse_move.rs b/tests/mir-opt/reference_prop_do_not_reuse_move.rs new file mode 100644 index 0000000000000..8859d30aed194 --- /dev/null +++ b/tests/mir-opt/reference_prop_do_not_reuse_move.rs @@ -0,0 +1,44 @@ +//@ test-mir-pass: ReferencePropagation + +#![feature(custom_mir, core_intrinsics)] +#![allow(internal_features)] +#![crate_type = "lib"] + +use std::intrinsics::mir::*; + +#[inline(never)] +fn opaque(_: impl Sized, _: impl Sized) {} + +#[custom_mir(dialect = "runtime")] +pub fn fn0() { + // CHECK-LABEL: fn0 + // CHECK: _9 = opaque::<&u8, &u64>(copy (_2.1: &u8), copy _6) -> [return: bb1, unwind unreachable]; + mir! { + let _1: (u8, u8); + let _2: (u64, &u8); + let _3: (u8, &&u64); + let _4: u64; + let _5: &u64; + let _6: &u64; + let _7: &u64; + let _8: u64; + let n: (); + { + _3.0 = 0; + _1 = (0, _3.0); + _4 = 0; + _2.1 = &_1.0; + _8 = 0; + _5 = &_8; + _5 = &_4; + _6 = _5; + _7 = _6; + _3.1 = &_6; + Call(n = opaque(_2.1, Move(_6)), ReturnTo(bb1), UnwindUnreachable()) + } + bb1 = { + _2.0 = *_7; + Return() + } + } +} diff --git a/tests/mir-opt/uninhabited_not_read.main.SimplifyLocals-final.after.mir b/tests/mir-opt/uninhabited_not_read.main.SimplifyLocals-final.after.mir index 6bf4be652bef3..89f4cbc2edea5 100644 --- a/tests/mir-opt/uninhabited_not_read.main.SimplifyLocals-final.after.mir +++ b/tests/mir-opt/uninhabited_not_read.main.SimplifyLocals-final.after.mir @@ -31,7 +31,7 @@ fn main() -> () { StorageLive(_2); StorageLive(_3); _3 = &raw const _1; - _2 = move _3 as *const ! (PtrToPtr); + _2 = copy _3 as *const ! (PtrToPtr); StorageDead(_3); StorageDead(_2); StorageDead(_1); @@ -40,7 +40,7 @@ fn main() -> () { StorageLive(_5); StorageLive(_6); _6 = &raw const _4; - _5 = move _6 as *const ! (PtrToPtr); + _5 = copy _6 as *const ! (PtrToPtr); StorageDead(_6); StorageDead(_5); StorageDead(_4);