From 32185decd6875d5a86374043c7cfa77682b98ba3 Mon Sep 17 00:00:00 2001 From: RayMuir Date: Fri, 15 Mar 2024 14:21:29 +0000 Subject: [PATCH 1/4] Added "copy" to Debug fmt for copy operands --- compiler/rustc_middle/src/mir/pretty.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_middle/src/mir/pretty.rs b/compiler/rustc_middle/src/mir/pretty.rs index 5dd0e69cf1fe6..76a25e45cdedc 100644 --- a/compiler/rustc_middle/src/mir/pretty.rs +++ b/compiler/rustc_middle/src/mir/pretty.rs @@ -1159,7 +1159,7 @@ impl<'tcx> Debug for Operand<'tcx> { use self::Operand::*; match *self { Constant(ref a) => write!(fmt, "{a:?}"), - Copy(ref place) => write!(fmt, "{place:?}"), + Copy(ref place) => write!(fmt, "copy {place:?}"), Move(ref place) => write!(fmt, "move {place:?}"), } } From 249a36ffbd577fc76153b7ad4cafd33607ee4ddc Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Sun, 18 Aug 2024 15:51:53 -0700 Subject: [PATCH 2/4] Update mir-opt filechecks --- tests/mir-opt/array_index_is_temporary.rs | 2 +- tests/mir-opt/box_expr.rs | 2 +- .../mir-opt/building/match/sort_candidates.rs | 2 +- tests/mir-opt/building/while_storage.rs | 4 +- tests/mir-opt/const_prop/address_of_pair.rs | 4 +- .../bad_op_unsafe_oob_for_slices.rs | 2 +- tests/mir-opt/const_prop/boxes.rs | 4 +- tests/mir-opt/const_prop/indirect_mutation.rs | 4 +- tests/mir-opt/const_prop/mutable_variable.rs | 2 +- .../const_prop/mutable_variable_aggregate.rs | 2 +- .../mutable_variable_aggregate_mut_ref.rs | 2 +- ...mutable_variable_aggregate_partial_read.rs | 2 +- .../const_prop/mutable_variable_no_prop.rs | 4 +- .../mutable_variable_unprop_assign.rs | 6 +- .../overwrite_with_const_with_params.rs | 2 +- .../const_prop/pointer_expose_provenance.rs | 2 +- tests/mir-opt/const_prop/slice_len.rs | 2 +- tests/mir-opt/copy-prop/borrowed_local.rs | 16 +- .../dataflow-const-prop/array_index.rs | 2 +- tests/mir-opt/dataflow-const-prop/enum.rs | 10 +- .../dataflow-const-prop/large_array_index.rs | 2 +- .../dataflow-const-prop/ref_without_sb.rs | 2 +- tests/mir-opt/dataflow-const-prop/repeat.rs | 4 +- .../dataflow-const-prop/sibling_ptr.rs | 2 +- .../mir-opt/dataflow-const-prop/slice_len.rs | 6 +- tests/mir-opt/dataflow-const-prop/struct.rs | 16 +- .../dead-store-elimination/call_arg_copy.rs | 4 +- .../mir-opt/dest-prop/copy_propagation_arg.rs | 4 +- tests/mir-opt/dest-prop/dead_stores_79191.rs | 2 +- tests/mir-opt/dest-prop/dead_stores_better.rs | 2 +- tests/mir-opt/dest-prop/simple.rs | 4 +- tests/mir-opt/early_otherwise_branch.rs | 4 +- .../early_otherwise_branch_3_element_tuple.rs | 2 +- tests/mir-opt/gvn.rs | 366 +++++++++--------- tests/mir-opt/gvn_copy_moves.rs | 6 +- tests/mir-opt/instsimplify/casts.rs | 4 +- tests/mir-opt/instsimplify/ref_of_deref.rs | 8 +- tests/mir-opt/instsimplify/ub_check.rs | 2 +- tests/mir-opt/jump_threading.rs | 24 +- tests/mir-opt/lower_array_len.rs | 4 +- tests/mir-opt/lower_intrinsics.rs | 4 +- tests/mir-opt/pre-codegen/slice_index.rs | 20 +- tests/mir-opt/reference_prop.rs | 114 +++--- tests/mir-opt/simplify_dead_blocks.rs | 4 +- tests/mir-opt/sroa/structs.rs | 26 +- 45 files changed, 356 insertions(+), 356 deletions(-) diff --git a/tests/mir-opt/array_index_is_temporary.rs b/tests/mir-opt/array_index_is_temporary.rs index 771fb3771b5c0..cda9e86b3e664 100644 --- a/tests/mir-opt/array_index_is_temporary.rs +++ b/tests/mir-opt/array_index_is_temporary.rs @@ -15,7 +15,7 @@ fn main() { // CHECK: debug x => [[x:_.*]]; // CHECK: debug y => [[y:_.*]]; // CHECK: [[y]] = const 1_usize; - // CHECK: [[tmp:_.*]] = [[y]]; + // CHECK: [[tmp:_.*]] = copy [[y]]; // CHECK: [[x]][[[tmp]]] = let mut x = [42, 43, 44]; let mut y = 1; diff --git a/tests/mir-opt/box_expr.rs b/tests/mir-opt/box_expr.rs index a2d3ab94db65e..41cd4ca57bfee 100644 --- a/tests/mir-opt/box_expr.rs +++ b/tests/mir-opt/box_expr.rs @@ -7,7 +7,7 @@ fn main() { // CHECK-LABEL: fn main( // CHECK: [[box:_.*]] = ShallowInitBox( - // CHECK: [[ptr:_.*]] = ((([[box]].0: std::ptr::Unique).0: std::ptr::NonNull).0: *const S); + // CHECK: [[ptr:_.*]] = copy ((([[box]].0: std::ptr::Unique).0: std::ptr::NonNull).0: *const S); // CHECK: (*[[ptr]]) = S::new() -> [return: [[ret:bb.*]], unwind: [[unwind:bb.*]]]; // CHECK: [[ret]]: { // CHECK: [[box2:_.*]] = move [[box]]; diff --git a/tests/mir-opt/building/match/sort_candidates.rs b/tests/mir-opt/building/match/sort_candidates.rs index 593a975a7a474..d7dd82791ffa1 100644 --- a/tests/mir-opt/building/match/sort_candidates.rs +++ b/tests/mir-opt/building/match/sort_candidates.rs @@ -25,7 +25,7 @@ fn disjoint_ranges(x: i32, b: bool) -> u32 { // CHECK-LABEL: fn disjoint_ranges( // CHECK: debug b => _2; // CHECK: bb0: { - // CHECK: switchInt(_2) -> [0: [[jump:bb.*]], otherwise: {{bb.*}}]; + // CHECK: switchInt(copy _2) -> [0: [[jump:bb.*]], otherwise: {{bb.*}}]; // CHECK: [[jump]]: { // CHECK-NEXT: _0 = const 3_u32; // CHECK-NEXT: return; diff --git a/tests/mir-opt/building/while_storage.rs b/tests/mir-opt/building/while_storage.rs index 83095316f0054..cd226eb0c1e21 100644 --- a/tests/mir-opt/building/while_storage.rs +++ b/tests/mir-opt/building/while_storage.rs @@ -15,7 +15,7 @@ fn while_loop(c: bool) { // CHECK: bb1: { // CHECK-NEXT: StorageLive(_3); // CHECK-NEXT: StorageLive(_2); - // CHECK-NEXT: _2 = _1; + // CHECK-NEXT: _2 = copy _1; // CHECK-NEXT: _3 = get_bool(move _2) -> [return: bb2, unwind // CHECK: bb2: { // CHECK-NEXT: switchInt(move _3) -> [0: bb3, otherwise: bb4]; @@ -29,7 +29,7 @@ fn while_loop(c: bool) { // CHECK-NEXT: StorageDead(_2); // CHECK-NEXT: StorageLive(_5); // CHECK-NEXT: StorageLive(_4); - // CHECK-NEXT: _4 = _1; + // CHECK-NEXT: _4 = copy _1; // CHECK-NEXT: _5 = get_bool(move _4) -> [return: bb5, unwind // CHECK: bb5: { // CHECK-NEXT: switchInt(move _5) -> [0: bb6, otherwise: bb7]; diff --git a/tests/mir-opt/const_prop/address_of_pair.rs b/tests/mir-opt/const_prop/address_of_pair.rs index 9acaaa0ccaf9d..df1ab229d6e39 100644 --- a/tests/mir-opt/const_prop/address_of_pair.rs +++ b/tests/mir-opt/const_prop/address_of_pair.rs @@ -10,13 +10,13 @@ pub fn fn0() -> bool { // CHECK: (*[[ptr]]) = const true; // CHECK-NOT: = const false; // CHECK-NOT: = const true; - // CHECK: [[tmp:_.*]] = ([[pair]].1: bool); + // CHECK: [[tmp:_.*]] = copy ([[pair]].1: bool); // CHECK-NOT: = const false; // CHECK-NOT: = const true; // CHECK: [[ret]] = Not(move [[tmp]]); // CHECK-NOT: = const false; // CHECK-NOT: = const true; - // CHECK: _0 = [[ret]]; + // CHECK: _0 = copy [[ret]]; let mut pair = (1, false); let ptr = core::ptr::addr_of_mut!(pair.1); pair = (1, false); diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs index 0f8d278535dc7..139d0fa2e0f1c 100644 --- a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs +++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs @@ -8,7 +8,7 @@ fn main() { // CHECK-LABEL: fn main( // CHECK: debug a => [[a:_.*]]; // CHECK: debug _b => [[b:_.*]]; - // CHECK: [[b]] = (*[[a]])[3 of 4]; + // CHECK: [[b]] = copy (*[[a]])[3 of 4]; let a: *const [_] = &[1, 2, 3]; unsafe { let _b = (*a)[3]; diff --git a/tests/mir-opt/const_prop/boxes.rs b/tests/mir-opt/const_prop/boxes.rs index 7813352261e53..f04db260e27f9 100644 --- a/tests/mir-opt/const_prop/boxes.rs +++ b/tests/mir-opt/const_prop/boxes.rs @@ -11,8 +11,8 @@ fn main() { // CHECK-LABEL: fn main( // CHECK: debug x => [[x:_.*]]; // CHECK: (*{{_.*}}) = const 42_i32; - // CHECK: [[tmp:_.*]] = (*{{_.*}}); - // CHECK: [[x]] = [[tmp]]; + // CHECK: [[tmp:_.*]] = copy (*{{_.*}}); + // CHECK: [[x]] = copy [[tmp]]; let x = *(#[rustc_box] Box::new(42)) + 0; diff --git a/tests/mir-opt/const_prop/indirect_mutation.rs b/tests/mir-opt/const_prop/indirect_mutation.rs index 32ff8f142b1e7..0a4c455c76ef2 100644 --- a/tests/mir-opt/const_prop/indirect_mutation.rs +++ b/tests/mir-opt/const_prop/indirect_mutation.rs @@ -10,7 +10,7 @@ fn foo() { // CHECK: _1 = const (1_i32,); // CHECK: _2 = &mut (_1.0: i32); // CHECK: (*_2) = const 5_i32; - // CHECK: _4 = (_1.0: i32); + // CHECK: _4 = copy (_1.0: i32); // CHECK: _3 = Eq(move _4, const 5_i32); let mut u = (1,); @@ -25,7 +25,7 @@ fn bar() { // CHECK: debug y => _4; // CHECK: _3 = &raw mut (_1.0: i32); // CHECK: (*_3) = const 5_i32; - // CHECK: _5 = (_1.0: i32); + // CHECK: _5 = copy (_1.0: i32); // CHECK: _4 = Eq(move _5, const 5_i32); let mut v = (1,); diff --git a/tests/mir-opt/const_prop/mutable_variable.rs b/tests/mir-opt/const_prop/mutable_variable.rs index 9698fba6a11ac..3aa1b1bcd2181 100644 --- a/tests/mir-opt/const_prop/mutable_variable.rs +++ b/tests/mir-opt/const_prop/mutable_variable.rs @@ -7,7 +7,7 @@ fn main() { // CHECK: debug y => [[y:_.*]]; // CHECK: [[x]] = const 42_i32; // CHECK: [[x]] = const 99_i32; - // CHECK: [[y]] = [[x]]; + // CHECK: [[y]] = copy [[x]]; let mut x = 42; x = 99; let y = x; diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate.rs b/tests/mir-opt/const_prop/mutable_variable_aggregate.rs index 80cd75215c1b7..bb8bf7f71646e 100644 --- a/tests/mir-opt/const_prop/mutable_variable_aggregate.rs +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate.rs @@ -8,7 +8,7 @@ fn main() { // CHECK: debug y => [[y:_.*]]; // CHECK: [[x]] = const (42_i32, 43_i32); // CHECK: ([[x]].1: i32) = const 99_i32; - // CHECK: [[y]] = [[x]]; + // CHECK: [[y]] = copy [[x]]; let mut x = (42, 43); x.1 = 99; let y = x; diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs index 856afd53ab46b..332cac96f75d0 100644 --- a/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs @@ -10,7 +10,7 @@ fn main() { // CHECK: [[x]] = const (42_i32, 43_i32); // CHECK: [[z]] = &mut [[x]]; // CHECK: ((*[[z]]).1: i32) = const 99_i32; - // CHECK: [[y]] = [[x]]; + // CHECK: [[y]] = copy [[x]]; let mut x = (42, 43); let z = &mut x; z.1 = 99; diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs index 6f99e6be246fa..e27437a1c7541 100644 --- a/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs @@ -9,7 +9,7 @@ fn main() { // CHECK: [[x]] = foo() // CHECK: ([[x]].1: i32) = const 99_i32; // CHECK: ([[x]].0: i32) = const 42_i32; - // CHECK: [[y]] = ([[x]].1: i32); + // CHECK: [[y]] = copy ([[x]].1: i32); let mut x: (i32, i32) = foo(); x.1 = 99; x.0 = 42; diff --git a/tests/mir-opt/const_prop/mutable_variable_no_prop.rs b/tests/mir-opt/const_prop/mutable_variable_no_prop.rs index 8289832f81ea3..66af5bf1d5d40 100644 --- a/tests/mir-opt/const_prop/mutable_variable_no_prop.rs +++ b/tests/mir-opt/const_prop/mutable_variable_no_prop.rs @@ -9,9 +9,9 @@ fn main() { // CHECK: debug x => [[x:_.*]]; // CHECK: debug y => [[y:_.*]]; // CHECK: [[x]] = const 42_u32; - // CHECK: [[tmp:_.*]] = (*{{_.*}}); + // CHECK: [[tmp:_.*]] = copy (*{{_.*}}); // CHECK: [[x]] = move [[tmp]]; - // CHECK: [[y]] = [[x]]; + // CHECK: [[y]] = copy [[x]]; let mut x = 42; unsafe { x = STATIC; diff --git a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs index 2c6cc0db6b211..1f4421331bccd 100644 --- a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs +++ b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs @@ -11,9 +11,9 @@ fn main() { // CHECK: debug z => [[z:_.*]]; // CHECK: [[a]] = foo() // CHECK: [[x]] = const (1_i32, 2_i32); - // CHECK: ([[x]].1: i32) = [[a]]; - // CHECK: [[y]] = ([[x]].1: i32); - // CHECK: [[z]] = ([[x]].0: i32); + // CHECK: ([[x]].1: i32) = copy [[a]]; + // CHECK: [[y]] = copy ([[x]].1: i32); + // CHECK: [[z]] = copy ([[x]].0: i32); let a = foo(); let mut x: (i32, i32) = (1, 2); x.1 = a; diff --git a/tests/mir-opt/const_prop/overwrite_with_const_with_params.rs b/tests/mir-opt/const_prop/overwrite_with_const_with_params.rs index a43558223fe1a..1d8890bf3692f 100644 --- a/tests/mir-opt/const_prop/overwrite_with_const_with_params.rs +++ b/tests/mir-opt/const_prop/overwrite_with_const_with_params.rs @@ -15,7 +15,7 @@ fn size_of() -> usize { // CHECK-LABEL: fn size_of( // CHECK: _1 = const 0_usize; // CHECK-NEXT: _1 = const SizeOfConst::::SIZE; - // CHECK-NEXT: _0 = _1; + // CHECK-NEXT: _0 = copy _1; let mut a = 0; a = SizeOfConst::::SIZE; a diff --git a/tests/mir-opt/const_prop/pointer_expose_provenance.rs b/tests/mir-opt/const_prop/pointer_expose_provenance.rs index a76fead985948..bee8a985f8f9b 100644 --- a/tests/mir-opt/const_prop/pointer_expose_provenance.rs +++ b/tests/mir-opt/const_prop/pointer_expose_provenance.rs @@ -10,7 +10,7 @@ fn main() { // CHECK: [[ptr:_.*]] = const main::FOO; // CHECK: [[ref:_.*]] = &raw const (*[[ptr]]); // CHECK: [[x:_.*]] = move [[ref]] as usize (PointerExposeProvenance); - // CHECK: = read([[x]]) + // CHECK: = read(copy [[x]]) const FOO: &i32 = &1; let x = FOO as *const i32 as usize; read(x); diff --git a/tests/mir-opt/const_prop/slice_len.rs b/tests/mir-opt/const_prop/slice_len.rs index 3d1b58965ac4e..46604cfe1e091 100644 --- a/tests/mir-opt/const_prop/slice_len.rs +++ b/tests/mir-opt/const_prop/slice_len.rs @@ -7,7 +7,7 @@ fn main() { // CHECK-LABEL: fn main( // CHECK: debug a => [[a:_.*]]; - // CHECK: [[slice:_.*]] = {{.*}} as &[u32] (PointerCoercion(Unsize)); + // CHECK: [[slice:_.*]] = copy {{.*}} as &[u32] (PointerCoercion(Unsize)); // CHECK: assert(const true, // CHECK: [[a]] = const 2_u32; let a = (&[1u32, 2, 3] as &[u32])[1]; diff --git a/tests/mir-opt/copy-prop/borrowed_local.rs b/tests/mir-opt/copy-prop/borrowed_local.rs index dd1679513f6c9..8db19fbd37755 100644 --- a/tests/mir-opt/copy-prop/borrowed_local.rs +++ b/tests/mir-opt/copy-prop/borrowed_local.rs @@ -21,11 +21,11 @@ fn compare_address() -> bool { // CHECK: bb0: { // CHECK-NEXT: _1 = const 5_u8; // CHECK-NEXT: _2 = &_1; - // CHECK-NEXT: _3 = _1; + // CHECK-NEXT: _3 = copy _1; // CHECK-NEXT: _4 = &_3; - // CHECK-NEXT: _0 = cmp_ref(_2, _4) + // CHECK-NEXT: _0 = cmp_ref(copy _2, copy _4) // CHECK: bb1: { - // CHECK-NEXT: _0 = opaque::(_3) + // CHECK-NEXT: _0 = opaque::(copy _3) mir! { { let a = 5_u8; @@ -51,9 +51,9 @@ fn borrowed(x: T) -> bool { // CHECK-LABEL: fn borrowed( // CHECK: bb0: { // CHECK-NEXT: _3 = &_1; - // CHECK-NEXT: _0 = opaque::<&T>(_3) + // CHECK-NEXT: _0 = opaque::<&T>(copy _3) // CHECK: bb1: { - // CHECK-NEXT: _0 = opaque::(_1) + // CHECK-NEXT: _0 = opaque::(copy _1) mir! { { let a = x; @@ -74,11 +74,11 @@ fn borrowed(x: T) -> bool { fn non_freeze(x: T) -> bool { // CHECK-LABEL: fn non_freeze( // CHECK: bb0: { - // CHECK-NEXT: _2 = _1; + // CHECK-NEXT: _2 = copy _1; // CHECK-NEXT: _3 = &_1; - // CHECK-NEXT: _0 = opaque::<&T>(_3) + // CHECK-NEXT: _0 = opaque::<&T>(copy _3) // CHECK: bb1: { - // CHECK-NEXT: _0 = opaque::(_2) + // CHECK-NEXT: _0 = opaque::(copy _2) mir! { { let a = x; diff --git a/tests/mir-opt/dataflow-const-prop/array_index.rs b/tests/mir-opt/dataflow-const-prop/array_index.rs index daf9c7729c604..e442ef99f79e6 100644 --- a/tests/mir-opt/dataflow-const-prop/array_index.rs +++ b/tests/mir-opt/dataflow-const-prop/array_index.rs @@ -16,6 +16,6 @@ fn main() { // CHECK: {{_.*}} = const 4_usize; // CHECK: {{_.*}} = const true; // CHECK: assert(const true - // CHECK: [[x]] = [[array_lit]][2 of 3]; + // CHECK: [[x]] = copy [[array_lit]][2 of 3]; let x: u32 = [0, 1, 2, 3][2]; } diff --git a/tests/mir-opt/dataflow-const-prop/enum.rs b/tests/mir-opt/dataflow-const-prop/enum.rs index 37304e3a270e9..207e29e63df9e 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.rs +++ b/tests/mir-opt/dataflow-const-prop/enum.rs @@ -73,7 +73,7 @@ fn statics() { static RC: &E = &E::V2(4); // CHECK: [[t:_.*]] = const {alloc5: &&E}; - // CHECK: [[e2]] = (*[[t]]); + // CHECK: [[e2]] = copy (*[[t]]); let e2 = RC; // CHECK: switchInt({{move _.*}}) -> {{.*}} @@ -108,7 +108,7 @@ fn mutate_discriminant() -> u8 { // CHECK: [[a:_.*]] = discriminant({{_.*}}); let a = Discriminant(x); - // CHECK: switchInt([[a]]) -> [0: {{bb.*}}, otherwise: {{bb.*}}]; + // CHECK: switchInt(copy [[a]]) -> [0: {{bb.*}}, otherwise: {{bb.*}}]; match a { 0 => bb1, _ => bad, @@ -143,8 +143,8 @@ fn multiple(x: bool, i: u8) { // discriminant(e) => Top // (e as Some).0 => Top // CHECK: [[x2]] = const 0_u8; - // CHECK: [[some:_.*]] = (({{_.*}} as Some).0: u8) - // CHECK: [[x2]] = [[some]]; + // CHECK: [[some:_.*]] = copy (({{_.*}} as Some).0: u8) + // CHECK: [[x2]] = copy [[some]]; let x2 = match e { Some(i) => i, None => 0, @@ -153,7 +153,7 @@ fn multiple(x: bool, i: u8) { // Therefore, `x2` should be `Top` here, and no replacement shall happen. // CHECK-NOT: [[y]] = const - // CHECK: [[y]] = [[x2]]; + // CHECK: [[y]] = copy [[x2]]; // CHECK-NOT: [[y]] = const let y = x2; } diff --git a/tests/mir-opt/dataflow-const-prop/large_array_index.rs b/tests/mir-opt/dataflow-const-prop/large_array_index.rs index e74fd88d002cc..e9f2fa2badf95 100644 --- a/tests/mir-opt/dataflow-const-prop/large_array_index.rs +++ b/tests/mir-opt/dataflow-const-prop/large_array_index.rs @@ -13,6 +13,6 @@ fn main() { // CHECK: {{_.*}} = const 5000_usize; // CHECK: {{_.*}} = const true; // CHECK: assert(const true - // CHECK: [[x]] = [[array_lit]][2 of 3]; + // CHECK: [[x]] = copy [[array_lit]][2 of 3]; let x: u8 = [0_u8; 5000][2]; } diff --git a/tests/mir-opt/dataflow-const-prop/ref_without_sb.rs b/tests/mir-opt/dataflow-const-prop/ref_without_sb.rs index 399de921a590f..1c4eb41f35ec6 100644 --- a/tests/mir-opt/dataflow-const-prop/ref_without_sb.rs +++ b/tests/mir-opt/dataflow-const-prop/ref_without_sb.rs @@ -24,7 +24,7 @@ fn main() { // This should currently not be propagated. // CHECK-NOT: [[b]] = const - // CHECK: [[b]] = [[a]]; + // CHECK: [[b]] = copy [[a]]; // CHECK-NOT: [[b]] = const let b = a; } diff --git a/tests/mir-opt/dataflow-const-prop/repeat.rs b/tests/mir-opt/dataflow-const-prop/repeat.rs index e32c0d0877dec..2067aa3d709e2 100644 --- a/tests/mir-opt/dataflow-const-prop/repeat.rs +++ b/tests/mir-opt/dataflow-const-prop/repeat.rs @@ -14,8 +14,8 @@ fn main() { // CHECK: {{_.*}} = const true; // CHECK: assert(const true - // CHECK-NOT: [[t:_.*]] = [[array_lit]][_ - // CHECK: [[t:_.*]] = [[array_lit]][2 of 3]; + // CHECK-NOT: [[t:_.*]] = {{copy|move}} [[array_lit]][_ + // CHECK: [[t:_.*]] = copy [[array_lit]][2 of 3]; // CHECK: [[x]] = Add(move [[t]], const 0_u32); let x: u32 = [42; 8][2] + 0; } diff --git a/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs b/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs index be7f311cdc10d..b123f06807d60 100644 --- a/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs +++ b/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs @@ -20,6 +20,6 @@ fn main() { *p.add(1) = 1; } - // CHECK: [[x1]] = ({{_.*}}.1: u8); + // CHECK: [[x1]] = copy ({{_.*}}.1: u8); let x1 = x.1; // should not be propagated } diff --git a/tests/mir-opt/dataflow-const-prop/slice_len.rs b/tests/mir-opt/dataflow-const-prop/slice_len.rs index 64c043cca795b..e0e68f9fde54a 100644 --- a/tests/mir-opt/dataflow-const-prop/slice_len.rs +++ b/tests/mir-opt/dataflow-const-prop/slice_len.rs @@ -17,7 +17,7 @@ fn main() { // CHECK: {{_.*}} = const true; // CHECK: assert(const true, - // CHECK: [[local]] = (*{{_.*}})[1 of 2]; + // CHECK: [[local]] = copy (*{{_.*}})[1 of 2]; let local = (&[1u32, 2, 3] as &[u32])[1]; // CHECK-NOT: {{_.*}} = Len( @@ -28,7 +28,7 @@ fn main() { // CHECK: {{_.*}} = const true; // CHECK: assert(const true, - // CHECK-NOT: [[constant]] = (*{{_.*}})[_ - // CHECK: [[constant]] = (*{{_.*}})[1 of 2]; + // CHECK-NOT: [[constant]] = {{copy|move}} (*{{_.*}})[_ + // CHECK: [[constant]] = copy (*{{_.*}})[1 of 2]; let constant = SLICE[1]; } diff --git a/tests/mir-opt/dataflow-const-prop/struct.rs b/tests/mir-opt/dataflow-const-prop/struct.rs index 89ad1b870294e..44591ffb6de2e 100644 --- a/tests/mir-opt/dataflow-const-prop/struct.rs +++ b/tests/mir-opt/dataflow-const-prop/struct.rs @@ -46,15 +46,15 @@ fn main() { const SMALL_VAL: SmallStruct = SmallStruct(4., Some(S(1)), &[]); // CHECK: [[a1]] = const 4f32; - // CHECK: [[b1]] = ({{_.*}}.1: std::option::Option); - // CHECK: [[c1]] = ({{_.*}}.2: &[f32]); + // CHECK: [[b1]] = copy ({{_.*}}.1: std::option::Option); + // CHECK: [[c1]] = copy ({{_.*}}.2: &[f32]); let SmallStruct(a1, b1, c1) = SMALL_VAL; static SMALL_STAT: &SmallStruct = &SmallStruct(9., None, &[13.]); // CHECK: [[a2]] = const 9f32; - // CHECK: [[b2]] = ((*{{_.*}}).1: std::option::Option); - // CHECK: [[c2]] = ((*{{_.*}}).2: &[f32]); + // CHECK: [[b2]] = copy ((*{{_.*}}).1: std::option::Option); + // CHECK: [[c2]] = copy ((*{{_.*}}).2: &[f32]); let SmallStruct(a2, b2, c2) = *SMALL_STAT; // CHECK: [[ss]] = SmallStruct(const 9f32, move {{_.*}}, move {{_.*}}); @@ -63,14 +63,14 @@ fn main() { const BIG_VAL: BigStruct = BigStruct(25., None, &[]); // CHECK: [[a3]] = const 25f32; - // CHECK: [[b3]] = ({{_.*}}.1: std::option::Option); - // CHECK: [[c3]] = ({{_.*}}.2: &[f32]); + // CHECK: [[b3]] = copy ({{_.*}}.1: std::option::Option); + // CHECK: [[c3]] = copy ({{_.*}}.2: &[f32]); let BigStruct(a3, b3, c3) = BIG_VAL; static BIG_STAT: &BigStruct = &BigStruct(82., Some(S(35)), &[45., 72.]); // CHECK: [[a4]] = const 82f32; - // CHECK: [[b4]] = ((*{{_.*}}).1: std::option::Option); - // CHECK: [[c4]] = ((*{{_.*}}).2: &[f32]); + // CHECK: [[b4]] = copy ((*{{_.*}}).1: std::option::Option); + // CHECK: [[c4]] = copy ((*{{_.*}}).2: &[f32]); let BigStruct(a4, b4, c4) = *BIG_STAT; // We arbitrarily limit the size of synthetized values to 4 pointers. diff --git a/tests/mir-opt/dead-store-elimination/call_arg_copy.rs b/tests/mir-opt/dead-store-elimination/call_arg_copy.rs index 2556848ec4629..27b5ccdb936db 100644 --- a/tests/mir-opt/dead-store-elimination/call_arg_copy.rs +++ b/tests/mir-opt/dead-store-elimination/call_arg_copy.rs @@ -14,7 +14,7 @@ fn use_both(_: i32, _: i32) {} // EMIT_MIR call_arg_copy.move_simple.DeadStoreElimination-final.diff fn move_simple(x: i32) { // CHECK-LABEL: fn move_simple( - // CHECK: = use_both(_1, move _1) + // CHECK: = use_both(copy _1, move _1) use_both(x, x); } @@ -28,7 +28,7 @@ struct Packed { #[custom_mir(dialect = "analysis")] fn move_packed(packed: Packed) { // CHECK-LABEL: fn move_packed( - // CHECK: = use_both(const 0_i32, (_1.1: i32)) + // CHECK: = use_both(const 0_i32, copy (_1.1: i32)) mir! { { // We have a packed struct, verify that the copy is not turned into a move. diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.rs b/tests/mir-opt/dest-prop/copy_propagation_arg.rs index 084bd0544c175..ef531f4afa2b7 100644 --- a/tests/mir-opt/dest-prop/copy_propagation_arg.rs +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.rs @@ -41,9 +41,9 @@ fn arg_src(mut x: i32) -> i32 { // CHECK-LABEL: fn arg_src( // CHECK: debug x => [[x:_.*]]; // CHECK: debug y => [[y:_.*]]; - // CHECK: [[y]] = [[x]] + // CHECK: [[y]] = copy [[x]] // CHECK: [[x]] = const 123_i32; - // CHECK-NOT: {{_.*}} = [[y]]; + // CHECK-NOT: {{_.*}} = copy [[y]]; let y = x; x = 123; // Don't propagate this assignment to `y` y diff --git a/tests/mir-opt/dest-prop/dead_stores_79191.rs b/tests/mir-opt/dest-prop/dead_stores_79191.rs index 61060e4f8506b..d035de5ce0765 100644 --- a/tests/mir-opt/dest-prop/dead_stores_79191.rs +++ b/tests/mir-opt/dest-prop/dead_stores_79191.rs @@ -10,7 +10,7 @@ fn f(mut a: usize) -> usize { // CHECK-LABEL: fn f( // CHECK: debug a => [[a:_.*]]; // CHECK: debug b => [[b:_.*]]; - // CHECK: [[b]] = [[a]]; + // CHECK: [[b]] = copy [[a]]; // CHECK: [[a]] = const 5_usize; // CHECK: [[a]] = move [[b]]; // CHECK: id::(move [[a]]) diff --git a/tests/mir-opt/dest-prop/dead_stores_better.rs b/tests/mir-opt/dest-prop/dead_stores_better.rs index d2b9fe0571234..d4c297fd97a38 100644 --- a/tests/mir-opt/dest-prop/dead_stores_better.rs +++ b/tests/mir-opt/dest-prop/dead_stores_better.rs @@ -14,7 +14,7 @@ pub fn f(mut a: usize) -> usize { // CHECK-LABEL: fn f( // CHECK: debug a => [[a:_.*]]; // CHECK: debug b => [[b:_.*]]; - // CHECK: [[b]] = [[a]]; + // CHECK: [[b]] = copy [[a]]; // CHECK: [[a]] = const 5_usize; // CHECK: [[a]] = move [[b]]; // CHECK: id::(move [[a]]) diff --git a/tests/mir-opt/dest-prop/simple.rs b/tests/mir-opt/dest-prop/simple.rs index 833d49b8c4665..927a9c5b24cdb 100644 --- a/tests/mir-opt/dest-prop/simple.rs +++ b/tests/mir-opt/dest-prop/simple.rs @@ -7,9 +7,9 @@ fn nrvo(init: fn(&mut [u8; 1024])) -> [u8; 1024] { // CHECK: debug init => [[init:_.*]]; // CHECK: debug buf => [[buf:_.*]]; // CHECK: [[buf]] = [const 0_u8; 1024]; - // CHECK-NOT: {{_.*}} = [[init]]; + // CHECK-NOT: {{_.*}} = copy [[init]]; // CHECK: move [[init]](move {{_.*}}) - // CHECK: {{_.*}} = [[buf]] + // CHECK: {{_.*}} = copy [[buf]] let mut buf = [0; 1024]; init(&mut buf); buf diff --git a/tests/mir-opt/early_otherwise_branch.rs b/tests/mir-opt/early_otherwise_branch.rs index b047c50df97fa..47bd4be295b04 100644 --- a/tests/mir-opt/early_otherwise_branch.rs +++ b/tests/mir-opt/early_otherwise_branch.rs @@ -49,7 +49,7 @@ fn opt3(x: Option2, y: Option2) -> u32 { // CHECK: bb0: { // CHECK: [[LOCAL1:_.*]] = discriminant({{.*}}); // CHECK: [[LOCAL2:_.*]] = discriminant({{.*}}); - // CHECK: [[CMP_LOCAL]] = Ne([[LOCAL1]], move [[LOCAL2]]); + // CHECK: [[CMP_LOCAL]] = Ne(copy [[LOCAL1]], move [[LOCAL2]]); // CHECK: switchInt(move [[CMP_LOCAL]]) -> [ // CHECK-NEXT: } match (x, y) { @@ -67,7 +67,7 @@ fn opt4(x: Option2, y: Option2) -> u32 { // CHECK: bb0: { // CHECK: [[LOCAL1:_.*]] = discriminant({{.*}}); // CHECK: [[LOCAL2:_.*]] = discriminant({{.*}}); - // CHECK: [[CMP_LOCAL]] = Ne([[LOCAL1]], move [[LOCAL2]]); + // CHECK: [[CMP_LOCAL]] = Ne(copy [[LOCAL1]], move [[LOCAL2]]); // CHECK: switchInt(move [[CMP_LOCAL]]) -> [ // CHECK-NEXT: } match (x, y) { diff --git a/tests/mir-opt/early_otherwise_branch_3_element_tuple.rs b/tests/mir-opt/early_otherwise_branch_3_element_tuple.rs index d2a3e1f59ff6e..d6b27fbce4844 100644 --- a/tests/mir-opt/early_otherwise_branch_3_element_tuple.rs +++ b/tests/mir-opt/early_otherwise_branch_3_element_tuple.rs @@ -32,7 +32,7 @@ fn opt2(x: Option2, y: Option2, z: Option2) -> u32 { // CHECK: bb0: { // CHECK: [[LOCAL1:_.*]] = discriminant({{.*}}); // CHECK: [[LOCAL2:_.*]] = discriminant({{.*}}); - // CHECK: [[CMP_LOCAL]] = Ne([[LOCAL1]], move [[LOCAL2]]); + // CHECK: [[CMP_LOCAL]] = Ne(copy [[LOCAL1]], move [[LOCAL2]]); // CHECK: switchInt(move [[CMP_LOCAL]]) -> [ // CHECK-NEXT: } match (x, y, z) { diff --git a/tests/mir-opt/gvn.rs b/tests/mir-opt/gvn.rs index 430f979fec716..ab1253eadeec3 100644 --- a/tests/mir-opt/gvn.rs +++ b/tests/mir-opt/gvn.rs @@ -21,91 +21,91 @@ struct S(T); fn subexpression_elimination(x: u64, y: u64, mut z: u64) { // CHECK-LABEL: fn subexpression_elimination( - // CHECK: [[add:_.*]] = Add(_1, _2); - // CHECK: opaque::([[add]]) + // CHECK: [[add:_.*]] = Add(copy _1, copy _2); + // CHECK: opaque::(copy [[add]]) opaque(x + y); - // CHECK: [[mul:_.*]] = Mul(_1, _2); - // CHECK: opaque::([[mul]]) + // CHECK: [[mul:_.*]] = Mul(copy _1, copy _2); + // CHECK: opaque::(copy [[mul]]) opaque(x * y); - // CHECK: [[sub:_.*]] = Sub(_1, _2); - // CHECK: opaque::([[sub]]) + // CHECK: [[sub:_.*]] = Sub(copy _1, copy _2); + // CHECK: opaque::(copy [[sub]]) opaque(x - y); - // CHECK: [[div:_.*]] = Div(_1, _2); - // CHECK: opaque::([[div]]) + // CHECK: [[div:_.*]] = Div(copy _1, copy _2); + // CHECK: opaque::(copy [[div]]) opaque(x / y); - // CHECK: [[rem:_.*]] = Rem(_1, _2); - // CHECK: opaque::([[rem]]) + // CHECK: [[rem:_.*]] = Rem(copy _1, copy _2); + // CHECK: opaque::(copy [[rem]]) opaque(x % y); - // CHECK: [[and:_.*]] = BitAnd(_1, _2); - // CHECK: opaque::([[and]]) + // CHECK: [[and:_.*]] = BitAnd(copy _1, copy _2); + // CHECK: opaque::(copy [[and]]) opaque(x & y); - // CHECK: [[or:_.*]] = BitOr(_1, _2); - // CHECK: opaque::([[or]]) + // CHECK: [[or:_.*]] = BitOr(copy _1, copy _2); + // CHECK: opaque::(copy [[or]]) opaque(x | y); - // CHECK: [[xor:_.*]] = BitXor(_1, _2); - // CHECK: opaque::([[xor]]) + // CHECK: [[xor:_.*]] = BitXor(copy _1, copy _2); + // CHECK: opaque::(copy [[xor]]) opaque(x ^ y); - // CHECK: [[shl:_.*]] = Shl(_1, _2); - // CHECK: opaque::([[shl]]) + // CHECK: [[shl:_.*]] = Shl(copy _1, copy _2); + // CHECK: opaque::(copy [[shl]]) opaque(x << y); - // CHECK: [[shr:_.*]] = Shr(_1, _2); - // CHECK: opaque::([[shr]]) + // CHECK: [[shr:_.*]] = Shr(copy _1, copy _2); + // CHECK: opaque::(copy [[shr]]) opaque(x >> y); - // CHECK: [[int:_.*]] = _1 as u32 (IntToInt); - // CHECK: opaque::([[int]]) + // CHECK: [[int:_.*]] = copy _1 as u32 (IntToInt); + // CHECK: opaque::(copy [[int]]) opaque(x as u32); - // CHECK: [[float:_.*]] = _1 as f32 (IntToFloat); - // CHECK: opaque::([[float]]) + // CHECK: [[float:_.*]] = copy _1 as f32 (IntToFloat); + // CHECK: opaque::(copy [[float]]) opaque(x as f32); - // CHECK: [[wrap:_.*]] = S::(_1); - // CHECK: opaque::>([[wrap]]) + // CHECK: [[wrap:_.*]] = S::(copy _1); + // CHECK: opaque::>(copy [[wrap]]) opaque(S(x)); - // CHECK: opaque::(_1) + // CHECK: opaque::(copy _1) opaque(S(x).0); // Those are duplicates to substitute somehow. - // CHECK: opaque::([[add]]) + // CHECK: opaque::(copy [[add]]) opaque(x + y); - // CHECK: opaque::([[mul]]) + // CHECK: opaque::(copy [[mul]]) opaque(x * y); - // CHECK: opaque::([[sub]]) + // CHECK: opaque::(copy [[sub]]) opaque(x - y); - // CHECK: opaque::([[div]]) + // CHECK: opaque::(copy [[div]]) opaque(x / y); - // CHECK: opaque::([[rem]]) + // CHECK: opaque::(copy [[rem]]) opaque(x % y); - // CHECK: opaque::([[and]]) + // CHECK: opaque::(copy [[and]]) opaque(x & y); - // CHECK: opaque::([[or]]) + // CHECK: opaque::(copy [[or]]) opaque(x | y); - // CHECK: opaque::([[xor]]) + // CHECK: opaque::(copy [[xor]]) opaque(x ^ y); - // CHECK: opaque::([[shl]]) + // CHECK: opaque::(copy [[shl]]) opaque(x << y); - // CHECK: opaque::([[shr]]) + // CHECK: opaque::(copy [[shr]]) opaque(x >> y); - // CHECK: opaque::([[int]]) + // CHECK: opaque::(copy [[int]]) opaque(x as u32); - // CHECK: opaque::([[float]]) + // CHECK: opaque::(copy [[float]]) opaque(x as f32); - // CHECK: opaque::>([[wrap]]) + // CHECK: opaque::>(copy [[wrap]]) opaque(S(x)); - // CHECK: opaque::(_1) + // CHECK: opaque::(copy _1) opaque(S(x).0); // We can substitute through a complex expression. - // CHECK: [[compound:_.*]] = Sub([[mul]], _2); - // CHECK: opaque::([[compound]]) - // CHECK: opaque::([[compound]]) + // CHECK: [[compound:_.*]] = Sub(copy [[mul]], copy _2); + // CHECK: opaque::(copy [[compound]]) + // CHECK: opaque::(copy [[compound]]) opaque((x * y) - y); opaque((x * y) - y); // We can substitute through an immutable reference too. // CHECK: [[ref:_.*]] = &_3; - // CHECK: [[deref:_.*]] = (*[[ref]]); - // CHECK: [[addref:_.*]] = Add([[deref]], _1); - // CHECK: opaque::([[addref]]) - // CHECK: opaque::([[addref]]) + // CHECK: [[deref:_.*]] = copy (*[[ref]]); + // CHECK: [[addref:_.*]] = Add(copy [[deref]], copy _1); + // CHECK: opaque::(copy [[addref]]) + // CHECK: opaque::(copy [[addref]]) let a = &z; opaque(*a + x); opaque(*a + x); @@ -141,10 +141,10 @@ fn subexpression_elimination(x: u64, y: u64, mut z: u64) { // We can substitute again, but not with the earlier computations. // Important: `e` is not `a`! // CHECK: [[ref2:_.*]] = &_3; - // CHECK: [[deref2:_.*]] = (*[[ref2]]); - // CHECK: [[addref2:_.*]] = Add([[deref2]], _1); - // CHECK: opaque::([[addref2]]) - // CHECK: opaque::([[addref2]]) + // CHECK: [[deref2:_.*]] = copy (*[[ref2]]); + // CHECK: [[addref2:_.*]] = Add(copy [[deref2]], copy _1); + // CHECK: opaque::(copy [[addref2]]) + // CHECK: opaque::(copy [[addref2]]) let e = &z; opaque(*e + x); opaque(*e + x); @@ -152,9 +152,9 @@ fn subexpression_elimination(x: u64, y: u64, mut z: u64) { fn wrap_unwrap(x: T) -> T { // CHECK-LABEL: fn wrap_unwrap( - // CHECK: [[some:_.*]] = Option::::Some(_1); + // CHECK: [[some:_.*]] = Option::::Some(copy _1); // CHECK: switchInt(const 1_isize) - // CHECK: _0 = _1; + // CHECK: _0 = copy _1; match Some(x) { Some(y) => y, None => panic!(), @@ -163,35 +163,35 @@ fn wrap_unwrap(x: T) -> T { fn repeated_index(x: T, idx: usize) { // CHECK-LABEL: fn repeated_index( - // CHECK: [[a:_.*]] = [_1; N]; + // CHECK: [[a:_.*]] = [copy _1; N]; let a = [x; N]; - // CHECK: opaque::(_1) + // CHECK: opaque::(copy _1) opaque(a[0]); - // CHECK: opaque::(_1) + // CHECK: opaque::(copy _1) opaque(a[idx]); } fn unary(x: i64) { // CHECK-LABEL: fn unary( - // CHECK: opaque::(_1) + // CHECK: opaque::(copy _1) opaque(--x); // This is `x`. - // CHECK: [[b:_.*]] = Lt(_1, const 13_i64); - // CHECK: opaque::([[b]]) + // CHECK: [[b:_.*]] = Lt(copy _1, const 13_i64); + // CHECK: opaque::(copy [[b]]) let b = x < 13; opaque(!!b); // This is `b`. // Both lines should test the same thing. - // CHECK: [[c:_.*]] = Ne(_1, const 15_i64); - // CHECK: opaque::([[c]]) - // CHECK: opaque::([[c]]) + // CHECK: [[c:_.*]] = Ne(copy _1, const 15_i64); + // CHECK: opaque::(copy [[c]]) + // CHECK: opaque::(copy [[c]]) opaque(x != 15); opaque(!(x == 15)); // Both lines should test the same thing. - // CHECK: [[d:_.*]] = Eq(_1, const 35_i64); - // CHECK: opaque::([[d]]) - // CHECK: opaque::([[d]]) + // CHECK: [[d:_.*]] = Eq(copy _1, const 35_i64); + // CHECK: opaque::(copy [[d]]) + // CHECK: opaque::(copy [[d]]) opaque(x == 35); opaque(!(x != 35)); } @@ -199,53 +199,53 @@ fn unary(x: i64) { /// Verify symbolic integer arithmetic simplifications. fn arithmetic(x: u64) { // CHECK-LABEL: fn arithmetic( - // CHECK: opaque::(_1) + // CHECK: opaque::(copy _1) opaque(x + 0); - // CHECK: opaque::(_1) + // CHECK: opaque::(copy _1) opaque(x - 0); // CHECK: opaque::(const 0_u64) opaque(x - x); // CHECK: opaque::(const 0_u64) opaque(x * 0); - // CHECK: opaque::(_1) + // CHECK: opaque::(copy _1) opaque(x * 1); // CHECK: assert(!const true, "attempt to divide `{}` by zero", - // CHECK: [[div0:_.*]] = Div(_1, const 0_u64); + // CHECK: [[div0:_.*]] = Div(copy _1, const 0_u64); // CHECK: opaque::(move [[div0]]) opaque(x / 0); - // CHECK: opaque::(_1) + // CHECK: opaque::(copy _1) opaque(x / 1); // CHECK: opaque::(const 0_u64) opaque(0 / x); - // CHECK: [[odiv:_.*]] = Div(const 1_u64, _1); + // CHECK: [[odiv:_.*]] = Div(const 1_u64, copy _1); // CHECK: opaque::(move [[odiv]]) opaque(1 / x); // CHECK: assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero" - // CHECK: [[rem0:_.*]] = Rem(_1, const 0_u64); + // CHECK: [[rem0:_.*]] = Rem(copy _1, const 0_u64); // CHECK: opaque::(move [[rem0]]) opaque(x % 0); // CHECK: opaque::(const 0_u64) opaque(x % 1); // CHECK: opaque::(const 0_u64) opaque(0 % x); - // CHECK: [[orem:_.*]] = Rem(const 1_u64, _1); + // CHECK: [[orem:_.*]] = Rem(const 1_u64, copy _1); // CHECK: opaque::(move [[orem]]) opaque(1 % x); // CHECK: opaque::(const 0_u64) opaque(x & 0); - // CHECK: opaque::(_1) + // CHECK: opaque::(copy _1) opaque(x & u64::MAX); - // CHECK: opaque::(_1) + // CHECK: opaque::(copy _1) opaque(x | 0); // CHECK: opaque::(const u64::MAX) opaque(x | u64::MAX); - // CHECK: opaque::(_1) + // CHECK: opaque::(copy _1) opaque(x ^ 0); // CHECK: opaque::(const 0_u64) opaque(x ^ x); - // CHECK: opaque::(_1) + // CHECK: opaque::(copy _1) opaque(x >> 0); - // CHECK: opaque::(_1) + // CHECK: opaque::(copy _1) opaque(x << 0); } @@ -255,10 +255,10 @@ fn comparison(x: u64, y: u64) { opaque(x == x); // CHECK: opaque::(const false) opaque(x != x); - // CHECK: [[eqxy:_.*]] = Eq(_1, _2); + // CHECK: [[eqxy:_.*]] = Eq(copy _1, copy _2); // CHECK: opaque::(move [[eqxy]]) opaque(x == y); - // CHECK: [[nexy:_.*]] = Ne(_1, _2); + // CHECK: [[nexy:_.*]] = Ne(copy _1, copy _2); // CHECK: opaque::(move [[nexy]]) opaque(x != y); } @@ -268,10 +268,10 @@ fn comparison(x: u64, y: u64) { fn arithmetic_checked(x: u64) { // CHECK-LABEL: fn arithmetic_checked( // CHECK: assert(!const false, - // CHECK: opaque::(_1) + // CHECK: opaque::(copy _1) opaque(x + 0); // CHECK: assert(!const false, - // CHECK: opaque::(_1) + // CHECK: opaque::(copy _1) opaque(x - 0); // CHECK: assert(!const false, // CHECK: opaque::(const 0_u64) @@ -280,39 +280,39 @@ fn arithmetic_checked(x: u64) { // CHECK: opaque::(const 0_u64) opaque(x * 0); // CHECK: assert(!const false, - // CHECK: opaque::(_1) + // CHECK: opaque::(copy _1) opaque(x * 1); } /// Verify that we do not apply arithmetic simplifications on floats. fn arithmetic_float(x: f64) { // CHECK-LABEL: fn arithmetic_float( - // CHECK: [[add:_.*]] = Add(_1, const 0f64); + // CHECK: [[add:_.*]] = Add(copy _1, const 0f64); // CHECK: opaque::(move [[add]]) opaque(x + 0.); - // CHECK: [[sub:_.*]] = Sub(_1, const 0f64); + // CHECK: [[sub:_.*]] = Sub(copy _1, const 0f64); // CHECK: opaque::(move [[sub]]) opaque(x - 0.); - // CHECK: [[mul:_.*]] = Mul(_1, const 0f64); + // CHECK: [[mul:_.*]] = Mul(copy _1, const 0f64); // CHECK: opaque::(move [[mul]]) opaque(x * 0.); - // CHECK: [[div0:_.*]] = Div(_1, const 0f64); + // CHECK: [[div0:_.*]] = Div(copy _1, const 0f64); // CHECK: opaque::(move [[div0]]) opaque(x / 0.); - // CHECK: [[zdiv:_.*]] = Div(const 0f64, _1); + // CHECK: [[zdiv:_.*]] = Div(const 0f64, copy _1); // CHECK: opaque::(move [[zdiv]]) opaque(0. / x); - // CHECK: [[rem0:_.*]] = Rem(_1, const 0f64); + // CHECK: [[rem0:_.*]] = Rem(copy _1, const 0f64); // CHECK: opaque::(move [[rem0]]) opaque(x % 0.); - // CHECK: [[zrem:_.*]] = Rem(const 0f64, _1); + // CHECK: [[zrem:_.*]] = Rem(const 0f64, copy _1); // CHECK: opaque::(move [[zrem]]) opaque(0. % x); // Those are not simplifiable to `true`/`false`, thanks to NaNs. - // CHECK: [[eq:_.*]] = Eq(_1, _1); + // CHECK: [[eq:_.*]] = Eq(copy _1, copy _1); // CHECK: opaque::(move [[eq]]) opaque(x == x); - // CHECK: [[ne:_.*]] = Ne(_1, _1); + // CHECK: [[ne:_.*]] = Ne(copy _1, copy _1); // CHECK: opaque::(move [[ne]]) opaque(x != x); } @@ -386,36 +386,36 @@ fn cast() { fn multiple_branches(t: bool, x: u8, y: u8) { // CHECK-LABEL: fn multiple_branches( - // CHECK: switchInt(_1) -> [0: [[bbf:bb.*]], otherwise: [[bbt:bb.*]]]; + // CHECK: switchInt(copy _1) -> [0: [[bbf:bb.*]], otherwise: [[bbt:bb.*]]]; if t { // CHECK: [[bbt]]: { - // CHECK: [[a:_.*]] = Add(_2, _3); - // CHECK: opaque::([[a]]) - // CHECK: opaque::([[a]]) + // CHECK: [[a:_.*]] = Add(copy _2, copy _3); + // CHECK: opaque::(copy [[a]]) + // CHECK: opaque::(copy [[a]]) // CHECK: goto -> [[bbc:bb.*]]; opaque(x + y); opaque(x + y); } else { // CHECK: [[bbf]]: { - // CHECK: [[b:_.*]] = Add(_2, _3); - // CHECK: opaque::([[b]]) - // CHECK: opaque::([[b]]) + // CHECK: [[b:_.*]] = Add(copy _2, copy _3); + // CHECK: opaque::(copy [[b]]) + // CHECK: opaque::(copy [[b]]) // CHECK: goto -> [[bbc:bb.*]]; opaque(x + y); opaque(x + y); } // Neither `a` nor `b` dominate `c`, so we cannot reuse any of them. // CHECK: [[bbc]]: { - // CHECK: [[c:_.*]] = Add(_2, _3); - // CHECK: opaque::([[c]]) + // CHECK: [[c:_.*]] = Add(copy _2, copy _3); + // CHECK: opaque::(copy [[c]]) opaque(x + y); // `c` dominates both calls, so we can reuse it. if t { - // CHECK: opaque::([[c]]) + // CHECK: opaque::(copy [[c]]) opaque(x + y); } else { - // CHECK: opaque::([[c]]) + // CHECK: opaque::(copy [[c]]) opaque(x + y); } } @@ -469,18 +469,18 @@ fn dereferences(t: &mut u32, u: &impl Copy, s: &S) { // CHECK-LABEL: fn dereferences( // Do not reuse dereferences of `&mut`. - // CHECK: [[st1:_.*]] = (*_1); + // CHECK: [[st1:_.*]] = copy (*_1); // CHECK: opaque::(move [[st1]]) - // CHECK: [[st2:_.*]] = (*_1); + // CHECK: [[st2:_.*]] = copy (*_1); // CHECK: opaque::(move [[st2]]) opaque(*t); opaque(*t); // Do not reuse dereferences of `*const`. // CHECK: [[raw:_.*]] = &raw const (*_1); - // CHECK: [[st3:_.*]] = (*[[raw]]); + // CHECK: [[st3:_.*]] = copy (*[[raw]]); // CHECK: opaque::(move [[st3]]) - // CHECK: [[st4:_.*]] = (*[[raw]]); + // CHECK: [[st4:_.*]] = copy (*[[raw]]); // CHECK: opaque::(move [[st4]]) let z = &raw const *t; unsafe { opaque(*z) }; @@ -488,9 +488,9 @@ fn dereferences(t: &mut u32, u: &impl Copy, s: &S) { // Do not reuse dereferences of `*mut`. // CHECK: [[ptr:_.*]] = &raw mut (*_1); - // CHECK: [[st5:_.*]] = (*[[ptr]]); + // CHECK: [[st5:_.*]] = copy (*[[ptr]]); // CHECK: opaque::(move [[st5]]) - // CHECK: [[st6:_.*]] = (*[[ptr]]); + // CHECK: [[st6:_.*]] = copy (*[[ptr]]); // CHECK: opaque::(move [[st6]]) let z = &raw mut *t; unsafe { opaque(*z) }; @@ -498,9 +498,9 @@ fn dereferences(t: &mut u32, u: &impl Copy, s: &S) { // We can reuse dereferences of `&Freeze`. // CHECK: [[ref:_.*]] = &(*_1); - // CHECK: [[st7:_.*]] = (*[[ref]]); - // CHECK: opaque::([[st7]]) - // CHECK: opaque::([[st7]]) + // CHECK: [[st7:_.*]] = copy (*[[ref]]); + // CHECK: opaque::(copy [[st7]]) + // CHECK: opaque::(copy [[st7]]) let z = &*t; opaque(*z); opaque(*z); @@ -510,17 +510,17 @@ fn dereferences(t: &mut u32, u: &impl Copy, s: &S) { opaque(&*z); // `*u` is not Freeze, so we cannot reuse. - // CHECK: [[st8:_.*]] = (*_2); + // CHECK: [[st8:_.*]] = copy (*_2); // CHECK: opaque::(move [[st8]]) - // CHECK: [[st9:_.*]] = (*_2); + // CHECK: [[st9:_.*]] = copy (*_2); // CHECK: opaque::(move [[st9]]) opaque(*u); opaque(*u); - // `*s` is not Copy, by `(*s).0` is, so we can reuse. - // CHECK: [[st10:_.*]] = ((*_3).0: u32); - // CHECK: opaque::([[st10]]) - // CHECK: opaque::([[st10]]) + // `*s` is not Copy, but `(*s).0` is, so we can reuse. + // CHECK: [[st10:_.*]] = copy ((*_3).0: u32); + // CHECK: opaque::(copy [[st10]]) + // CHECK: opaque::(copy [[st10]]) opaque(s.0); opaque(s.0); } @@ -551,38 +551,38 @@ fn duplicate_slice() -> (bool, bool) { let d: &str; { // CHECK: [[a:_.*]] = (const "a",); - // CHECK: [[au:_.*]] = ([[a]].0: &str) as u128 (Transmute); + // CHECK: [[au:_.*]] = copy ([[a]].0: &str) as u128 (Transmute); let a = ("a",); Call(au = transmute::<_, u128>(a.0), ReturnTo(bb1), UnwindContinue()) } bb1 = { - // CHECK: [[c:_.*]] = identity::<&str>(([[a]].0: &str)) + // CHECK: [[c:_.*]] = identity::<&str>(copy ([[a]].0: &str)) Call(c = identity(a.0), ReturnTo(bb2), UnwindContinue()) } bb2 = { - // CHECK: [[cu:_.*]] = [[c]] as u128 (Transmute); + // CHECK: [[cu:_.*]] = copy [[c]] as u128 (Transmute); Call(cu = transmute::<_, u128>(c), ReturnTo(bb3), UnwindContinue()) } bb3 = { // This slice is different from `a.0`. Hence `bu` is not `au`. // CHECK: [[b:_.*]] = const "a"; - // CHECK: [[bu:_.*]] = [[b]] as u128 (Transmute); + // CHECK: [[bu:_.*]] = copy [[b]] as u128 (Transmute); let b = "a"; Call(bu = transmute::<_, u128>(b), ReturnTo(bb4), UnwindContinue()) } bb4 = { // This returns a copy of `b`, which is not `a`. - // CHECK: [[d:_.*]] = identity::<&str>([[b]]) + // CHECK: [[d:_.*]] = identity::<&str>(copy [[b]]) Call(d = identity(b), ReturnTo(bb5), UnwindContinue()) } bb5 = { - // CHECK: [[du:_.*]] = [[d]] as u128 (Transmute); + // CHECK: [[du:_.*]] = copy [[d]] as u128 (Transmute); Call(du = transmute::<_, u128>(d), ReturnTo(bb6), UnwindContinue()) } bb6 = { // `direct` must not fold to `true`, as `indirect` will not. - // CHECK: = Eq([[au]], [[bu]]); - // CHECK: = Eq([[cu]], [[du]]); + // CHECK: = Eq(copy [[au]], copy [[bu]]); + // CHECK: = Eq(copy [[cu]], copy [[du]]); let direct = au == bu; let indirect = cu == du; RET = (direct, indirect); @@ -602,21 +602,21 @@ fn repeat() { fn fn_pointers() { // CHECK-LABEL: fn fn_pointers( // CHECK: [[f:_.*]] = identity:: as fn(u8) -> u8 (PointerCoercion(ReifyFnPointer - // CHECK: opaque:: u8>([[f]]) + // CHECK: opaque:: u8>(copy [[f]]) let f = identity as fn(u8) -> u8; opaque(f); // CHECK: [[g:_.*]] = identity:: as fn(u8) -> u8 (PointerCoercion(ReifyFnPointer - // CHECK: opaque:: u8>([[g]]) + // CHECK: opaque:: u8>(copy [[g]]) let g = identity as fn(u8) -> u8; opaque(g); // CHECK: [[cf:_.*]] = const {{.*}} as fn() (PointerCoercion(ClosureFnPointer - // CHECK: opaque::([[cf]]) + // CHECK: opaque::(copy [[cf]]) let closure = || {}; let cf = closure as fn(); opaque(cf); // CHECK: [[cg:_.*]] = const {{.*}} as fn() (PointerCoercion(ClosureFnPointer - // CHECK: opaque::([[cg]]) + // CHECK: opaque::(copy [[cg]]) let cg = closure as fn(); opaque(cg); } @@ -642,9 +642,9 @@ fn constant_index_overflow(x: &[T]) { // CHECK: debug b => [[b:_.*]]; // CHECK: [[a]] = const usize::MAX; // CHECK-NOT: = (*_1)[{{.*}} of 0]; - // CHECK: [[b]] = (*_1)[[[a]]]; + // CHECK: [[b]] = copy (*_1)[[[a]]]; // CHECK-NOT: = (*_1)[{{.*}} of 0]; - // CHECK: [[b]] = (*_1)[0 of 1]; + // CHECK: [[b]] = copy (*_1)[0 of 1]; // CHECK-NOT: = (*_1)[{{.*}} of 0]; let a = u64::MAX as usize; let b = if a < x.len() { x[a] } else { x[0] }; @@ -657,22 +657,22 @@ fn wide_ptr_provenance() { let a: *const dyn Send = &1 as &dyn Send; let b: *const dyn Send = &1 as &dyn Send; - // CHECK: [[eqp:_.*]] = Eq([[a:_.*]], [[b:_.*]]); + // CHECK: [[eqp:_.*]] = Eq(copy [[a:_.*]], copy [[b:_.*]]); // CHECK: opaque::(move [[eqp]]) opaque(a == b); - // CHECK: [[nep:_.*]] = Ne([[a]], [[b]]); + // CHECK: [[nep:_.*]] = Ne(copy [[a]], copy [[b]]); // CHECK: opaque::(move [[nep]]) opaque(a != b); - // CHECK: [[ltp:_.*]] = Lt([[a]], [[b]]); + // CHECK: [[ltp:_.*]] = Lt(copy [[a]], copy [[b]]); // CHECK: opaque::(move [[ltp]]) opaque(a < b); - // CHECK: [[lep:_.*]] = Le([[a]], [[b]]); + // CHECK: [[lep:_.*]] = Le(copy [[a]], copy [[b]]); // CHECK: opaque::(move [[lep]]) opaque(a <= b); - // CHECK: [[gtp:_.*]] = Gt([[a]], [[b]]); + // CHECK: [[gtp:_.*]] = Gt(copy [[a]], copy [[b]]); // CHECK: opaque::(move [[gtp]]) opaque(a > b); - // CHECK: [[gep:_.*]] = Ge([[a]], [[b]]); + // CHECK: [[gep:_.*]] = Ge(copy [[a]], copy [[b]]); // CHECK: opaque::(move [[gep]]) opaque(a >= b); } @@ -684,22 +684,22 @@ fn wide_ptr_same_provenance() { let a: *const dyn Send = &slice[0] as &dyn Send; let b: *const dyn Send = &slice[1] as &dyn Send; - // CHECK: [[eqp:_.*]] = Eq([[a:_.*]], [[b:_.*]]); + // CHECK: [[eqp:_.*]] = Eq(copy [[a:_.*]], copy [[b:_.*]]); // CHECK: opaque::(move [[eqp]]) opaque(a == b); - // CHECK: [[nep:_.*]] = Ne([[a]], [[b]]); + // CHECK: [[nep:_.*]] = Ne(copy [[a]], copy [[b]]); // CHECK: opaque::(move [[nep]]) opaque(a != b); - // CHECK: [[ltp:_.*]] = Lt([[a]], [[b]]); + // CHECK: [[ltp:_.*]] = Lt(copy [[a]], copy [[b]]); // CHECK: opaque::(move [[ltp]]) opaque(a < b); - // CHECK: [[lep:_.*]] = Le([[a]], [[b]]); + // CHECK: [[lep:_.*]] = Le(copy [[a]], copy [[b]]); // CHECK: opaque::(move [[lep]]) opaque(a <= b); - // CHECK: [[gtp:_.*]] = Gt([[a]], [[b]]); + // CHECK: [[gtp:_.*]] = Gt(copy [[a]], copy [[b]]); // CHECK: opaque::(move [[gtp]]) opaque(a > b); - // CHECK: [[gep:_.*]] = Ge([[a]], [[b]]); + // CHECK: [[gep:_.*]] = Ge(copy [[a]], copy [[b]]); // CHECK: opaque::(move [[gep]]) opaque(a >= b); } @@ -731,13 +731,13 @@ fn wide_ptr_integer() { fn borrowed(x: T) { // CHECK-LABEL: fn borrowed( // CHECK: bb0: { - // CHECK-NEXT: _2 = _1; + // CHECK-NEXT: _2 = copy _1; // CHECK-NEXT: _3 = &_1; - // CHECK-NEXT: _0 = opaque::<&T>(_3) + // CHECK-NEXT: _0 = opaque::<&T>(copy _3) // CHECK: bb1: { - // CHECK-NEXT: _0 = opaque::(_1) + // CHECK-NEXT: _0 = opaque::(copy _1) // CHECK: bb2: { - // CHECK-NEXT: _0 = opaque::(_1) + // CHECK-NEXT: _0 = opaque::(copy _1) mir! { { let a = x; @@ -761,13 +761,13 @@ fn borrowed(x: T) { fn non_freeze(x: T) { // CHECK-LABEL: fn non_freeze( // CHECK: bb0: { - // CHECK-NEXT: _2 = _1; + // CHECK-NEXT: _2 = copy _1; // CHECK-NEXT: _3 = &_1; - // CHECK-NEXT: _0 = opaque::<&T>(_3) + // CHECK-NEXT: _0 = opaque::<&T>(copy _3) // CHECK: bb1: { - // CHECK-NEXT: _0 = opaque::(_2) + // CHECK-NEXT: _0 = opaque::(copy _2) // CHECK: bb2: { - // CHECK-NEXT: _0 = opaque::((*_3)) + // CHECK-NEXT: _0 = opaque::(copy (*_3)) mir! { { let a = x; @@ -789,7 +789,7 @@ fn non_freeze(x: T) { // Check that we can const-prop into `from_raw_parts` fn slice_const_length(x: &[i32]) -> *const [i32] { // CHECK-LABEL: fn slice_const_length( - // CHECK: _0 = *const [i32] from ({{_[0-9]+}}, const 123_usize); + // CHECK: _0 = *const [i32] from (copy {{_[0-9]+}}, const 123_usize); let ptr = x.as_ptr(); let len = 123; std::intrinsics::aggregate_raw_ptr(ptr, len) @@ -804,15 +804,15 @@ fn meta_of_ref_to_slice(x: *const i32) -> usize { fn slice_from_raw_parts_as_ptr(x: *const u16, n: usize) -> (*const u16, *const f32) { // CHECK-LABEL: fn slice_from_raw_parts_as_ptr - // CHECK: _8 = _1 as *const f32 (PtrToPtr); - // CHECK: _0 = (_1, move _8); + // CHECK: _8 = copy _1 as *const f32 (PtrToPtr); + // CHECK: _0 = (copy _1, move _8); let ptr: *const [u16] = std::intrinsics::aggregate_raw_ptr(x, n); (ptr as *const u16, ptr as *const f32) } fn casts_before_aggregate_raw_ptr(x: *const u32) -> *const [u8] { // CHECK-LABEL: fn casts_before_aggregate_raw_ptr - // CHECK: _0 = *const [u8] from (_1, const 4_usize); + // CHECK: _0 = *const [u8] from (copy _1, const 4_usize); let x = x as *const [u8; 4]; let x = x as *const u8; let x = x as *const (); @@ -821,7 +821,7 @@ fn casts_before_aggregate_raw_ptr(x: *const u32) -> *const [u8] { fn manual_slice_mut_len(x: &mut [i32]) -> usize { // CHECK-LABEL: fn manual_slice_mut_len - // CHECK: _0 = PtrMetadata(_1); + // CHECK: _0 = PtrMetadata(copy _1); let x: *mut [i32] = x; let x: *const [i32] = x; std::intrinsics::ptr_metadata(x) @@ -844,38 +844,38 @@ fn generic_cast_metadata(ps: *const [T], pa: *const A, // when the pointee metadata do or don't match, respectively. // Metadata usize -> (), do not optimize. - // CHECK: [[T:_.+]] = _1 as - // CHECK-NEXT: PtrMetadata([[T]]) + // CHECK: [[T:_.+]] = copy _1 as + // CHECK-NEXT: PtrMetadata(copy [[T]]) let t1 = CastPtrToPtr::<_, *const T>(ps); let m1 = PtrMetadata(t1); // `(&A, [T])` has `usize` metadata, same as `[T]`, yes optimize. - // CHECK: [[T:_.+]] = _1 as - // CHECK-NEXT: PtrMetadata(_1) + // CHECK: [[T:_.+]] = copy _1 as + // CHECK-NEXT: PtrMetadata(copy _1) let t2 = CastPtrToPtr::<_, *const (&A, [T])>(ps); let m2 = PtrMetadata(t2); // Tail `A` and tail `B`, do not optimize. - // CHECK: [[T:_.+]] = _2 as - // CHECK-NEXT: PtrMetadata([[T]]) + // CHECK: [[T:_.+]] = copy _2 as + // CHECK-NEXT: PtrMetadata(copy [[T]]) let t3 = CastPtrToPtr::<_, *const (T, B)>(pa); let m3 = PtrMetadata(t3); // Both have tail `A`, yes optimize. - // CHECK: [[T:_.+]] = _2 as - // CHECK-NEXT: PtrMetadata(_2) + // CHECK: [[T:_.+]] = copy _2 as + // CHECK-NEXT: PtrMetadata(copy _2) let t4 = CastPtrToPtr::<_, *const (T, A)>(pa); let m4 = PtrMetadata(t4); // Tail `B` and tail `A`, do not optimize. - // CHECK: [[T:_.+]] = _3 as - // CHECK-NEXT: PtrMetadata([[T]]) + // CHECK: [[T:_.+]] = copy _3 as + // CHECK-NEXT: PtrMetadata(copy [[T]]) let t5 = CastPtrToPtr::<_, *mut A>(pb); let m5 = PtrMetadata(t5); // Both have tail `B`, yes optimize. - // CHECK: [[T:_.+]] = _3 as - // CHECK-NEXT: PtrMetadata(_3) + // CHECK: [[T:_.+]] = copy _3 as + // CHECK-NEXT: PtrMetadata(copy _3) let t6 = CastPtrToPtr::<_, *mut B>(pb); let m6 = PtrMetadata(t6); @@ -891,21 +891,21 @@ fn cast_pointer_eq(p1: *mut u8, p2: *mut u32, p3: *mut u32, p4: *mut [u32]) { // CHECK: debug p3 => [[P3:_3]]; // CHECK: debug p4 => [[P4:_4]]; - // CHECK: [[M1:_.+]] = [[P1]] as *const u32 (PtrToPtr); - // CHECK: [[M2:_.+]] = [[P2]] as *const u32 (PtrToPtr); - // CHECK: [[M3:_.+]] = [[P3]] as *const u32 (PtrToPtr); - // CHECK: [[M4:_.+]] = [[P4]] as *const u32 (PtrToPtr); + // CHECK: [[M1:_.+]] = copy [[P1]] as *const u32 (PtrToPtr); + // CHECK: [[M2:_.+]] = copy [[P2]] as *const u32 (PtrToPtr); + // CHECK: [[M3:_.+]] = copy [[P3]] as *const u32 (PtrToPtr); + // CHECK: [[M4:_.+]] = copy [[P4]] as *const u32 (PtrToPtr); let m1 = p1 as *const u32; let m2 = p2 as *const u32; let m3 = p3 as *const u32; let m4 = p4 as *const u32; // CHECK-NOT: Eq - // CHECK: Eq([[M1]], [[M2]]) + // CHECK: Eq(copy [[M1]], copy [[M2]]) // CHECK-NOT: Eq - // CHECK: Eq([[P2]], [[P3]]) + // CHECK: Eq(copy [[P2]], copy [[P3]]) // CHECK-NOT: Eq - // CHECK: Eq([[M3]], [[M4]]) + // CHECK: Eq(copy [[M3]], copy [[M4]]) // CHECK-NOT: Eq let eq_different_thing = m1 == m2; let eq_optimize = m2 == m3; @@ -918,11 +918,11 @@ fn cast_pointer_eq(p1: *mut u8, p2: *mut u32, p3: *mut u32, p4: *mut [u32]) { unsafe fn cast_pointer_then_transmute(thin: *mut u32, fat: *mut [u8]) { // CHECK-LABEL: fn cast_pointer_then_transmute - // CHECK: [[UNUSED:_.+]] = _1 as *const () (PtrToPtr); - // CHECK: = _1 as usize (Transmute); + // CHECK: [[UNUSED:_.+]] = copy _1 as *const () (PtrToPtr); + // CHECK: = copy _1 as usize (Transmute); let thin_addr: usize = std::intrinsics::transmute(thin as *const ()); - // CHECK: [[TEMP2:_.+]] = _2 as *const () (PtrToPtr); + // CHECK: [[TEMP2:_.+]] = copy _2 as *const () (PtrToPtr); // CHECK: = move [[TEMP2]] as usize (Transmute); let fat_addr: usize = std::intrinsics::transmute(fat as *const ()); } @@ -935,11 +935,11 @@ fn remove_casts_must_change_both_sides(mut_a: &*mut u8, mut_b: *mut u8) -> bool // to be locals, so make sure we don't change one without the other, as // that would be a type error. { - // CHECK: [[A:_.+]] = (*_1) as *const u8 (PtrToPtr); + // CHECK: [[A:_.+]] = copy (*_1) as *const u8 (PtrToPtr); let a = *mut_a as *const u8; - // CHECK: [[B:_.+]] = _2 as *const u8 (PtrToPtr); + // CHECK: [[B:_.+]] = copy _2 as *const u8 (PtrToPtr); let b = mut_b as *const u8; - // CHECK: _0 = Eq([[A]], [[B]]); + // CHECK: _0 = Eq(copy [[A]], copy [[B]]); RET = a == b; Return() } diff --git a/tests/mir-opt/gvn_copy_moves.rs b/tests/mir-opt/gvn_copy_moves.rs index 1812de16d69fd..b1fe2caf3a143 100644 --- a/tests/mir-opt/gvn_copy_moves.rs +++ b/tests/mir-opt/gvn_copy_moves.rs @@ -18,9 +18,9 @@ fn fn0() { // CHECK-NEXT: _1 = const 1_usize; // CHECK-NEXT: _2 = [const 42_u128; 6]; // CHECK-NEXT: _2[1 of 2] = const 1_u128; - // CHECK-NEXT: _3 = (_2,); - // CHECK-NEXT: _4 = _3; - // CHECK-NEXT: _5 = fn1((_3.0: [u128; 6]), _3) + // CHECK-NEXT: _3 = (copy _2,); + // CHECK-NEXT: _4 = copy _3; + // CHECK-NEXT: _5 = fn1(copy (_3.0: [u128; 6]), copy _3) a = 1_usize; b = [42; 6]; b[a] = 1; diff --git a/tests/mir-opt/instsimplify/casts.rs b/tests/mir-opt/instsimplify/casts.rs index 24dbb67b42d1a..27308ee52bc2c 100644 --- a/tests/mir-opt/instsimplify/casts.rs +++ b/tests/mir-opt/instsimplify/casts.rs @@ -19,7 +19,7 @@ pub fn redundant<'a, 'b: 'a>(x: *const &'a u8) -> *const &'a u8 { // EMIT_MIR casts.roundtrip.InstSimplify-after-simplifycfg.diff pub fn roundtrip(x: *const u8) -> *const u8 { // CHECK-LABEL: fn roundtrip( - // CHECK: _4 = _1; + // CHECK: _4 = copy _1; // CHECK: _3 = move _4 as *mut u8 (PtrToPtr); // CHECK: _2 = move _3 as *const u8 (PtrToPtr); x as *mut u8 as *const u8 @@ -28,7 +28,7 @@ pub fn roundtrip(x: *const u8) -> *const u8 { // EMIT_MIR casts.roundtrip.InstSimplify-after-simplifycfg.diff pub fn cast_thin_via_aggregate(x: *const u8) -> *const () { // CHECK-LABEL: fn cast_thin_via_aggregate( - // CHECK: _2 = _1; + // CHECK: _2 = copy _1; // CHECK: _0 = move _2 as *const () (PtrToPtr); std::intrinsics::aggregate_raw_ptr(x, ()) } diff --git a/tests/mir-opt/instsimplify/ref_of_deref.rs b/tests/mir-opt/instsimplify/ref_of_deref.rs index dc0f5f8198bc7..5ba9bafaea2a4 100644 --- a/tests/mir-opt/instsimplify/ref_of_deref.rs +++ b/tests/mir-opt/instsimplify/ref_of_deref.rs @@ -8,11 +8,11 @@ // EMIT_MIR ref_of_deref.references.InstSimplify-after-simplifycfg.diff // CHECK-LABEL: references pub fn references(const_ref: &i32, mut_ref: &mut [i32]) { - // CHECK: _3 = _1; + // CHECK: _3 = copy _1; let _a = &*const_ref; // CHECK: _4 = &(*_2); let _b = &*mut_ref; - // CHECK: _5 = _2; + // CHECK: _5 = copy _2; let _c = &mut *mut_ref; // CHECK: _6 = &raw const (*_1); let _d = &raw const *const_ref; @@ -31,10 +31,10 @@ pub unsafe fn pointers(const_ptr: *const [i32], mut_ptr: *mut i32) { let _b = &*mut_ptr; // CHECK: _5 = &mut (*_2); let _c = &mut *mut_ptr; - // CHECK: _6 = _1; + // CHECK: _6 = copy _1; let _d = &raw const *const_ptr; // CHECK: _7 = &raw const (*_2); let _e = &raw const *mut_ptr; - // CHECK: _8 = _2; + // CHECK: _8 = copy _2; let _f = &raw mut *mut_ptr; } diff --git a/tests/mir-opt/instsimplify/ub_check.rs b/tests/mir-opt/instsimplify/ub_check.rs index ee72511c132de..b513f60dc7b94 100644 --- a/tests/mir-opt/instsimplify/ub_check.rs +++ b/tests/mir-opt/instsimplify/ub_check.rs @@ -6,7 +6,7 @@ pub fn unwrap_unchecked(x: Option) -> i32 { // CHECK-LABEL: fn unwrap_unchecked( // CHECK-NOT: UbChecks() // CHECK: [[assume:_.*]] = const false; - // CHECK-NEXT: assume([[assume]]); + // CHECK-NEXT: assume(copy [[assume]]); // CHECK-NEXT: unreachable_unchecked::precondition_check unsafe { x.unwrap_unchecked() } } diff --git a/tests/mir-opt/jump_threading.rs b/tests/mir-opt/jump_threading.rs index 6486a321e693e..9487a4e7e5ffe 100644 --- a/tests/mir-opt/jump_threading.rs +++ b/tests/mir-opt/jump_threading.rs @@ -24,11 +24,11 @@ fn too_complex(x: Result) -> Option { // CHECK: bb4: { // CHECK: goto -> bb6; // CHECK: bb5: { - // CHECK: {{_.*}} = (([[controlflow]] as Break).0: usize); + // CHECK: {{_.*}} = copy (([[controlflow]] as Break).0: usize); // CHECK: _0 = Option::::None; // CHECK: goto -> bb7; // CHECK: bb6: { - // CHECK: {{_.*}} = (([[controlflow]] as Continue).0: i32); + // CHECK: {{_.*}} = copy (([[controlflow]] as Continue).0: i32); // CHECK: _0 = Option::::Some( // CHECK: goto -> bb7; // CHECK: bb7: { @@ -49,16 +49,16 @@ fn too_complex(x: Result) -> Option { fn identity(x: Result) -> Result { // CHECK-LABEL: fn identity( // CHECK: bb0: { - // CHECK: [[x:_.*]] = _1; + // CHECK: [[x:_.*]] = copy _1; // CHECK: switchInt(move {{_.*}}) -> [0: bb7, 1: bb6, otherwise: bb1]; // CHECK: bb1: { // CHECK: unreachable; // CHECK: bb2: { - // CHECK: {{_.*}} = (([[controlflow:_.*]] as Continue).0: i32); + // CHECK: {{_.*}} = copy (([[controlflow:_.*]] as Continue).0: i32); // CHECK: _0 = Result::::Ok( // CHECK: goto -> bb4; // CHECK: bb3: { - // CHECK: {{_.*}} = (([[controlflow]] as Break).0: std::result::Result); + // CHECK: {{_.*}} = copy (([[controlflow]] as Break).0: std::result::Result); // CHECK: _0 = Result::::Err( // CHECK: goto -> bb4; // CHECK: bb4: { @@ -160,13 +160,13 @@ fn multiple_match(x: u8) -> u8 { mir! { { // CHECK: bb0: { - // CHECK: switchInt([[x:_.*]]) -> [3: bb1, otherwise: bb2]; + // CHECK: switchInt(copy [[x:_.*]]) -> [3: bb1, otherwise: bb2]; match x { 3 => bb1, _ => bb2 } } bb1 = { // We know `x == 3`, so we can take `bb3`. // CHECK: bb1: { - // CHECK: {{_.*}} = [[x]]; + // CHECK: {{_.*}} = copy [[x]]; // CHECK: goto -> bb3; let y = x; match y { 3 => bb3, _ => bb4 } @@ -174,7 +174,7 @@ fn multiple_match(x: u8) -> u8 { bb2 = { // We know `x != 3`, so we can take `bb6`. // CHECK: bb2: { - // CHECK: [[z:_.*]] = [[x]]; + // CHECK: [[z:_.*]] = copy [[x]]; // CHECK: goto -> bb6; let z = x; match z { 3 => bb5, _ => bb6 } @@ -203,7 +203,7 @@ fn multiple_match(x: u8) -> u8 { bb6 = { // We know `z != 3`, so we CANNOT take `bb7`. // CHECK: bb6: { - // CHECK: switchInt([[z]]) -> [1: bb7, otherwise: bb8]; + // CHECK: switchInt(copy [[z]]) -> [1: bb7, otherwise: bb8]; match z { 1 => bb7, _ => bb8 } } bb7 = { @@ -467,12 +467,12 @@ fn assume(a: u8, b: bool) -> u8 { mir! { { // CHECK: bb0: { - // CHECK-NEXT: switchInt(_1) -> [7: bb1, otherwise: bb2] + // CHECK-NEXT: switchInt(copy _1) -> [7: bb1, otherwise: bb2] match a { 7 => bb1, _ => bb2 } } bb1 = { // CHECK: bb1: { - // CHECK-NEXT: assume(_2); + // CHECK-NEXT: assume(copy _2); // CHECK-NEXT: goto -> bb6; Assume(b); Goto(bb3) @@ -484,7 +484,7 @@ fn assume(a: u8, b: bool) -> u8 { } bb3 = { // CHECK: bb3: { - // CHECK-NEXT: switchInt(_2) -> [0: bb4, otherwise: bb5]; + // CHECK-NEXT: switchInt(copy _2) -> [0: bb4, otherwise: bb5]; match b { false => bb4, _ => bb5 } } bb4 = { diff --git a/tests/mir-opt/lower_array_len.rs b/tests/mir-opt/lower_array_len.rs index f7ed376726c8f..6553343cbf031 100644 --- a/tests/mir-opt/lower_array_len.rs +++ b/tests/mir-opt/lower_array_len.rs @@ -6,7 +6,7 @@ pub fn array_bound(index: usize, slice: &[u8; N]) -> u8 { // CHECK-LABEL: fn array_bound( // CHECK-NOT: Lt - // CHECK: Lt(_1, const N); + // CHECK: Lt(copy _1, const N); // CHECK-NOT: Lt if index < slice.len() { slice[index] } else { 42 } } @@ -15,7 +15,7 @@ pub fn array_bound(index: usize, slice: &[u8; N]) -> u8 { pub fn array_bound_mut(index: usize, slice: &mut [u8; N]) -> u8 { // CHECK-LABEL: fn array_bound_mut( // CHECK-NOT: Lt - // CHECK: Lt(_1, const N); + // CHECK: Lt(copy _1, const N); // CHECK-NOT: Lt // CHECK: Lt(const 0_usize, const N) // CHECK-NOT: Lt diff --git a/tests/mir-opt/lower_intrinsics.rs b/tests/mir-opt/lower_intrinsics.rs index 2569f4f4de5df..4859d93546196 100644 --- a/tests/mir-opt/lower_intrinsics.rs +++ b/tests/mir-opt/lower_intrinsics.rs @@ -197,7 +197,7 @@ pub fn with_overflow(a: i32, b: i32) { pub fn read_via_copy_primitive(r: &i32) -> i32 { // CHECK-LABEL: fn read_via_copy_primitive( // CHECK: [[tmp:_.*]] = &raw const (*_1); - // CHECK: _0 = (*[[tmp]]); + // CHECK: _0 = copy (*[[tmp]]); // CHECK: return; unsafe { core::intrinsics::read_via_copy(r) } @@ -207,7 +207,7 @@ pub fn read_via_copy_primitive(r: &i32) -> i32 { pub fn read_via_copy_uninhabited(r: &Never) -> Never { // CHECK-LABEL: fn read_via_copy_uninhabited( // CHECK: [[tmp:_.*]] = &raw const (*_1); - // CHECK: _0 = (*[[tmp]]); + // CHECK: _0 = copy (*[[tmp]]); // CHECK: unreachable; unsafe { core::intrinsics::read_via_copy(r) } diff --git a/tests/mir-opt/pre-codegen/slice_index.rs b/tests/mir-opt/pre-codegen/slice_index.rs index 6ddc4ad022075..574062d6c3569 100644 --- a/tests/mir-opt/pre-codegen/slice_index.rs +++ b/tests/mir-opt/pre-codegen/slice_index.rs @@ -10,17 +10,17 @@ use std::ops::Range; pub fn slice_index_usize(slice: &[u32], index: usize) -> u32 { // CHECK-LABEL: slice_index_usize // CHECK: [[LEN:_[0-9]+]] = Len((*_1)) - // CHECK: Lt(_2, [[LEN]]) + // CHECK: Lt(copy _2, copy [[LEN]]) // CHECK-NOT: precondition_check - // CHECK: _0 = (*_1)[_2]; + // CHECK: _0 = copy (*_1)[_2]; slice[index] } // EMIT_MIR slice_index.slice_get_mut_usize.PreCodegen.after.mir pub fn slice_get_mut_usize(slice: &mut [u32], index: usize) -> Option<&mut u32> { // CHECK-LABEL: slice_get_mut_usize - // CHECK: [[LEN:_[0-9]+]] = PtrMetadata(_1) - // CHECK: Lt(_2, move [[LEN]]) + // CHECK: [[LEN:_[0-9]+]] = PtrMetadata(copy _1) + // CHECK: Lt(copy _2, move [[LEN]]) // CHECK-NOT: precondition_check slice.get_mut(index) } @@ -37,9 +37,9 @@ pub unsafe fn slice_get_unchecked_mut_range(slice: &mut [u32], index: Range(single: &'a T, mut multiple: &'a T) { // CHECK: bb0: { // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &[[a]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let a = 5_usize; let b = &a; // This borrow is only used once. @@ -32,7 +32,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { // CHECK: [[b:_.*]] = &[[a]]; // CHECK: [[btmp:_.*]] = &[[a2]]; // CHECK: [[b]] = move [[btmp]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let a = 5_usize; let a2 = 7_usize; @@ -49,7 +49,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &[[a]]; // CHECK: [[d:_.*]] = &[[b]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let a = 5_usize; let b = &a; @@ -64,7 +64,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &[[a]]; // CHECK: [[d:_.*]] = &raw mut [[b]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let a = 5_usize; let mut b = &a; @@ -78,7 +78,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { // CHECK: bb4: { // CHECK: [[a:_.*]] = const 7_usize; // CHECK: [[b:_.*]] = &[[a]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let a = 7_usize; let b = &a; @@ -91,10 +91,10 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { // CHECK: bb5: { // CHECK: [[a:_.*]] = const 7_usize; // CHECK: [[b1:_.*]] = &[[a]]; - // CHECK: [[c:_.*]] = [[a]]; - // CHECK: [[b2:_.*]] = [[b1]]; - // CHECK: [[c2:_.*]] = [[a]]; - // CHECK: [[b3:_.*]] = [[b2]]; + // CHECK: [[c:_.*]] = copy [[a]]; + // CHECK: [[b2:_.*]] = copy [[b1]]; + // CHECK: [[c2:_.*]] = copy [[a]]; + // CHECK: [[b3:_.*]] = copy [[b2]]; let a = 7_usize; let b1 = &a; @@ -111,7 +111,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { { // CHECK: bb6: { // CHECK-NOT: {{_.*}} = &(*_1); - // CHECK: [[b:_.*]] = (*_1); + // CHECK: [[b:_.*]] = copy (*_1); let a = &*single; let b = *a; // This should be optimized as `*single`. @@ -124,7 +124,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { // CHECK: [[a:_.*]] = &(*_2); // CHECK: [[tmp:_.*]] = &(*_1); // CHECK: _2 = move [[tmp]]; - // CHECK: [[b:_.*]] = (*[[a]]); + // CHECK: [[b:_.*]] = copy (*[[a]]); let a = &*multiple; multiple = &*single; @@ -138,7 +138,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &[[a]]; // CHECK: [[d:_.*]] = &[[b]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let a = 5_usize; let b = &a; @@ -154,7 +154,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { // CHECK: [[b:_.*]] = &[[a]]; // CHECK: [[d:_.*]] = &mut [[b]]; // FIXME this could be [[a]] - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let a = 5_usize; let mut b = &a; @@ -172,7 +172,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: bb0: { // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &mut [[a]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let mut a = 5_usize; let b = &mut a; // This borrow is only used once. @@ -188,7 +188,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: [[b:_.*]] = &mut [[a]]; // CHECK: [[btmp:_.*]] = &mut [[a2]]; // CHECK: [[b]] = move [[btmp]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let mut a2 = 7_usize; @@ -205,7 +205,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &mut [[a]]; // CHECK: [[d:_.*]] = &[[b]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let b = &mut a; @@ -220,7 +220,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &mut [[a]]; // CHECK: [[d:_.*]] = &raw mut [[b]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let mut b = &mut a; @@ -234,7 +234,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: bb4: { // CHECK: [[a:_.*]] = const 7_usize; // CHECK: [[b:_.*]] = &mut [[a]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 7_usize; let b = &mut a; @@ -247,9 +247,9 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: bb5: { // CHECK: [[a:_.*]] = const 7_usize; // CHECK: [[b1:_.*]] = &mut [[a]]; - // CHECK: [[c:_.*]] = (*[[b1]]); + // CHECK: [[c:_.*]] = copy (*[[b1]]); // CHECK: [[b2:_.*]] = move [[b1]]; - // CHECK: [[c2:_.*]] = (*[[b2]]); + // CHECK: [[c2:_.*]] = copy (*[[b2]]); // CHECK: [[b3:_.*]] = move [[b2]]; let mut a = 7_usize; @@ -267,7 +267,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m { // CHECK: bb6: { // CHECK-NOT: {{_.*}} = &(*_1); - // CHECK: [[b:_.*]] = (*_1); + // CHECK: [[b:_.*]] = copy (*_1); let a = &mut *single; let b = *a; // This should be optimized as `*single`. @@ -280,7 +280,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: [[a:_.*]] = &mut (*_2); // CHECK: [[tmp:_.*]] = &mut (*_1); // CHECK: _2 = move [[tmp]]; - // CHECK: [[b:_.*]] = (*[[a]]); + // CHECK: [[b:_.*]] = copy (*[[a]]); let a = &mut *multiple; multiple = &mut *single; @@ -295,7 +295,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: [[b:_.*]] = &mut [[a]]; // CHECK: [[d:_.*]] = &[[b]]; // FIXME this could be [[a]] - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let b = &mut a; @@ -311,7 +311,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: [[b:_.*]] = &mut [[a]]; // CHECK: [[d:_.*]] = &mut [[b]]; // FIXME this could be [[a]] - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let mut b = &mut a; @@ -329,7 +329,7 @@ fn reference_propagation_const_ptr(single: *const T, mut multiple: *con // CHECK: bb0: { // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &raw const [[a]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let a = 5_usize; let b = &raw const a; // This borrow is only used once. @@ -345,7 +345,7 @@ fn reference_propagation_const_ptr(single: *const T, mut multiple: *con // CHECK: [[b:_.*]] = &raw const [[a]]; // CHECK: [[btmp:_.*]] = &raw const [[a2]]; // CHECK: [[b]] = move [[btmp]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let a = 5_usize; let a2 = 7_usize; @@ -362,7 +362,7 @@ fn reference_propagation_const_ptr(single: *const T, mut multiple: *con // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &raw const [[a]]; // CHECK: [[d:_.*]] = &[[b]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let a = 5_usize; let b = &raw const a; @@ -377,7 +377,7 @@ fn reference_propagation_const_ptr(single: *const T, mut multiple: *con // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &raw const [[a]]; // CHECK: [[d:_.*]] = &raw mut [[b]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let a = 5_usize; let mut b = &raw const a; @@ -391,7 +391,7 @@ fn reference_propagation_const_ptr(single: *const T, mut multiple: *con // CHECK: bb4: { // CHECK: [[a:_.*]] = const 7_usize; // CHECK: [[b:_.*]] = &raw const [[a]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let a = 7_usize; let b = &raw const a; @@ -404,10 +404,10 @@ fn reference_propagation_const_ptr(single: *const T, mut multiple: *con // CHECK: bb5: { // CHECK: [[a:_.*]] = const 7_usize; // CHECK: [[b1:_.*]] = &raw const [[a]]; - // CHECK: [[c:_.*]] = [[a]]; - // CHECK: [[b2:_.*]] = [[b1]]; - // CHECK: [[c2:_.*]] = [[a]]; - // CHECK: [[b3:_.*]] = [[b2]]; + // CHECK: [[c:_.*]] = copy [[a]]; + // CHECK: [[b2:_.*]] = copy [[b1]]; + // CHECK: [[c2:_.*]] = copy [[a]]; + // CHECK: [[b3:_.*]] = copy [[b2]]; let a = 7_usize; let b1 = &raw const a; @@ -424,7 +424,7 @@ fn reference_propagation_const_ptr(single: *const T, mut multiple: *con unsafe { // CHECK: bb6: { // CHECK-NOT: {{_.*}} = &(*_1); - // CHECK: [[b:_.*]] = (*_1); + // CHECK: [[b:_.*]] = copy (*_1); let a = &raw const *single; let b = *a; // This should be optimized as `*single`. @@ -437,7 +437,7 @@ fn reference_propagation_const_ptr(single: *const T, mut multiple: *con // CHECK: [[a:_.*]] = &raw const (*_2); // CHECK: [[tmp:_.*]] = &raw const (*_1); // CHECK: _2 = move [[tmp]]; - // CHECK: [[b:_.*]] = (*[[a]]); + // CHECK: [[b:_.*]] = copy (*[[a]]); let a = &raw const *multiple; multiple = &raw const *single; @@ -451,7 +451,7 @@ fn reference_propagation_const_ptr(single: *const T, mut multiple: *con // CHECK: [[a:_.*]] = const 13_usize; // CHECK: [[b:_.*]] = &raw const [[a]]; // CHECK: [[d:_.*]] = &raw const [[a]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let a = 13_usize; let b = &raw const a; @@ -466,7 +466,7 @@ fn reference_propagation_const_ptr(single: *const T, mut multiple: *con // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &raw const [[a]]; // CHECK: [[d:_.*]] = &[[b]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let a = 5_usize; let b = &raw const a; @@ -482,7 +482,7 @@ fn reference_propagation_const_ptr(single: *const T, mut multiple: *con // CHECK: [[b:_.*]] = &raw const [[a]]; // CHECK: [[d:_.*]] = &mut [[b]]; // FIXME this could be [[a]] - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let a = 5_usize; let mut b = &raw const a; @@ -500,7 +500,7 @@ fn reference_propagation_mut_ptr(single: *mut T, mut multiple: *mut T) // CHECK: bb0: { // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &raw mut [[a]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let mut a = 5_usize; let b = &raw mut a; // This borrow is only used once. @@ -516,7 +516,7 @@ fn reference_propagation_mut_ptr(single: *mut T, mut multiple: *mut T) // CHECK: [[b:_.*]] = &raw mut [[a]]; // CHECK: [[btmp:_.*]] = &raw mut [[a2]]; // CHECK: [[b]] = move [[btmp]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let mut a2 = 7_usize; @@ -533,7 +533,7 @@ fn reference_propagation_mut_ptr(single: *mut T, mut multiple: *mut T) // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &raw mut [[a]]; // CHECK: [[d:_.*]] = &[[b]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let b = &raw mut a; @@ -548,7 +548,7 @@ fn reference_propagation_mut_ptr(single: *mut T, mut multiple: *mut T) // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &raw mut [[a]]; // CHECK: [[d:_.*]] = &raw mut [[b]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let mut b = &raw mut a; @@ -562,7 +562,7 @@ fn reference_propagation_mut_ptr(single: *mut T, mut multiple: *mut T) // CHECK: bb4: { // CHECK: [[a:_.*]] = const 7_usize; // CHECK: [[b:_.*]] = &raw mut [[a]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 7_usize; let b = &raw mut a; @@ -575,10 +575,10 @@ fn reference_propagation_mut_ptr(single: *mut T, mut multiple: *mut T) // CHECK: bb5: { // CHECK: [[a:_.*]] = const 7_usize; // CHECK: [[b1:_.*]] = &raw mut [[a]]; - // CHECK: [[c:_.*]] = (*[[b1]]); - // CHECK: [[b2:_.*]] = [[b1]]; - // CHECK: [[c2:_.*]] = (*[[b2]]); - // CHECK: [[b3:_.*]] = [[b2]]; + // CHECK: [[c:_.*]] = copy (*[[b1]]); + // CHECK: [[b2:_.*]] = copy [[b1]]; + // CHECK: [[c2:_.*]] = copy (*[[b2]]); + // CHECK: [[b3:_.*]] = copy [[b2]]; let mut a = 7_usize; let b1 = &raw mut a; @@ -595,7 +595,7 @@ fn reference_propagation_mut_ptr(single: *mut T, mut multiple: *mut T) unsafe { // CHECK: bb6: { // CHECK-NOT: {{_.*}} = &(*_1); - // CHECK: [[b:_.*]] = (*_1); + // CHECK: [[b:_.*]] = copy (*_1); let a = &raw mut *single; let b = *a; // This should be optimized as `*single`. @@ -608,7 +608,7 @@ fn reference_propagation_mut_ptr(single: *mut T, mut multiple: *mut T) // CHECK: [[a:_.*]] = &raw mut (*_2); // CHECK: [[tmp:_.*]] = &raw mut (*_1); // CHECK: _2 = move [[tmp]]; - // CHECK: [[b:_.*]] = (*[[a]]); + // CHECK: [[b:_.*]] = copy (*[[a]]); let a = &raw mut *multiple; multiple = &raw mut *single; @@ -623,7 +623,7 @@ fn reference_propagation_mut_ptr(single: *mut T, mut multiple: *mut T) // CHECK: [[b:_.*]] = &raw mut [[a]]; // CHECK: [[d:_.*]] = &[[b]]; // FIXME this could be [[a]] - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let b = &raw mut a; @@ -639,7 +639,7 @@ fn reference_propagation_mut_ptr(single: *mut T, mut multiple: *mut T) // CHECK: [[b:_.*]] = &raw mut [[a]]; // CHECK: [[d:_.*]] = &mut [[b]]; // FIXME this could be [[a]] - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let mut b = &raw mut a; @@ -653,8 +653,8 @@ fn reference_propagation_mut_ptr(single: *mut T, mut multiple: *mut T) fn read_through_raw(x: &mut usize) -> usize { // CHECK-LABEL: read_through_raw // CHECK: bb0: { - // CHECK-NEXT: _0 = (*_1); - // CHECK-NEXT: _0 = (*_1); + // CHECK-NEXT: _0 = copy (*_1); + // CHECK-NEXT: _0 = copy (*_1); // CHECK-NEXT: return; use std::intrinsics::mir::*; @@ -680,7 +680,7 @@ fn read_through_raw(x: &mut usize) -> usize { #[custom_mir(dialect = "runtime", phase = "post-cleanup")] fn multiple_storage() { // CHECK-LABEL: multiple_storage - // CHECK: _3 = (*_2); + // CHECK: _3 = copy (*_2); use std::intrinsics::mir::*; mir! { @@ -706,7 +706,7 @@ fn multiple_storage() { #[custom_mir(dialect = "runtime", phase = "post-cleanup")] fn dominate_storage() { // CHECK-LABEL: dominate_storage - // CHECK: _5 = (*_2); + // CHECK: _5 = copy (*_2); use std::intrinsics::mir::*; mir! { @@ -798,12 +798,12 @@ fn unique_with_copies() { // CHECK: [[a:_.*]] = const 0_i32; // CHECK: [[x:_.*]] = &raw mut [[a]]; // CHECK-NOT: [[a]] - // CHECK: [[tmp:_.*]] = (*[[x]]); + // CHECK: [[tmp:_.*]] = copy (*[[x]]); // CHECK-NEXT: opaque::(move [[tmp]]) // CHECK-NOT: [[a]] // CHECK: StorageDead([[a]]); // CHECK-NOT: [[a]] - // CHECK: [[tmp:_.*]] = (*[[x]]); + // CHECK: [[tmp:_.*]] = copy (*[[x]]); // CHECK-NEXT: opaque::(move [[tmp]]) let y = { diff --git a/tests/mir-opt/simplify_dead_blocks.rs b/tests/mir-opt/simplify_dead_blocks.rs index b9a404fd35c86..7f2134c61218b 100644 --- a/tests/mir-opt/simplify_dead_blocks.rs +++ b/tests/mir-opt/simplify_dead_blocks.rs @@ -10,7 +10,7 @@ use std::intrinsics::mir::*; pub unsafe fn assert_nonzero_nonmax(x: u8) -> u8 { // CHECK-LABEL: fn assert_nonzero_nonmax( // CHECK: bb0: { - // CHECK-NEXT: switchInt({{.*}}) -> [0: [[unreachable:bb.*]], 1: [[retblock2:bb.*]], 255: [[unreachable:bb.*]], otherwise: [[retblock:bb.*]]]; + // CHECK-NEXT: switchInt(copy {{_[0-9]+}}) -> [0: [[unreachable:bb.*]], 1: [[retblock2:bb.*]], 255: [[unreachable:bb.*]], otherwise: [[retblock:bb.*]]]; // CHECK-NEXT: } // CHECK-NOT: _0 = const 1_u8; // CHECK: [[retblock2]]: { @@ -21,7 +21,7 @@ pub unsafe fn assert_nonzero_nonmax(x: u8) -> u8 { // CHECK-NEXT: unreachable; // CHECK-NEXT: } // CHECK: [[retblock]]: { - // CHECK-NEXT: _0 = _1; + // CHECK-NEXT: _0 = copy _1; // CHECK-NEXT: return; // CHECK-NEXT: } mir! { diff --git a/tests/mir-opt/sroa/structs.rs b/tests/mir-opt/sroa/structs.rs index a177dbf71cf1c..d5f13f8b00908 100644 --- a/tests/mir-opt/sroa/structs.rs +++ b/tests/mir-opt/sroa/structs.rs @@ -31,8 +31,8 @@ pub fn enums(a: usize) -> usize { // CHECK: bb0: { // CHECK: [[enum]] = Option::::Some - // CHECK: _5 = (([[enum]] as Some).0: usize) - // CHECK: _0 = _5 + // CHECK: _5 = copy (([[enum]] as Some).0: usize) + // CHECK: _0 = copy _5 if let Some(a) = Some(a) { a } else { 0 } } @@ -51,13 +51,13 @@ pub fn structs(a: f32) -> f32 { // CHECK: bb0: { // CHECK-NOT: [[struct]] - // CHECK: [[a_tmp]] = _1; + // CHECK: [[a_tmp]] = copy _1; // CHECK-NOT: [[struct]] // CHECK: [[foo]] = const 0_usize; // CHECK-NOT: [[struct]] // CHECK: [[a_ret]] = move [[a_tmp]]; // CHECK-NOT: [[struct]] - // CHECK: _0 = [[a_ret]]; + // CHECK: _0 = copy [[a_ret]]; // CHECK-NOT: [[struct]] U { _foo: 0, a }.a } @@ -73,7 +73,7 @@ pub fn unions(a: f32) -> u32 { // CHECK: bb0: { // CHECK: [[union]] = Repr { - // CHECK: _0 = ([[union]].1: u32) + // CHECK: _0 = copy ([[union]].1: u32) unsafe { Repr { f: a }.u } } @@ -156,10 +156,10 @@ fn copies(x: Foo) { // CHECK: [[opt_isize:_[0-9]+]]: std::option::Option; // CHECK: bb0: { - // CHECK: [[byte]] = ([[external]].0 - // CHECK: [[unit]] = ([[external]].1 - // CHECK: [[str]] = ([[external]].2 - // CHECK: [[opt_isize]] = ([[external]].3 + // CHECK: [[byte]] = copy ([[external]].0 + // CHECK: [[unit]] = copy ([[external]].1 + // CHECK: [[str]] = copy ([[external]].2 + // CHECK: [[opt_isize]] = copy ([[external]].3 let y = x; let t = y.a; @@ -181,10 +181,10 @@ fn ref_copies(x: &Foo) { // CHECK: [[opt_isize:_[0-9]+]]: std::option::Option; // CHECK: bb0: { - // CHECK: [[byte]] = ((*[[external]]).0 - // CHECK: [[unit]] = ((*[[external]]).1 - // CHECK: [[str]] = ((*[[external]]).2 - // CHECK: [[opt_isize]] = ((*[[external]]).3 + // CHECK: [[byte]] = copy ((*[[external]]).0 + // CHECK: [[unit]] = copy ((*[[external]]).1 + // CHECK: [[str]] = copy ((*[[external]]).2 + // CHECK: [[opt_isize]] = copy ((*[[external]]).3 let y = *x; let t = y.a; From 99cb0c6bc399fb94a0ddde7e9b38e9c00d523bad Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Sun, 18 Aug 2024 14:26:34 -0700 Subject: [PATCH 3/4] Bless *all* the mir-opt tests --- ..._of_reborrow.SimplifyCfg-initial.after.mir | 12 +- ...fg-pre-optimizations.after.panic-abort.mir | 8 +- ...g-pre-optimizations.after.panic-unwind.mir | 8 +- ...ure#0}.coroutine_by_move.0.panic-abort.mir | 2 +- ...re#0}.coroutine_by_move.0.panic-unwind.mir | 2 +- ...ure#0}.coroutine_by_move.0.panic-abort.mir | 2 +- ...re#0}.coroutine_by_move.0.panic-unwind.mir | 2 +- ...coroutine_closure_by_ref.0.panic-abort.mir | 2 +- ...oroutine_closure_by_ref.0.panic-unwind.mir | 2 +- .../basic_assignment.main.ElaborateDrops.diff | 2 +- ...ignment.main.SimplifyCfg-initial.after.mir | 2 +- ...await.b-{closure#0}.coroutine_resume.0.mir | 12 +- .../aggregate_exprs.adt.built.after.mir | 4 +- .../aggregate_exprs.array.built.after.mir | 2 +- ...rbitrary_let.arbitrary_let.built.after.mir | 6 +- .../custom/arrays.arrays.built.after.mir | 2 +- .../as_cast.float_to_int.built.after.mir | 2 +- .../custom/as_cast.int_to_int.built.after.mir | 2 +- .../custom/as_cast.int_to_ptr.built.after.mir | 2 +- .../assume.assume_local.built.after.mir | 2 +- .../assume.assume_place.built.after.mir | 2 +- .../custom/enums.switch_bool.built.after.mir | 2 +- .../enums.switch_option.built.after.mir | 2 +- .../enums.switch_option_repr.built.after.mir | 2 +- .../custom/operators.f.built.after.mir | 40 +- .../custom/operators.g.runtime.after.mir | 4 +- ...projections.copy_for_deref.built.after.mir | 2 +- .../projections.simple_index.built.after.mir | 4 +- .../custom/projections.tuples.built.after.mir | 4 +- .../custom/projections.unions.built.after.mir | 2 +- .../custom/projections.unwrap.built.after.mir | 2 +- .../projections.unwrap_deref.built.after.mir | 2 +- ...erences.raw_pointer_offset.built.after.mir | 2 +- .../simple_assign.simple.built.after.mir | 4 +- ...terminators.assert_nonzero.built.after.mir | 2 +- .../terminators.direct_call.built.after.mir | 2 +- .../terminators.indirect_call.built.after.mir | 2 +- .../terminators.tail_call.built.after.mir | 4 +- .../building/enum_cast.bar.built.after.mir | 4 +- .../building/enum_cast.boo.built.after.mir | 4 +- .../building/enum_cast.droppy.built.after.mir | 4 +- .../building/enum_cast.far.built.after.mir | 4 +- .../enum_cast.offsetty.built.after.mir | 6 +- .../building/enum_cast.signy.built.after.mir | 6 +- .../building/eq_never_type._f.built.after.mir | 4 +- .../issue_101867.main.built.after.mir | 2 +- .../building/issue_49232.main.built.after.mir | 2 +- ...n_conditional.test_complex.built.after.mir | 4 +- ..._or_in_conditional.test_or.built.after.mir | 4 +- .../string.foo.PreCodegen.after.mir | 4 +- ....match_tuple.SimplifyCfg-initial.after.mir | 20 +- ...se_edges.full_tested_match.built.after.mir | 8 +- ...e_edges.full_tested_match2.built.after.mir | 8 +- .../match_false_edges.main.built.after.mir | 10 +- .../simple_match.match_bool.built.after.mir | 2 +- ....constant_eq.SimplifyCfg-initial.after.mir | 14 +- ...joint_ranges.SimplifyCfg-initial.after.mir | 12 +- ...ceiver_ptr_mutability.main.built.after.mir | 4 +- .../shifts.shift_signed.built.after.mir | 48 +-- .../shifts.shift_unsigned.built.after.mir | 48 +-- ...hile_loop.PreCodegen.after.panic-abort.mir | 4 +- ...ile_loop.PreCodegen.after.panic-unwind.mir | 4 +- .../const_allocation.main.GVN.after.32bit.mir | 2 +- .../const_allocation.main.GVN.after.64bit.mir | 2 +- ...const_allocation2.main.GVN.after.32bit.mir | 2 +- ...const_allocation2.main.GVN.after.64bit.mir | 2 +- ...const_allocation3.main.GVN.after.32bit.mir | 2 +- ...const_allocation3.main.GVN.after.64bit.mir | 2 +- ..._goto_const_eval_fail.f.JumpThreading.diff | 2 +- .../const_prop/address_of_pair.fn0.GVN.diff | 4 +- .../aggregate.foo.GVN.panic-abort.diff | 12 +- .../aggregate.foo.GVN.panic-unwind.diff | 12 +- .../aggregate.main.GVN.panic-abort.diff | 4 +- .../aggregate.main.GVN.panic-unwind.diff | 4 +- ...rray_index.main.GVN.32bit.panic-abort.diff | 6 +- ...ray_index.main.GVN.32bit.panic-unwind.diff | 6 +- ...rray_index.main.GVN.64bit.panic-abort.diff | 6 +- ...ray_index.main.GVN.64bit.panic-unwind.diff | 6 +- ...d_op_div_by_zero.main.GVN.panic-abort.diff | 8 +- ..._op_div_by_zero.main.GVN.panic-unwind.diff | 8 +- ...d_op_mod_by_zero.main.GVN.panic-abort.diff | 8 +- ..._op_mod_by_zero.main.GVN.panic-unwind.diff | 8 +- ...for_slices.main.GVN.32bit.panic-abort.diff | 10 +- ...or_slices.main.GVN.32bit.panic-unwind.diff | 10 +- ...for_slices.main.GVN.64bit.panic-abort.diff | 10 +- ...or_slices.main.GVN.64bit.panic-unwind.diff | 10 +- .../boolean_identities.test.GVN.diff | 8 +- .../boxes.main.GVN.panic-abort.diff | 8 +- .../boxes.main.GVN.panic-unwind.diff | 8 +- .../discriminant.main.GVN.32bit.diff | 2 +- .../discriminant.main.GVN.64bit.diff | 2 +- .../indirect.main.GVN.panic-abort.diff | 2 +- .../indirect.main.GVN.panic-unwind.diff | 2 +- .../const_prop/indirect_mutation.bar.GVN.diff | 2 +- .../const_prop/indirect_mutation.foo.GVN.diff | 2 +- ...inherit_overflow.main.GVN.panic-abort.diff | 4 +- ...nherit_overflow.main.GVN.panic-unwind.diff | 4 +- .../const_prop/invalid_constant.main.GVN.diff | 4 +- .../invalid_constant.main.RemoveZsts.diff | 6 +- ...rray_index.main.GVN.32bit.panic-abort.diff | 6 +- ...ray_index.main.GVN.32bit.panic-unwind.diff | 6 +- ...rray_index.main.GVN.64bit.panic-abort.diff | 6 +- ...ray_index.main.GVN.64bit.panic-unwind.diff | 6 +- .../const_prop/mult_by_zero.test.GVN.diff | 2 +- .../const_prop/mutable_variable.main.GVN.diff | 2 +- .../mutable_variable_aggregate.main.GVN.diff | 2 +- ...e_variable_aggregate_mut_ref.main.GVN.diff | 2 +- ...ate_partial_read.main.GVN.panic-abort.diff | 2 +- ...te_partial_read.main.GVN.panic-unwind.diff | 2 +- .../mutable_variable_no_prop.main.GVN.diff | 4 +- ...le_unprop_assign.main.GVN.panic-abort.diff | 8 +- ...e_unprop_assign.main.GVN.panic-unwind.diff | 8 +- ...te_with_const_with_params.size_of.GVN.diff | 2 +- ...xpose_provenance.main.GVN.panic-abort.diff | 4 +- ...pose_provenance.main.GVN.panic-unwind.diff | 4 +- .../read_immutable_static.main.GVN.diff | 4 +- .../const_prop/ref_deref.main.GVN.diff | 2 +- .../ref_deref_project.main.GVN.diff | 2 +- .../repeat.main.GVN.32bit.panic-abort.diff | 6 +- .../repeat.main.GVN.32bit.panic-unwind.diff | 6 +- .../repeat.main.GVN.64bit.panic-abort.diff | 6 +- .../repeat.main.GVN.64bit.panic-unwind.diff | 6 +- ...eral_propagation.main.GVN.panic-abort.diff | 2 +- ...ral_propagation.main.GVN.panic-unwind.diff | 2 +- .../slice_len.main.GVN.32bit.panic-abort.diff | 14 +- ...slice_len.main.GVN.32bit.panic-unwind.diff | 14 +- .../slice_len.main.GVN.64bit.panic-abort.diff | 14 +- ...slice_len.main.GVN.64bit.panic-unwind.diff | 14 +- .../switch_int.main.GVN.panic-abort.diff | 2 +- .../switch_int.main.GVN.panic-unwind.diff | 2 +- .../transmute.unreachable_box.GVN.32bit.diff | 2 +- .../transmute.unreachable_box.GVN.64bit.diff | 2 +- ...eral_propagation.main.GVN.panic-abort.diff | 2 +- ...ral_propagation.main.GVN.panic-unwind.diff | 2 +- .../while_let_loops.change_loop_body.GVN.diff | 2 +- ...d_local.borrowed.CopyProp.panic-abort.diff | 8 +- ..._local.borrowed.CopyProp.panic-unwind.diff | 8 +- ....compare_address.CopyProp.panic-abort.diff | 6 +- ...compare_address.CopyProp.panic-unwind.diff | 6 +- ...local.non_freeze.CopyProp.panic-abort.diff | 6 +- ...ocal.non_freeze.CopyProp.panic-unwind.diff | 6 +- .../branch.foo.CopyProp.panic-abort.diff | 6 +- .../branch.foo.CopyProp.panic-unwind.diff | 6 +- .../calls.multiple_edges.CopyProp.diff | 4 +- .../copy-prop/calls.nrvo.CopyProp.diff | 2 +- ...tion_arg.arg_src.CopyProp.panic-abort.diff | 6 +- ...ion_arg.arg_src.CopyProp.panic-unwind.diff | 6 +- ...pagation_arg.bar.CopyProp.panic-abort.diff | 2 +- ...agation_arg.bar.CopyProp.panic-unwind.diff | 2 +- ...pagation_arg.baz.CopyProp.panic-abort.diff | 4 +- ...agation_arg.baz.CopyProp.panic-unwind.diff | 4 +- ...pagation_arg.foo.CopyProp.panic-abort.diff | 2 +- ...agation_arg.foo.CopyProp.panic-unwind.diff | 2 +- ...ustom_move_arg.f.CopyProp.panic-abort.diff | 8 +- ...stom_move_arg.f.CopyProp.panic-unwind.diff | 8 +- .../cycle.main.CopyProp.panic-abort.diff | 10 +- .../cycle.main.CopyProp.panic-unwind.diff | 10 +- ...res_79191.f.CopyProp.after.panic-abort.mir | 6 +- ...es_79191.f.CopyProp.after.panic-unwind.mir | 6 +- ...es_better.f.CopyProp.after.panic-abort.mir | 6 +- ...s_better.f.CopyProp.after.panic-unwind.mir | 6 +- ...ssue_107511.main.CopyProp.panic-abort.diff | 18 +- ...sue_107511.main.CopyProp.panic-unwind.diff | 18 +- .../move_arg.f.CopyProp.panic-abort.diff | 8 +- .../move_arg.f.CopyProp.panic-unwind.diff | 8 +- ...ove_projection.f.CopyProp.panic-abort.diff | 6 +- ...ve_projection.f.CopyProp.panic-unwind.diff | 6 +- .../mutate_through_pointer.f.CopyProp.diff | 4 +- .../copy-prop/non_dominate.f.CopyProp.diff | 8 +- ...reborrow.demiraw.CopyProp.panic-abort.diff | 6 +- ...eborrow.demiraw.CopyProp.panic-unwind.diff | 6 +- .../reborrow.miraw.CopyProp.panic-abort.diff | 6 +- .../reborrow.miraw.CopyProp.panic-unwind.diff | 6 +- ...ch_match_arms.main.InstrumentCoverage.diff | 16 +- .../aggregate_copy.foo.DataflowConstProp.diff | 8 +- ...n.DataflowConstProp.32bit.panic-abort.diff | 8 +- ....DataflowConstProp.32bit.panic-unwind.diff | 8 +- ...n.DataflowConstProp.64bit.panic-abort.diff | 8 +- ....DataflowConstProp.64bit.panic-unwind.diff | 8 +- ...ean_identities.test.DataflowConstProp.diff | 4 +- .../cast.main.DataflowConstProp.diff | 2 +- ...ed.main.DataflowConstProp.panic-abort.diff | 10 +- ...d.main.DataflowConstProp.panic-unwind.diff | 10 +- ...oxed_slice.main.GVN.32bit.panic-abort.diff | 10 +- ...xed_slice.main.GVN.32bit.panic-unwind.diff | 10 +- ...oxed_slice.main.GVN.64bit.panic-abort.diff | 10 +- ...xed_slice.main.GVN.64bit.panic-unwind.diff | 10 +- ...enum.constant.DataflowConstProp.32bit.diff | 8 +- ...enum.constant.DataflowConstProp.64bit.diff | 8 +- ...enum.multiple.DataflowConstProp.32bit.diff | 10 +- ...enum.multiple.DataflowConstProp.64bit.diff | 10 +- ..._discriminant.DataflowConstProp.32bit.diff | 2 +- ..._discriminant.DataflowConstProp.64bit.diff | 2 +- .../enum.simple.DataflowConstProp.32bit.diff | 8 +- .../enum.simple.DataflowConstProp.64bit.diff | 8 +- .../enum.statics.DataflowConstProp.32bit.diff | 14 +- .../enum.statics.DataflowConstProp.64bit.diff | 14 +- .../if.main.DataflowConstProp.diff | 12 +- ...ow.main.DataflowConstProp.panic-abort.diff | 4 +- ...w.main.DataflowConstProp.panic-unwind.diff | 4 +- ...n.DataflowConstProp.32bit.panic-abort.diff | 8 +- ....DataflowConstProp.32bit.panic-unwind.diff | 8 +- ...n.DataflowConstProp.64bit.panic-abort.diff | 8 +- ....DataflowConstProp.64bit.panic-unwind.diff | 8 +- .../mult_by_zero.test.DataflowConstProp.diff | 2 +- ...sb.main.DataflowConstProp.panic-abort.diff | 2 +- ...b.main.DataflowConstProp.panic-unwind.diff | 2 +- ...n.DataflowConstProp.32bit.panic-abort.diff | 8 +- ....DataflowConstProp.32bit.panic-unwind.diff | 8 +- ...n.DataflowConstProp.64bit.panic-abort.diff | 8 +- ....DataflowConstProp.64bit.panic-unwind.diff | 8 +- ...pr_transparent.main.DataflowConstProp.diff | 4 +- .../self_assign.main.DataflowConstProp.diff | 8 +- ...elf_assign_add.main.DataflowConstProp.diff | 4 +- ...tr.main.DataflowConstProp.panic-abort.diff | 4 +- ...r.main.DataflowConstProp.panic-unwind.diff | 4 +- ...n.DataflowConstProp.32bit.panic-abort.diff | 20 +- ....DataflowConstProp.32bit.panic-unwind.diff | 20 +- ...n.DataflowConstProp.64bit.panic-abort.diff | 20 +- ....DataflowConstProp.64bit.panic-unwind.diff | 20 +- .../struct.main.DataflowConstProp.32bit.diff | 42 +-- .../struct.main.DataflowConstProp.64bit.diff | 42 +-- ...or.main.DataflowConstProp.panic-abort.diff | 2 +- ...r.main.DataflowConstProp.panic-unwind.diff | 2 +- ...reachable_box.DataflowConstProp.32bit.diff | 2 +- ...reachable_box.DataflowConstProp.64bit.diff | 2 +- .../tuple.main.DataflowConstProp.32bit.diff | 16 +- .../tuple.main.DataflowConstProp.64bit.diff | 16 +- ...eadStoreElimination-final.panic-abort.diff | 2 +- ...adStoreElimination-final.panic-unwind.diff | 2 +- ...eadStoreElimination-final.panic-abort.diff | 4 +- ...adStoreElimination-final.panic-unwind.diff | 4 +- ...le.cycle.DeadStoreElimination-initial.diff | 10 +- ...r_to_int.DeadStoreElimination-initial.diff | 4 +- ...mment_2.DeduplicateBlocks.panic-abort.diff | 22 +- ...ment_2.DeduplicateBlocks.panic-unwind.diff | 22 +- ...complex_case.main.Derefer.panic-abort.diff | 6 +- ...omplex_case.main.Derefer.panic-unwind.diff | 6 +- ...minator_test.main.Derefer.panic-abort.diff | 4 +- ...inator_test.main.Derefer.panic-unwind.diff | 4 +- ...oo.DestinationPropagation.panic-abort.diff | 6 +- ...o.DestinationPropagation.panic-unwind.diff | 6 +- ...rc.DestinationPropagation.panic-abort.diff | 6 +- ...c.DestinationPropagation.panic-unwind.diff | 6 +- ...ar.DestinationPropagation.panic-abort.diff | 2 +- ...r.DestinationPropagation.panic-unwind.diff | 2 +- ...az.DestinationPropagation.panic-abort.diff | 4 +- ...z.DestinationPropagation.panic-unwind.diff | 4 +- ...oo.DestinationPropagation.panic-abort.diff | 2 +- ...o.DestinationPropagation.panic-unwind.diff | 2 +- ...in.DestinationPropagation.panic-abort.diff | 8 +- ...n.DestinationPropagation.panic-unwind.diff | 8 +- ...stinationPropagation.after.panic-abort.mir | 2 +- ...tinationPropagation.after.panic-unwind.mir | 2 +- ...stinationPropagation.after.panic-abort.mir | 2 +- ...tinationPropagation.after.panic-unwind.mir | 2 +- ...vo.DestinationPropagation.panic-abort.diff | 4 +- ...o.DestinationPropagation.panic-unwind.diff | 4 +- ...in.DestinationPropagation.panic-abort.diff | 2 +- ...n.DestinationPropagation.panic-unwind.diff | 2 +- ...wise_branch.opt1.EarlyOtherwiseBranch.diff | 8 +- ...wise_branch.opt2.EarlyOtherwiseBranch.diff | 8 +- ...wise_branch.opt3.EarlyOtherwiseBranch.diff | 8 +- ...wise_branch.opt4.EarlyOtherwiseBranch.diff | 8 +- ...ement_tuple.opt1.EarlyOtherwiseBranch.diff | 12 +- ...ement_tuple.opt2.EarlyOtherwiseBranch.diff | 10 +- ...ch_68867.try_sum.EarlyOtherwiseBranch.diff | 36 +- ...nch_noopt.noopt1.EarlyOtherwiseBranch.diff | 12 +- ...ess.no_deref_ptr.EarlyOtherwiseBranch.diff | 4 +- .../enum_opt.cand.EnumSizeOpt.32bit.diff | 20 +- .../enum_opt.cand.EnumSizeOpt.64bit.diff | 20 +- .../enum_opt.unin.EnumSizeOpt.32bit.diff | 20 +- .../enum_opt.unin.EnumSizeOpt.64bit.diff | 20 +- ...to_exponential_common.GVN.panic-abort.diff | 32 +- ...o_exponential_common.GVN.panic-unwind.diff | 32 +- .../gvn.arithmetic.GVN.panic-abort.diff | 130 +++---- .../gvn.arithmetic.GVN.panic-unwind.diff | 130 +++---- ...vn.arithmetic_checked.GVN.panic-abort.diff | 50 +-- ...n.arithmetic_checked.GVN.panic-unwind.diff | 50 +-- .../gvn.arithmetic_float.GVN.panic-abort.diff | 40 +- ...gvn.arithmetic_float.GVN.panic-unwind.diff | 40 +- .../mir-opt/gvn.borrowed.GVN.panic-abort.diff | 12 +- .../gvn.borrowed.GVN.panic-unwind.diff | 12 +- tests/mir-opt/gvn.cast.GVN.panic-abort.diff | 60 +-- tests/mir-opt/gvn.cast.GVN.panic-unwind.diff | 60 +-- .../gvn.cast_pointer_eq.GVN.panic-abort.diff | 46 +-- .../gvn.cast_pointer_eq.GVN.panic-unwind.diff | 46 +-- ...ointer_then_transmute.GVN.panic-abort.diff | 10 +- ...inter_then_transmute.GVN.panic-unwind.diff | 10 +- ...ore_aggregate_raw_ptr.GVN.panic-abort.diff | 16 +- ...re_aggregate_raw_ptr.GVN.panic-unwind.diff | 16 +- .../gvn.comparison.GVN.panic-abort.diff | 20 +- .../gvn.comparison.GVN.panic-unwind.diff | 20 +- ...nstant_index_overflow.GVN.panic-abort.diff | 26 +- ...stant_index_overflow.GVN.panic-unwind.diff | 26 +- .../gvn.dereferences.GVN.panic-abort.diff | 36 +- .../gvn.dereferences.GVN.panic-unwind.diff | 36 +- .../gvn.duplicate_slice.GVN.panic-abort.diff | 18 +- .../gvn.duplicate_slice.GVN.panic-unwind.diff | 18 +- .../gvn.fn_pointers.GVN.panic-abort.diff | 20 +- .../gvn.fn_pointers.GVN.panic-unwind.diff | 20 +- ...generic_cast_metadata.GVN.panic-abort.diff | 30 +- ...eneric_cast_metadata.GVN.panic-unwind.diff | 30 +- .../gvn.indirect_static.GVN.panic-abort.diff | 2 +- .../gvn.indirect_static.GVN.panic-unwind.diff | 2 +- ....manual_slice_mut_len.GVN.panic-abort.diff | 8 +- ...manual_slice_mut_len.GVN.panic-unwind.diff | 8 +- ....meta_of_ref_to_slice.GVN.panic-abort.diff | 6 +- ...meta_of_ref_to_slice.GVN.panic-unwind.diff | 6 +- ...gvn.multiple_branches.GVN.panic-abort.diff | 64 ++-- ...vn.multiple_branches.GVN.panic-unwind.diff | 64 ++-- .../gvn.non_freeze.GVN.panic-abort.diff | 8 +- .../gvn.non_freeze.GVN.panic-unwind.diff | 8 +- .../gvn.references.GVN.panic-abort.diff | 6 +- .../gvn.references.GVN.panic-unwind.diff | 6 +- ...ust_change_both_sides.GVN.panic-abort.diff | 6 +- ...st_change_both_sides.GVN.panic-unwind.diff | 6 +- tests/mir-opt/gvn.repeat.GVN.panic-abort.diff | 20 +- .../mir-opt/gvn.repeat.GVN.panic-unwind.diff | 20 +- .../gvn.repeated_index.GVN.panic-abort.diff | 30 +- .../gvn.repeated_index.GVN.panic-unwind.diff | 30 +- ...vn.slice_const_length.GVN.panic-abort.diff | 6 +- ...n.slice_const_length.GVN.panic-unwind.diff | 6 +- ...from_raw_parts_as_ptr.GVN.panic-abort.diff | 16 +- ...rom_raw_parts_as_ptr.GVN.panic-unwind.diff | 16 +- tests/mir-opt/gvn.slices.GVN.panic-abort.diff | 56 +-- .../mir-opt/gvn.slices.GVN.panic-unwind.diff | 56 +-- ...xpression_elimination.GVN.panic-abort.diff | 344 +++++++++--------- ...pression_elimination.GVN.panic-unwind.diff | 344 +++++++++--------- tests/mir-opt/gvn.unary.GVN.panic-abort.diff | 48 +-- tests/mir-opt/gvn.unary.GVN.panic-unwind.diff | 48 +-- .../gvn.wide_ptr_integer.GVN.panic-abort.diff | 24 +- ...gvn.wide_ptr_integer.GVN.panic-unwind.diff | 24 +- ...n.wide_ptr_provenance.GVN.panic-abort.diff | 76 ++-- ....wide_ptr_provenance.GVN.panic-unwind.diff | 76 ++-- ...e_ptr_same_provenance.GVN.panic-abort.diff | 84 ++--- ..._ptr_same_provenance.GVN.panic-unwind.diff | 84 ++--- .../gvn.wrap_unwrap.GVN.panic-abort.diff | 12 +- .../gvn.wrap_unwrap.GVN.panic-unwind.diff | 12 +- tests/mir-opt/gvn_copy_moves.fn0.GVN.diff | 8 +- .../gvn_ptr_eq_with_constant.main.GVN.diff | 8 +- .../gvn_uninhabited.f.GVN.panic-abort.diff | 8 +- .../gvn_uninhabited.f.GVN.panic-unwind.diff | 8 +- ...t_opt_bool.SimplifyComparisonIntegral.diff | 2 +- ...opt_floats.SimplifyComparisonIntegral.diff | 2 +- ...comparison.SimplifyComparisonIntegral.diff | 10 +- ...t.opt_char.SimplifyComparisonIntegral.diff | 2 +- ...int.opt_i8.SimplifyComparisonIntegral.diff | 2 +- ...ltiple_ifs.SimplifyComparisonIntegral.diff | 4 +- ...t_negative.SimplifyComparisonIntegral.diff | 2 +- ...nt.opt_u32.SimplifyComparisonIntegral.diff | 2 +- ...yn_trait.get_query.Inline.panic-abort.diff | 6 +- ...n_trait.get_query.Inline.panic-unwind.diff | 6 +- ...dyn_trait.mk_cycle.Inline.panic-abort.diff | 2 +- ...yn_trait.mk_cycle.Inline.panic-unwind.diff | 2 +- ....try_execute_query.Inline.panic-abort.diff | 2 +- ...try_execute_query.Inline.panic-unwind.diff | 2 +- .../inline_any_operand.bar.Inline.after.mir | 4 +- .../inline_closure.foo.Inline.after.mir | 6 +- ...e_closure_borrows_arg.foo.Inline.after.mir | 6 +- ...line_closure_captures.foo.Inline.after.mir | 10 +- ...ine_coroutine.main.Inline.panic-abort.diff | 8 +- ...ne_coroutine.main.Inline.panic-unwind.diff | 8 +- ...inline_diverging.g.Inline.panic-abort.diff | 4 +- ...nline_diverging.g.Inline.panic-unwind.diff | 4 +- ...inline_diverging.h.Inline.panic-abort.diff | 2 +- ...nline_diverging.h.Inline.panic-unwind.diff | 2 +- ...inline_direct.Inline.after.panic-abort.mir | 2 +- ...nline_direct.Inline.after.panic-unwind.mir | 2 +- ...line_indirect.Inline.after.panic-abort.mir | 2 +- ...ine_indirect.Inline.after.panic-unwind.mir | 2 +- ...ic_not_inline.Inline.after.panic-abort.mir | 4 +- ...c_not_inline.Inline.after.panic-unwind.mir | 4 +- .../inline/inline_retag.bar.Inline.after.mir | 14 +- ...inline_shims.clone.Inline.panic-abort.diff | 2 +- ...nline_shims.clone.Inline.panic-unwind.diff | 2 +- .../inline_shims.drop.Inline.panic-abort.diff | 4 +- ...inline_shims.drop.Inline.panic-unwind.diff | 4 +- ...t_method.test.Inline.after.panic-abort.mir | 2 +- ..._method.test.Inline.after.panic-unwind.mir | 2 +- ...ethod_2.test2.Inline.after.panic-abort.mir | 2 +- ...thod_2.test2.Inline.after.panic-unwind.mir | 2 +- ...issue_106141.outer.Inline.panic-abort.diff | 6 +- ...ssue_106141.outer.Inline.panic-unwind.diff | 6 +- ...67_inline_as_ref_as_mut.a.Inline.after.mir | 8 +- ...67_inline_as_ref_as_mut.b.Inline.after.mir | 10 +- ...67_inline_as_ref_as_mut.c.Inline.after.mir | 6 +- ...67_inline_as_ref_as_mut.d.Inline.after.mir | 8 +- ...l_unsigned_smaller.Inline.panic-abort.diff | 8 +- ..._unsigned_smaller.Inline.panic-unwind.diff | 8 +- ...d_smaller.PreCodegen.after.panic-abort.mir | 2 +- ..._smaller.PreCodegen.after.panic-unwind.mir | 2 +- ..._shr_signed_bigger.Inline.panic-abort.diff | 8 +- ...shr_signed_bigger.Inline.panic-unwind.diff | 8 +- ...ed_bigger.PreCodegen.after.panic-abort.mir | 2 +- ...d_bigger.PreCodegen.after.panic-unwind.mir | 2 +- .../unsized_argument.caller.Inline.diff | 2 +- ...d.unwrap_unchecked.Inline.panic-abort.diff | 2 +- ....unwrap_unchecked.Inline.panic-unwind.diff | 2 +- ...unchecked.PreCodegen.after.panic-abort.mir | 2 +- ...nchecked.PreCodegen.after.panic-unwind.mir | 2 +- ...y.run2-{closure#0}.Inline.panic-abort.diff | 10 +- ....run2-{closure#0}.Inline.panic-unwind.diff | 10 +- ..._false.InstSimplify-after-simplifycfg.diff | 2 +- ...q_true.InstSimplify-after-simplifycfg.diff | 2 +- ...lse_eq.InstSimplify-after-simplifycfg.diff | 2 +- ...lse_ne.InstSimplify-after-simplifycfg.diff | 2 +- ..._false.InstSimplify-after-simplifycfg.diff | 2 +- ...e_true.InstSimplify-after-simplifycfg.diff | 2 +- ...rue_eq.InstSimplify-after-simplifycfg.diff | 2 +- ...rue_ne.InstSimplify-after-simplifycfg.diff | 2 +- ...undant.InstSimplify-after-simplifycfg.diff | 6 +- ...ndtrip.InstSimplify-after-simplifycfg.diff | 2 +- ...implify-after-simplifycfg.panic-abort.diff | 20 +- ...mplify-after-simplifycfg.panic-unwind.diff | 20 +- ...implify-after-simplifycfg.panic-abort.diff | 10 +- ...mplify-after-simplifycfg.panic-unwind.diff | 10 +- ...t_zero.InstSimplify-after-simplifycfg.diff | 6 +- ...inters.InstSimplify-after-simplifycfg.diff | 4 +- ...rences.InstSimplify-after-simplifycfg.diff | 4 +- ...hecked.InstSimplify-after-simplifycfg.diff | 4 +- .../issue_101973.inner.GVN.panic-abort.diff | 14 +- .../issue_101973.inner.GVN.panic-unwind.diff | 14 +- ...e_38669.main.SimplifyCfg-initial.after.mir | 2 +- ...41110.main.ElaborateDrops.panic-abort.diff | 2 +- ...1110.main.ElaborateDrops.panic-unwind.diff | 2 +- ...41110.test.ElaborateDrops.panic-abort.diff | 2 +- ...1110.test.ElaborateDrops.panic-unwind.diff | 2 +- ...41888.main.ElaborateDrops.panic-abort.diff | 6 +- ...1888.main.ElaborateDrops.panic-unwind.diff | 6 +- ...test.ElaborateDrops.before.panic-abort.mir | 8 +- ...est.ElaborateDrops.before.panic-unwind.mir | 8 +- tests/mir-opt/issue_72181.bar.built.after.mir | 4 +- tests/mir-opt/issue_72181.foo.built.after.mir | 6 +- .../mir-opt/issue_72181.main.built.after.mir | 6 +- ...implifyComparisonIntegral.panic-abort.diff | 4 +- ...mplifyComparisonIntegral.panic-unwind.diff | 4 +- ...8192.f.InstSimplify-after-simplifycfg.diff | 4 +- tests/mir-opt/issue_91633.foo.built.after.mir | 4 +- tests/mir-opt/issue_91633.fun.built.after.mir | 4 +- .../issue_99325.main.built.after.32bit.mir | 8 +- .../issue_99325.main.built.after.64bit.mir | 8 +- ..._to_digit.PreCodegen.after.panic-abort.mir | 2 +- ...to_digit.PreCodegen.after.panic-unwind.mir | 2 +- ...e_75439.foo.MatchBranchSimplification.diff | 12 +- ...g.aggregate.JumpThreading.panic-abort.diff | 10 +- ....aggregate.JumpThreading.panic-unwind.diff | 10 +- ...regate_copy.JumpThreading.panic-abort.diff | 8 +- ...egate_copy.JumpThreading.panic-unwind.diff | 8 +- ...ding.assume.JumpThreading.panic-abort.diff | 6 +- ...ing.assume.JumpThreading.panic-unwind.diff | 6 +- ...ustom_discr.JumpThreading.panic-abort.diff | 2 +- ...stom_discr.JumpThreading.panic-unwind.diff | 2 +- ...ppearing_bb.JumpThreading.panic-abort.diff | 6 +- ...pearing_bb.JumpThreading.panic-unwind.diff | 6 +- ...icate_chain.JumpThreading.panic-abort.diff | 4 +- ...cate_chain.JumpThreading.panic-unwind.diff | 4 +- ...ding.floats.JumpThreading.panic-abort.diff | 2 +- ...ing.floats.JumpThreading.panic-unwind.diff | 2 +- ...ng.identity.JumpThreading.panic-abort.diff | 14 +- ...g.identity.JumpThreading.panic-unwind.diff | 14 +- ...tiple_match.JumpThreading.panic-abort.diff | 12 +- ...iple_match.JumpThreading.panic-unwind.diff | 12 +- ...mutable_ref.JumpThreading.panic-abort.diff | 2 +- ...utable_ref.JumpThreading.panic-unwind.diff | 2 +- ...iscriminant.JumpThreading.panic-abort.diff | 2 +- ...scriminant.JumpThreading.panic-unwind.diff | 2 +- ...numbered_bb.JumpThreading.panic-abort.diff | 10 +- ...umbered_bb.JumpThreading.panic-unwind.diff | 10 +- ...too_complex.JumpThreading.panic-abort.diff | 14 +- ...oo_complex.JumpThreading.panic-unwind.diff | 14 +- ...array_len.array_bound.GVN.panic-abort.diff | 20 +- ...rray_len.array_bound.GVN.panic-unwind.diff | 20 +- ...y_len.array_bound_mut.GVN.panic-abort.diff | 24 +- ..._len.array_bound_mut.GVN.panic-unwind.diff | 24 +- ...erlapping.LowerIntrinsics.panic-abort.diff | 4 +- ...rlapping.LowerIntrinsics.panic-unwind.diff | 4 +- ..._metadata.LowerIntrinsics.panic-abort.diff | 6 +- ...metadata.LowerIntrinsics.panic-unwind.diff | 6 +- ..._pointers.LowerIntrinsics.panic-abort.diff | 12 +- ...pointers.LowerIntrinsics.panic-unwind.diff | 12 +- ...non_const.LowerIntrinsics.panic-abort.diff | 2 +- ...on_const.LowerIntrinsics.panic-unwind.diff | 2 +- ...tr_offset.LowerIntrinsics.panic-abort.diff | 4 +- ...r_offset.LowerIntrinsics.panic-unwind.diff | 4 +- ...primitive.LowerIntrinsics.panic-abort.diff | 2 +- ...rimitive.LowerIntrinsics.panic-unwind.diff | 2 +- ...inhabited.LowerIntrinsics.panic-abort.diff | 2 +- ...nhabited.LowerIntrinsics.panic-unwind.diff | 2 +- ...pare_char.LowerIntrinsics.panic-abort.diff | 4 +- ...are_char.LowerIntrinsics.panic-unwind.diff | 4 +- ...re_signed.LowerIntrinsics.panic-abort.diff | 4 +- ...e_signed.LowerIntrinsics.panic-unwind.diff | 4 +- ..._unsigned.LowerIntrinsics.panic-abort.diff | 4 +- ...unsigned.LowerIntrinsics.panic-unwind.diff | 4 +- ...inhabited.LowerIntrinsics.panic-abort.diff | 2 +- ...nhabited.LowerIntrinsics.panic-unwind.diff | 2 +- ...e_ref_dst.LowerIntrinsics.panic-abort.diff | 2 +- ..._ref_dst.LowerIntrinsics.panic-unwind.diff | 2 +- ...inhabited.LowerIntrinsics.panic-abort.diff | 2 +- ...nhabited.LowerIntrinsics.panic-unwind.diff | 2 +- ...inhabited.LowerIntrinsics.panic-abort.diff | 2 +- ...nhabited.LowerIntrinsics.panic-unwind.diff | 2 +- ...unchecked.LowerIntrinsics.panic-abort.diff | 36 +- ...nchecked.LowerIntrinsics.panic-unwind.diff | 36 +- ..._overflow.LowerIntrinsics.panic-abort.diff | 12 +- ...overflow.LowerIntrinsics.panic-unwind.diff | 12 +- ....wrapping.LowerIntrinsics.panic-abort.diff | 12 +- ...wrapping.LowerIntrinsics.panic-unwind.diff | 12 +- ....bound.LowerSliceLenCalls.panic-abort.diff | 10 +- ...bound.LowerSliceLenCalls.panic-unwind.diff | 10 +- ...fg-initial.after-ElaborateDrops.after.diff | 28 +- ...fg-initial.after-ElaborateDrops.after.diff | 28 +- ...ranches.bar.MatchBranchSimplification.diff | 16 +- ...ranches.foo.MatchBranchSimplification.diff | 2 +- ...h_i128_u128.MatchBranchSimplification.diff | 2 +- ...h_nested_if.MatchBranchSimplification.diff | 10 +- ...sext_i8_i16.MatchBranchSimplification.diff | 2 +- ...sext_i8_u16.MatchBranchSimplification.diff | 2 +- ...runc_i16_i8.MatchBranchSimplification.diff | 2 +- ...runc_i16_u8.MatchBranchSimplification.diff | 2 +- ...runc_u16_i8.MatchBranchSimplification.diff | 2 +- ...runc_u16_u8.MatchBranchSimplification.diff | 2 +- ...match_u8_i8.MatchBranchSimplification.diff | 2 +- ...tch_u8_i8_2.MatchBranchSimplification.diff | 8 +- ...i8_2_failed.MatchBranchSimplification.diff | 4 +- ...ailed_len_1.MatchBranchSimplification.diff | 2 +- ...ailed_len_2.MatchBranchSimplification.diff | 2 +- ...zext_u8_i16.MatchBranchSimplification.diff | 2 +- ...zext_u8_u16.MatchBranchSimplification.diff | 2 +- ...stive_match.MatchBranchSimplification.diff | 2 +- ...ve_match_i8.MatchBranchSimplification.diff | 2 +- ...egion_subtyping_basic.main.nll.0.32bit.mir | 8 +- ...egion_subtyping_basic.main.nll.0.64bit.mir | 8 +- ...ompile_111005.wrong.RenameReturnPlace.diff | 6 +- ...le.nrvo.RenameReturnPlace.panic-abort.diff | 4 +- ...e.nrvo.RenameReturnPlace.panic-unwind.diff | 4 +- ...ut_second_or.SimplifyCfg-initial.after.mir | 24 +- ...le_switchint.SimplifyCfg-initial.after.mir | 8 +- ...ned_comparison.bitand.PreCodegen.after.mir | 20 +- ...ined_comparison.naive.PreCodegen.after.mir | 20 +- ..._comparison.returning.PreCodegen.after.mir | 20 +- ...ecked_shl.PreCodegen.after.panic-abort.mir | 4 +- ...cked_shl.PreCodegen.after.panic-unwind.mir | 4 +- ...p_forward.PreCodegen.after.panic-abort.mir | 12 +- ..._forward.PreCodegen.after.panic-unwind.mir | 12 +- ....{impl#0}-partial_cmp.PreCodegen.after.mir | 12 +- ...d_constant.main.GVN.32bit.panic-abort.diff | 14 +- ..._constant.main.GVN.32bit.panic-unwind.diff | 12 +- ...d_constant.main.GVN.64bit.panic-abort.diff | 14 +- ..._constant.main.GVN.64bit.panic-unwind.diff | 12 +- .../loops.filter_mapped.PreCodegen.after.mir | 2 +- .../loops.int_range.PreCodegen.after.mir | 16 +- .../loops.mapped.PreCodegen.after.mir | 4 +- ...l_replace.PreCodegen.after.panic-abort.mir | 4 +- ..._replace.PreCodegen.after.panic-unwind.mir | 4 +- ...m_replace.PreCodegen.after.panic-abort.mir | 4 +- ..._replace.PreCodegen.after.panic-unwind.mir | 4 +- ..._clone.{impl#0}-clone.PreCodegen.after.mir | 2 +- ...o_variable.main.GVN.32bit.panic-abort.diff | 8 +- ..._variable.main.GVN.32bit.panic-unwind.diff | 8 +- ...o_variable.main.GVN.64bit.panic-abort.diff | 8 +- ..._variable.main.GVN.64bit.panic-unwind.diff | 8 +- ...acementOfAggregates.32bit.panic-abort.diff | 10 +- ...cementOfAggregates.32bit.panic-unwind.diff | 10 +- ...acementOfAggregates.64bit.panic-abort.diff | 10 +- ...cementOfAggregates.64bit.panic-unwind.diff | 10 +- ...e_add_fat.PreCodegen.after.panic-abort.mir | 8 +- ..._add_fat.PreCodegen.after.panic-unwind.mir | 8 +- ..._add_thin.PreCodegen.after.panic-abort.mir | 6 +- ...add_thin.PreCodegen.after.panic-unwind.mir | 6 +- ...ward_loop.PreCodegen.after.panic-abort.mir | 16 +- ...ard_loop.PreCodegen.after.panic-unwind.mir | 16 +- ...sive_loop.PreCodegen.after.panic-abort.mir | 8 +- ...ive_loop.PreCodegen.after.panic-unwind.mir | 8 +- ...iter_next.PreCodegen.after.panic-abort.mir | 10 +- ...ter_next.PreCodegen.after.panic-unwind.mir | 10 +- ...mple_option_map.ezmap.PreCodegen.after.mir | 4 +- ...variant_a-{closure#0}.PreCodegen.after.mir | 26 +- ...variant_b-{closure#0}.PreCodegen.after.mir | 18 +- ...mut_usize.PreCodegen.after.panic-abort.mir | 10 +- ...ut_usize.PreCodegen.after.panic-unwind.mir | 10 +- ...mut_range.PreCodegen.after.panic-abort.mir | 12 +- ...ut_range.PreCodegen.after.panic-unwind.mir | 12 +- ...dex_usize.PreCodegen.after.panic-abort.mir | 6 +- ...ex_usize.PreCodegen.after.panic-unwind.mir | 6 +- ...ked_range.PreCodegen.after.panic-abort.mir | 12 +- ...ed_range.PreCodegen.after.panic-unwind.mir | 12 +- ...ated_loop.PreCodegen.after.panic-abort.mir | 36 +- ...ted_loop.PreCodegen.after.panic-unwind.mir | 26 +- ...ward_loop.PreCodegen.after.panic-abort.mir | 22 +- ...ard_loop.PreCodegen.after.panic-unwind.mir | 22 +- ...ange_loop.PreCodegen.after.panic-abort.mir | 20 +- ...nge_loop.PreCodegen.after.panic-unwind.mir | 20 +- ...erse_loop.PreCodegen.after.panic-abort.mir | 24 +- ...rse_loop.PreCodegen.after.panic-unwind.mir | 24 +- ..._is_empty.PreCodegen.after.panic-abort.mir | 18 +- ...is_empty.PreCodegen.after.panic-unwind.mir | 18 +- ...ans.outer.PreCodegen.after.panic-abort.mir | 2 +- ...ns.outer.PreCodegen.after.panic-unwind.mir | 2 +- .../try_identity.new.PreCodegen.after.mir | 8 +- .../try_identity.old.PreCodegen.after.mir | 4 +- ..._to_slice.PreCodegen.after.panic-abort.mir | 10 +- ...to_slice.PreCodegen.after.panic-unwind.mir | 10 +- ...dominate_storage.ReferencePropagation.diff | 6 +- ..._prop.maybe_dead.ReferencePropagation.diff | 16 +- ...multiple_storage.ReferencePropagation.diff | 4 +- ...raw_then_mut_shr.ReferencePropagation.diff | 10 +- ...read_through_raw.ReferencePropagation.diff | 8 +- ...ence_propagation.ReferencePropagation.diff | 48 +-- ...gation_const_ptr.ReferencePropagation.diff | 52 +-- ..._propagation_mut.ReferencePropagation.diff | 30 +- ...pagation_mut_ptr.ReferencePropagation.diff | 38 +- ...ique_with_copies.ReferencePropagation.diff | 8 +- ...guard.CleanupPostBorrowck.panic-abort.diff | 4 +- ...uard.CleanupPostBorrowck.panic-unwind.diff | 4 +- ...main.RemoveStorageMarkers.panic-abort.diff | 6 +- ...ain.RemoveStorageMarkers.panic-unwind.diff | 6 +- ...s.opt.RemoveUnneededDrops.panic-abort.diff | 2 +- ....opt.RemoveUnneededDrops.panic-unwind.diff | 2 +- ..._copy.RemoveUnneededDrops.panic-abort.diff | 2 +- ...copy.RemoveUnneededDrops.panic-unwind.diff | 2 +- ...fg-pre-optimizations.after.panic-abort.mir | 14 +- ...g-pre-optimizations.after.panic-unwind.mir | 14 +- ...fg-pre-optimizations.after.panic-abort.mir | 2 +- ...g-pre-optimizations.after.panic-unwind.mir | 2 +- ...fg-pre-optimizations.after.panic-abort.mir | 2 +- ...g-pre-optimizations.after.panic-unwind.mir | 2 +- ...fg-pre-optimizations.after.panic-abort.mir | 6 +- ...g-pre-optimizations.after.panic-unwind.mir | 6 +- ...fg-pre-optimizations.after.panic-abort.mir | 2 +- ...g-pre-optimizations.after.panic-unwind.mir | 2 +- ...e_const_switch.identity.JumpThreading.diff | 18 +- ...onst_switch.too_complex.JumpThreading.diff | 14 +- .../set_no_discriminant.f.JumpThreading.diff | 2 +- ...no_discriminant.generic.JumpThreading.diff | 2 +- ...yCfg-after-unreachable-enum-branching.diff | 6 +- ...ance.SimplifyLocals-before-const-prop.diff | 2 +- ...s.t1.SimplifyLocals-before-const-prop.diff | 2 +- ...s.t3.SimplifyLocals-before-const-prop.diff | 2 +- ...s.t4.SimplifyLocals-before-const-prop.diff | 2 +- ....foo.SimplifyLocals-final.panic-abort.diff | 2 +- ...foo.SimplifyLocals-final.panic-unwind.diff | 2 +- ...yLocals-before-const-prop.panic-abort.diff | 4 +- ...Locals-before-const-prop.panic-unwind.diff | 4 +- .../simplify_match.main.GVN.panic-abort.diff | 4 +- .../simplify_match.main.GVN.panic-unwind.diff | 4 +- ...nst_debug.SingleUseConsts.panic-abort.diff | 2 +- ...st_debug.SingleUseConsts.panic-unwind.diff | 2 +- ...tch_const.SingleUseConsts.panic-abort.diff | 2 +- ...ch_const.SingleUseConsts.panic-unwind.diff | 2 +- ...nst_debug.SingleUseConsts.panic-abort.diff | 2 +- ...st_debug.SingleUseConsts.panic-unwind.diff | 2 +- ...[String].AddMovesForPackedDrops.before.mir | 4 +- ...mes.foo.ScalarReplacementOfAggregates.diff | 6 +- ...onstant.ScalarReplacementOfAggregates.diff | 8 +- ....copies.ScalarReplacementOfAggregates.diff | 32 +- ...s.enums.ScalarReplacementOfAggregates.diff | 6 +- ...ts.flat.ScalarReplacementOfAggregates.diff | 16 +- ..._copies.ScalarReplacementOfAggregates.diff | 18 +- ...structs.ScalarReplacementOfAggregates.diff | 6 +- ....unions.ScalarReplacementOfAggregates.diff | 4 +- tests/mir-opt/storage_ranges.main.nll.0.mir | 2 +- ...o_self.test.MatchBranchSimplification.diff | 4 +- ...ll_drops.f.ElaborateDrops.panic-abort.diff | 2 +- ...l_drops.f.ElaborateDrops.panic-unwind.diff | 2 +- ...f_with_arg.ElaborateDrops.panic-abort.diff | 2 +- ..._with_arg.ElaborateDrops.panic-unwind.diff | 2 +- ...d_access.bar.SimplifyCfg-initial.after.mir | 8 +- ...d_access.foo.SimplifyCfg-initial.after.mir | 8 +- ...ch.UnreachablePropagation.panic-abort.diff | 2 +- ...h.UnreachablePropagation.panic-unwind.diff | 2 +- ...et.UnreachablePropagation.panic-abort.diff | 2 +- ...t.UnreachablePropagation.panic-unwind.diff | 2 +- ...in.UnreachablePropagation.panic-abort.diff | 4 +- ...n.UnreachablePropagation.panic-unwind.diff | 4 +- ....UnreachableEnumBranching.panic-abort.diff | 2 +- ...UnreachableEnumBranching.panic-unwind.diff | 2 +- 678 files changed, 3567 insertions(+), 3567 deletions(-) diff --git a/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir b/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir index cb72ad3d2531d..be636da4517ca 100644 --- a/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir @@ -140,7 +140,7 @@ fn address_of_reborrow() -> () { StorageLive(_6); _6 = &raw const (*_1); AscribeUserType(_6, o, UserTypeProjection { base: UserType(0), projs: [] }); - _5 = _6; + _5 = copy _6; StorageDead(_6); StorageDead(_5); StorageLive(_7); @@ -153,7 +153,7 @@ fn address_of_reborrow() -> () { _9 = move _10 as *const dyn std::marker::Send (PointerCoercion(Unsize)); StorageDead(_10); AscribeUserType(_9, o, UserTypeProjection { base: UserType(1), projs: [] }); - _8 = _9; + _8 = copy _9; StorageDead(_9); StorageDead(_8); StorageLive(_11); @@ -194,7 +194,7 @@ fn address_of_reborrow() -> () { StorageLive(_22); _22 = &raw const (*_3); AscribeUserType(_22, o, UserTypeProjection { base: UserType(10), projs: [] }); - _21 = _22; + _21 = copy _22; StorageDead(_22); StorageDead(_21); StorageLive(_23); @@ -207,7 +207,7 @@ fn address_of_reborrow() -> () { _25 = move _26 as *const dyn std::marker::Send (PointerCoercion(Unsize)); StorageDead(_26); AscribeUserType(_25, o, UserTypeProjection { base: UserType(11), projs: [] }); - _24 = _25; + _24 = copy _25; StorageDead(_25); StorageDead(_24); StorageLive(_27); @@ -242,7 +242,7 @@ fn address_of_reborrow() -> () { StorageLive(_36); _36 = &raw mut (*_3); AscribeUserType(_36, o, UserTypeProjection { base: UserType(20), projs: [] }); - _35 = _36; + _35 = copy _36; StorageDead(_36); StorageDead(_35); StorageLive(_37); @@ -255,7 +255,7 @@ fn address_of_reborrow() -> () { _39 = move _40 as *mut dyn std::marker::Send (PointerCoercion(Unsize)); StorageDead(_40); AscribeUserType(_39, o, UserTypeProjection { base: UserType(21), projs: [] }); - _38 = _39; + _38 = copy _39; StorageDead(_39); StorageDead(_38); StorageLive(_41); diff --git a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir index ef51b07827fb4..a467987e88612 100644 --- a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir +++ b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -33,17 +33,17 @@ fn main() -> () { StorageDead(_4); StorageLive(_5); StorageLive(_6); - _6 = _3; + _6 = copy _3; _5 = foo(move _6) -> [return: bb1, unwind unreachable]; } bb1: { StorageDead(_6); StorageLive(_7); - _7 = _2; + _7 = copy _2; _8 = Len(_1); - _9 = Lt(_7, _8); - assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind unreachable]; + _9 = Lt(copy _7, copy _8); + assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb2, unwind unreachable]; } bb2: { diff --git a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index d1aa9382a2c5d..bd7365543bdce 100644 --- a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir +++ b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -33,17 +33,17 @@ fn main() -> () { StorageDead(_4); StorageLive(_5); StorageLive(_6); - _6 = _3; + _6 = copy _3; _5 = foo(move _6) -> [return: bb1, unwind continue]; } bb1: { StorageDead(_6); StorageLive(_7); - _7 = _2; + _7 = copy _2; _8 = Len(_1); - _9 = Lt(_7, _8); - assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind continue]; + _9 = Lt(copy _7, copy _8); + assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb2, unwind continue]; } bb2: { diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-abort.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-abort.mir index 1c34955a8d9da..1f5bb551b8e01 100644 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-abort.mir +++ b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-abort.mir @@ -22,7 +22,7 @@ yields () bb0: { StorageLive(_3); - _3 = (_1.0: i32); + _3 = copy (_1.0: i32); FakeRead(ForLet(None), _3); StorageLive(_4); _4 = &_3; diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-unwind.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-unwind.mir index 1c34955a8d9da..1f5bb551b8e01 100644 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-unwind.mir +++ b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-unwind.mir @@ -22,7 +22,7 @@ yields () bb0: { StorageLive(_3); - _3 = (_1.0: i32); + _3 = copy (_1.0: i32); FakeRead(ForLet(None), _3); StorageLive(_4); _4 = &_3; diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-abort.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-abort.mir index 516908144a641..17fa93148064f 100644 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-abort.mir +++ b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-abort.mir @@ -22,7 +22,7 @@ yields () bb0: { StorageLive(_3); - _3 = (_1.0: i32); + _3 = copy (_1.0: i32); FakeRead(ForLet(None), _3); StorageLive(_4); _4 = &_3; diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-unwind.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-unwind.mir index 516908144a641..17fa93148064f 100644 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-unwind.mir +++ b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-unwind.mir @@ -22,7 +22,7 @@ yields () bb0: { StorageLive(_3); - _3 = (_1.0: i32); + _3 = copy (_1.0: i32); FakeRead(ForLet(None), _3); StorageLive(_4); _4 = &_3; diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-abort.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-abort.mir index ba20c28cd0147..3fdc81791deef 100644 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-abort.mir +++ b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-abort.mir @@ -4,7 +4,7 @@ fn main::{closure#0}::{closure#1}(_1: &{async closure@$DIR/async_closure_shims.r let mut _0: {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10}; bb0: { - _0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: ((*_1).0: &i32) }; + _0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: copy ((*_1).0: &i32) }; return; } } diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-unwind.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-unwind.mir index ba20c28cd0147..3fdc81791deef 100644 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-unwind.mir +++ b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-unwind.mir @@ -4,7 +4,7 @@ fn main::{closure#0}::{closure#1}(_1: &{async closure@$DIR/async_closure_shims.r let mut _0: {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10}; bb0: { - _0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: ((*_1).0: &i32) }; + _0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: copy ((*_1).0: &i32) }; return; } } diff --git a/tests/mir-opt/basic_assignment.main.ElaborateDrops.diff b/tests/mir-opt/basic_assignment.main.ElaborateDrops.diff index f187f95972795..2d6adaca19e61 100644 --- a/tests/mir-opt/basic_assignment.main.ElaborateDrops.diff +++ b/tests/mir-opt/basic_assignment.main.ElaborateDrops.diff @@ -27,7 +27,7 @@ _1 = const false; StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = move _3; StorageDead(_3); StorageLive(_4); diff --git a/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir b/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir index 5c0d1e9b93ffa..d4f0363e44314 100644 --- a/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir @@ -31,7 +31,7 @@ fn main() -> () { FakeRead(ForLet(None), _1); StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = move _3; StorageDead(_3); StorageLive(_4); diff --git a/tests/mir-opt/building/async_await.b-{closure#0}.coroutine_resume.0.mir b/tests/mir-opt/building/async_await.b-{closure#0}.coroutine_resume.0.mir index c0f16ee7ec0b4..c1c2fdcfa949e 100644 --- a/tests/mir-opt/building/async_await.b-{closure#0}.coroutine_resume.0.mir +++ b/tests/mir-opt/building/async_await.b-{closure#0}.coroutine_resume.0.mir @@ -151,7 +151,7 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) -> StorageLive(_13); StorageLive(_14); StorageLive(_15); - _15 = _38; + _15 = copy _38; _14 = move _15; goto -> bb6; } @@ -194,8 +194,8 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) -> bb10: { StorageLive(_17); - _17 = ((_9 as Ready).0: ()); - _3 = _17; + _17 = copy ((_9 as Ready).0: ()); + _3 = copy _17; StorageDead(_17); StorageDead(_14); StorageDead(_12); @@ -253,7 +253,7 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) -> StorageLive(_29); StorageLive(_30); StorageLive(_31); - _31 = _38; + _31 = copy _38; _30 = move _31; goto -> bb18; } @@ -291,8 +291,8 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) -> bb21: { StorageLive(_33); - _33 = ((_25 as Ready).0: ()); - _37 = _33; + _33 = copy ((_25 as Ready).0: ()); + _37 = copy _33; StorageDead(_33); StorageDead(_30); StorageDead(_28); diff --git a/tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir b/tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir index c14882142f56f..6d4d261b895a3 100644 --- a/tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir +++ b/tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir @@ -9,8 +9,8 @@ fn adt() -> Onion { bb0: { _1 = const 1_i32; _2 = Foo { a: const 1_i32, b: const 2_i32 }; - _3 = Bar::Foo(move _2, _1); - _0 = Onion { neon: ((_3 as variant#0).1: i32) }; + _3 = Bar::Foo(move _2, copy _1); + _0 = Onion { neon: copy ((_3 as variant#0).1: i32) }; return; } } diff --git a/tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir b/tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir index fde007abab0ac..2c14258956a98 100644 --- a/tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir +++ b/tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir @@ -8,7 +8,7 @@ fn array() -> [i32; 2] { bb0: { _1 = [const 42_i32, const 43_i32]; _2 = const 1_i32; - _1 = [_2, const 2_i32]; + _1 = [copy _2, const 2_i32]; _0 = move _1; return; } diff --git a/tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir b/tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir index 189996f117982..72a16b3588524 100644 --- a/tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir +++ b/tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir @@ -6,17 +6,17 @@ fn arbitrary_let(_1: i32) -> i32 { let mut _3: i32; bb0: { - _2 = _1; + _2 = copy _1; goto -> bb2; } bb1: { - _0 = _3; + _0 = copy _3; return; } bb2: { - _3 = _2; + _3 = copy _2; goto -> bb1; } } diff --git a/tests/mir-opt/building/custom/arrays.arrays.built.after.mir b/tests/mir-opt/building/custom/arrays.arrays.built.after.mir index eaeba302f1510..30d11e31e4d4e 100644 --- a/tests/mir-opt/building/custom/arrays.arrays.built.after.mir +++ b/tests/mir-opt/building/custom/arrays.arrays.built.after.mir @@ -8,7 +8,7 @@ fn arrays() -> usize { bb0: { _1 = [const 5_i32; C]; _2 = Len(_1); - _0 = _2; + _0 = copy _2; return; } } diff --git a/tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir b/tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir index e3334bc7dbee4..93750719d2704 100644 --- a/tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir +++ b/tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir @@ -4,7 +4,7 @@ fn float_to_int(_1: f32) -> i32 { let mut _0: i32; bb0: { - _0 = _1 as i32 (FloatToInt); + _0 = copy _1 as i32 (FloatToInt); return; } } diff --git a/tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir b/tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir index d71cb9d78d338..9adec45d64b15 100644 --- a/tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir +++ b/tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir @@ -4,7 +4,7 @@ fn int_to_int(_1: u32) -> i32 { let mut _0: i32; bb0: { - _0 = _1 as i32 (IntToInt); + _0 = copy _1 as i32 (IntToInt); return; } } diff --git a/tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir b/tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir index faff79e8c5786..aa64225809566 100644 --- a/tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir +++ b/tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir @@ -4,7 +4,7 @@ fn int_to_ptr(_1: usize) -> *const i32 { let mut _0: *const i32; bb0: { - _0 = _1 as *const i32 (PointerWithExposedProvenance); + _0 = copy _1 as *const i32 (PointerWithExposedProvenance); return; } } diff --git a/tests/mir-opt/building/custom/assume.assume_local.built.after.mir b/tests/mir-opt/building/custom/assume.assume_local.built.after.mir index 7ea1fcd30c2ec..36e2859ce16dc 100644 --- a/tests/mir-opt/building/custom/assume.assume_local.built.after.mir +++ b/tests/mir-opt/building/custom/assume.assume_local.built.after.mir @@ -4,7 +4,7 @@ fn assume_local(_1: bool) -> () { let mut _0: (); bb0: { - assume(_1); + assume(copy _1); return; } } diff --git a/tests/mir-opt/building/custom/assume.assume_place.built.after.mir b/tests/mir-opt/building/custom/assume.assume_place.built.after.mir index ce914618d3dce..074af333d63a8 100644 --- a/tests/mir-opt/building/custom/assume.assume_place.built.after.mir +++ b/tests/mir-opt/building/custom/assume.assume_place.built.after.mir @@ -4,7 +4,7 @@ fn assume_place(_1: (bool, u8)) -> () { let mut _0: (); bb0: { - assume((_1.0: bool)); + assume(copy (_1.0: bool)); return; } } diff --git a/tests/mir-opt/building/custom/enums.switch_bool.built.after.mir b/tests/mir-opt/building/custom/enums.switch_bool.built.after.mir index f82e5f1c6fd0a..beefef331df84 100644 --- a/tests/mir-opt/building/custom/enums.switch_bool.built.after.mir +++ b/tests/mir-opt/building/custom/enums.switch_bool.built.after.mir @@ -4,7 +4,7 @@ fn switch_bool(_1: bool) -> u32 { let mut _0: u32; bb0: { - switchInt(_1) -> [1: bb1, 0: bb2, otherwise: bb2]; + switchInt(copy _1) -> [1: bb1, 0: bb2, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/building/custom/enums.switch_option.built.after.mir b/tests/mir-opt/building/custom/enums.switch_option.built.after.mir index fa03f274be340..a854df878668d 100644 --- a/tests/mir-opt/building/custom/enums.switch_option.built.after.mir +++ b/tests/mir-opt/building/custom/enums.switch_option.built.after.mir @@ -6,7 +6,7 @@ fn switch_option(_1: Option<()>) -> bool { bb0: { _2 = discriminant(_1); - switchInt(_2) -> [0: bb1, 1: bb2, otherwise: bb2]; + switchInt(copy _2) -> [0: bb1, 1: bb2, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir b/tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir index eec2197a8bd3a..4ffc08772a844 100644 --- a/tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir +++ b/tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir @@ -6,7 +6,7 @@ fn switch_option_repr(_1: Bool) -> bool { bb0: { _2 = discriminant(_1); - switchInt(_2) -> [0: bb2, otherwise: bb1]; + switchInt(copy _2) -> [0: bb2, otherwise: bb1]; } bb1: { diff --git a/tests/mir-opt/building/custom/operators.f.built.after.mir b/tests/mir-opt/building/custom/operators.f.built.after.mir index cac82f7b3ea3b..ed6cddd548fb2 100644 --- a/tests/mir-opt/building/custom/operators.f.built.after.mir +++ b/tests/mir-opt/building/custom/operators.f.built.after.mir @@ -5,26 +5,26 @@ fn f(_1: i32, _2: bool) -> i32 { let mut _3: (i32, bool); bb0: { - _1 = Neg(_1); - _2 = Not(_2); - _1 = Add(_1, _1); - _1 = Sub(_1, _1); - _1 = Mul(_1, _1); - _1 = Div(_1, _1); - _1 = Rem(_1, _1); - _1 = BitXor(_1, _1); - _1 = BitAnd(_1, _1); - _1 = Shl(_1, _1); - _1 = Shr(_1, _1); - _2 = Eq(_1, _1); - _2 = Lt(_1, _1); - _2 = Le(_1, _1); - _2 = Ge(_1, _1); - _2 = Gt(_1, _1); - _3 = AddWithOverflow(_1, _1); - _2 = (_3.1: bool); - _1 = (_3.0: i32); - _0 = _1; + _1 = Neg(copy _1); + _2 = Not(copy _2); + _1 = Add(copy _1, copy _1); + _1 = Sub(copy _1, copy _1); + _1 = Mul(copy _1, copy _1); + _1 = Div(copy _1, copy _1); + _1 = Rem(copy _1, copy _1); + _1 = BitXor(copy _1, copy _1); + _1 = BitAnd(copy _1, copy _1); + _1 = Shl(copy _1, copy _1); + _1 = Shr(copy _1, copy _1); + _2 = Eq(copy _1, copy _1); + _2 = Lt(copy _1, copy _1); + _2 = Le(copy _1, copy _1); + _2 = Ge(copy _1, copy _1); + _2 = Gt(copy _1, copy _1); + _3 = AddWithOverflow(copy _1, copy _1); + _2 = copy (_3.1: bool); + _1 = copy (_3.0: i32); + _0 = copy _1; return; } } diff --git a/tests/mir-opt/building/custom/operators.g.runtime.after.mir b/tests/mir-opt/building/custom/operators.g.runtime.after.mir index a0ad7d0f93f4e..7d87fd9327838 100644 --- a/tests/mir-opt/building/custom/operators.g.runtime.after.mir +++ b/tests/mir-opt/building/custom/operators.g.runtime.after.mir @@ -6,8 +6,8 @@ fn g(_1: *const i32, _2: *const [i32]) -> () { let mut _4: usize; bb0: { - _3 = PtrMetadata(_1); - _4 = PtrMetadata(_2); + _3 = PtrMetadata(copy _1); + _4 = PtrMetadata(copy _2); return; } } diff --git a/tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir b/tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir index b1ba5f9314d51..b28e96f10eae7 100644 --- a/tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir +++ b/tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir @@ -6,7 +6,7 @@ fn copy_for_deref(_1: (&i32, i32)) -> i32 { bb0: { _2 = deref_copy (_1.0: &i32); - _0 = (*_2); + _0 = copy (*_2); return; } } diff --git a/tests/mir-opt/building/custom/projections.simple_index.built.after.mir b/tests/mir-opt/building/custom/projections.simple_index.built.after.mir index f74c61009d341..2cd781696da7c 100644 --- a/tests/mir-opt/building/custom/projections.simple_index.built.after.mir +++ b/tests/mir-opt/building/custom/projections.simple_index.built.after.mir @@ -6,8 +6,8 @@ fn simple_index(_1: [i32; 10], _2: &[i32]) -> i32 { bb0: { _3 = const 3_usize; - _0 = _1[_3]; - _0 = (*_2)[_3]; + _0 = copy _1[_3]; + _0 = copy (*_2)[_3]; return; } } diff --git a/tests/mir-opt/building/custom/projections.tuples.built.after.mir b/tests/mir-opt/building/custom/projections.tuples.built.after.mir index a370de2ed8439..d07269cd0d30d 100644 --- a/tests/mir-opt/building/custom/projections.tuples.built.after.mir +++ b/tests/mir-opt/building/custom/projections.tuples.built.after.mir @@ -4,8 +4,8 @@ fn tuples(_1: (u32, i32)) -> (u32, i32) { let mut _0: (u32, i32); bb0: { - (_0.0: u32) = (_1.0: u32); - (_0.1: i32) = (_1.1: i32); + (_0.0: u32) = copy (_1.0: u32); + (_0.1: i32) = copy (_1.1: i32); return; } } diff --git a/tests/mir-opt/building/custom/projections.unions.built.after.mir b/tests/mir-opt/building/custom/projections.unions.built.after.mir index 4189b329e8cc5..fe4f7acebb52b 100644 --- a/tests/mir-opt/building/custom/projections.unions.built.after.mir +++ b/tests/mir-opt/building/custom/projections.unions.built.after.mir @@ -4,7 +4,7 @@ fn unions(_1: U) -> i32 { let mut _0: i32; bb0: { - _0 = (_1.0: i32); + _0 = copy (_1.0: i32); return; } } diff --git a/tests/mir-opt/building/custom/projections.unwrap.built.after.mir b/tests/mir-opt/building/custom/projections.unwrap.built.after.mir index 0c43bdc9d24d0..ea706e0a97d20 100644 --- a/tests/mir-opt/building/custom/projections.unwrap.built.after.mir +++ b/tests/mir-opt/building/custom/projections.unwrap.built.after.mir @@ -4,7 +4,7 @@ fn unwrap(_1: Option) -> i32 { let mut _0: i32; bb0: { - _0 = ((_1 as variant#1).0: i32); + _0 = copy ((_1 as variant#1).0: i32); return; } } diff --git a/tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir b/tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir index 39e9785134380..eb83dcece3e82 100644 --- a/tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir +++ b/tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir @@ -4,7 +4,7 @@ fn unwrap_deref(_1: Option<&i32>) -> i32 { let mut _0: i32; bb0: { - _0 = (*((_1 as variant#1).0: &i32)); + _0 = copy (*((_1 as variant#1).0: &i32)); return; } } diff --git a/tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir b/tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir index 8046b543eefc9..3893613bff9f4 100644 --- a/tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir +++ b/tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir @@ -4,7 +4,7 @@ fn raw_pointer_offset(_1: *const i32) -> *const i32 { let mut _0: *const i32; bb0: { - _0 = Offset(_1, const 1_isize); + _0 = Offset(copy _1, const 1_isize); return; } } diff --git a/tests/mir-opt/building/custom/simple_assign.simple.built.after.mir b/tests/mir-opt/building/custom/simple_assign.simple.built.after.mir index 6f7aaeed97990..10ad840f98c50 100644 --- a/tests/mir-opt/building/custom/simple_assign.simple.built.after.mir +++ b/tests/mir-opt/building/custom/simple_assign.simple.built.after.mir @@ -7,14 +7,14 @@ fn simple(_1: i32) -> i32 { bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; goto -> bb1; } bb1: { _3 = move _2; StorageDead(_2); - _0 = _3; + _0 = copy _3; return; } } diff --git a/tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir b/tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir index 9cf26dff35033..44030abc79747 100644 --- a/tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir +++ b/tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir @@ -4,7 +4,7 @@ fn assert_nonzero(_1: i32) -> () { let mut _0: (); bb0: { - switchInt(_1) -> [0: bb1, otherwise: bb2]; + switchInt(copy _1) -> [0: bb1, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/building/custom/terminators.direct_call.built.after.mir b/tests/mir-opt/building/custom/terminators.direct_call.built.after.mir index 07044ceaef440..b29d4ec70957b 100644 --- a/tests/mir-opt/building/custom/terminators.direct_call.built.after.mir +++ b/tests/mir-opt/building/custom/terminators.direct_call.built.after.mir @@ -4,7 +4,7 @@ fn direct_call(_1: i32) -> i32 { let mut _0: i32; bb0: { - _0 = ident::(_1) -> [return: bb1, unwind continue]; + _0 = ident::(copy _1) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir b/tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir index 3b849354dcd8e..b88f660302693 100644 --- a/tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir +++ b/tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir @@ -4,7 +4,7 @@ fn indirect_call(_1: i32, _2: fn(i32) -> i32) -> i32 { let mut _0: i32; bb0: { - _0 = _2(_1) -> [return: bb1, unwind continue]; + _0 = copy _2(copy _1) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/building/custom/terminators.tail_call.built.after.mir b/tests/mir-opt/building/custom/terminators.tail_call.built.after.mir index 4cf6e459aa820..ab3925dae1c3a 100644 --- a/tests/mir-opt/building/custom/terminators.tail_call.built.after.mir +++ b/tests/mir-opt/building/custom/terminators.tail_call.built.after.mir @@ -5,7 +5,7 @@ fn tail_call(_1: i32) -> i32 { let mut _2: i32; bb0: { - _2 = Add(_1, const 42_i32); - tailcall ident::(Spanned { node: _2, span: $DIR/terminators.rs:32:28: 32:29 (#0) }); + _2 = Add(copy _1, const 42_i32); + tailcall ident::(Spanned { node: copy _2, span: $DIR/terminators.rs:32:28: 32:29 (#0) }); } } diff --git a/tests/mir-opt/building/enum_cast.bar.built.after.mir b/tests/mir-opt/building/enum_cast.bar.built.after.mir index 512c73216198e..72d0cf5d1e823 100644 --- a/tests/mir-opt/building/enum_cast.bar.built.after.mir +++ b/tests/mir-opt/building/enum_cast.bar.built.after.mir @@ -12,8 +12,8 @@ fn bar(_1: Bar) -> usize { StorageLive(_2); _2 = move _1; _3 = discriminant(_2); - _4 = _3 as u8 (IntToInt); - _5 = Le(_4, const 1_u8); + _4 = copy _3 as u8 (IntToInt); + _5 = Le(copy _4, const 1_u8); assume(move _5); _0 = move _3 as usize (IntToInt); StorageDead(_2); diff --git a/tests/mir-opt/building/enum_cast.boo.built.after.mir b/tests/mir-opt/building/enum_cast.boo.built.after.mir index ad0adf14e4ac8..91e06dc886299 100644 --- a/tests/mir-opt/building/enum_cast.boo.built.after.mir +++ b/tests/mir-opt/building/enum_cast.boo.built.after.mir @@ -12,8 +12,8 @@ fn boo(_1: Boo) -> usize { StorageLive(_2); _2 = move _1; _3 = discriminant(_2); - _4 = _3 as u8 (IntToInt); - _5 = Le(_4, const 1_u8); + _4 = copy _3 as u8 (IntToInt); + _5 = Le(copy _4, const 1_u8); assume(move _5); _0 = move _3 as usize (IntToInt); StorageDead(_2); diff --git a/tests/mir-opt/building/enum_cast.droppy.built.after.mir b/tests/mir-opt/building/enum_cast.droppy.built.after.mir index ea0edb610f5cc..f53c9199a4949 100644 --- a/tests/mir-opt/building/enum_cast.droppy.built.after.mir +++ b/tests/mir-opt/building/enum_cast.droppy.built.after.mir @@ -31,8 +31,8 @@ fn droppy() -> () { StorageLive(_4); _4 = move _2; _5 = discriminant(_4); - _6 = _5 as u8 (IntToInt); - _7 = Le(_6, const 2_u8); + _6 = copy _5 as u8 (IntToInt); + _7 = Le(copy _6, const 2_u8); assume(move _7); _3 = move _5 as usize (IntToInt); drop(_4) -> [return: bb1, unwind: bb4]; diff --git a/tests/mir-opt/building/enum_cast.far.built.after.mir b/tests/mir-opt/building/enum_cast.far.built.after.mir index e75803c706daf..14eaf34419034 100644 --- a/tests/mir-opt/building/enum_cast.far.built.after.mir +++ b/tests/mir-opt/building/enum_cast.far.built.after.mir @@ -12,8 +12,8 @@ fn far(_1: Far) -> isize { StorageLive(_2); _2 = move _1; _3 = discriminant(_2); - _4 = _3 as u16 (IntToInt); - _5 = Le(_4, const 1_u16); + _4 = copy _3 as u16 (IntToInt); + _5 = Le(copy _4, const 1_u16); assume(move _5); _0 = move _3 as isize (IntToInt); StorageDead(_2); diff --git a/tests/mir-opt/building/enum_cast.offsetty.built.after.mir b/tests/mir-opt/building/enum_cast.offsetty.built.after.mir index 282859d7cd014..1c2acbe3023fe 100644 --- a/tests/mir-opt/building/enum_cast.offsetty.built.after.mir +++ b/tests/mir-opt/building/enum_cast.offsetty.built.after.mir @@ -14,9 +14,9 @@ fn offsetty(_1: NotStartingAtZero) -> u32 { StorageLive(_2); _2 = move _1; _3 = discriminant(_2); - _4 = _3 as u8 (IntToInt); - _5 = Ge(_4, const 4_u8); - _6 = Le(_4, const 8_u8); + _4 = copy _3 as u8 (IntToInt); + _5 = Ge(copy _4, const 4_u8); + _6 = Le(copy _4, const 8_u8); _7 = BitAnd(move _5, move _6); assume(move _7); _0 = move _3 as u32 (IntToInt); diff --git a/tests/mir-opt/building/enum_cast.signy.built.after.mir b/tests/mir-opt/building/enum_cast.signy.built.after.mir index a9f7d6c78007a..39b6dfaf005e3 100644 --- a/tests/mir-opt/building/enum_cast.signy.built.after.mir +++ b/tests/mir-opt/building/enum_cast.signy.built.after.mir @@ -14,9 +14,9 @@ fn signy(_1: SignedAroundZero) -> i16 { StorageLive(_2); _2 = move _1; _3 = discriminant(_2); - _4 = _3 as u16 (IntToInt); - _5 = Ge(_4, const 65534_u16); - _6 = Le(_4, const 2_u16); + _4 = copy _3 as u16 (IntToInt); + _5 = Ge(copy _4, const 65534_u16); + _6 = Le(copy _4, const 2_u16); _7 = BitOr(move _5, move _6); assume(move _7); _0 = move _3 as i16 (IntToInt); diff --git a/tests/mir-opt/building/eq_never_type._f.built.after.mir b/tests/mir-opt/building/eq_never_type._f.built.after.mir index 39438258c2ebb..4711af46f1c8c 100644 --- a/tests/mir-opt/building/eq_never_type._f.built.after.mir +++ b/tests/mir-opt/building/eq_never_type._f.built.after.mir @@ -16,7 +16,7 @@ fn _f(_1: !, _2: !) -> () { StorageLive(_4); StorageLive(_5); StorageLive(_6); - _6 = _1; + _6 = copy _1; unreachable; } @@ -25,7 +25,7 @@ fn _f(_1: !, _2: !) -> () { StorageLive(_7); StorageLive(_8); StorageLive(_9); - _9 = _2; + _9 = copy _2; unreachable; } diff --git a/tests/mir-opt/building/issue_101867.main.built.after.mir b/tests/mir-opt/building/issue_101867.main.built.after.mir index 5c50b3db5cad6..34e5bedf4ce9c 100644 --- a/tests/mir-opt/building/issue_101867.main.built.after.mir +++ b/tests/mir-opt/building/issue_101867.main.built.after.mir @@ -55,7 +55,7 @@ fn main() -> () { } bb6: { - _5 = ((_1 as Some).0: u8); + _5 = copy ((_1 as Some).0: u8); _0 = const (); StorageDead(_5); StorageDead(_1); diff --git a/tests/mir-opt/building/issue_49232.main.built.after.mir b/tests/mir-opt/building/issue_49232.main.built.after.mir index d09a1748a8b36..b78f6691d54c0 100644 --- a/tests/mir-opt/building/issue_49232.main.built.after.mir +++ b/tests/mir-opt/building/issue_49232.main.built.after.mir @@ -25,7 +25,7 @@ fn main() -> () { StorageLive(_3); _3 = const true; PlaceMention(_3); - switchInt(_3) -> [0: bb4, otherwise: bb6]; + switchInt(copy _3) -> [0: bb4, otherwise: bb6]; } bb3: { diff --git a/tests/mir-opt/building/logical_or_in_conditional.test_complex.built.after.mir b/tests/mir-opt/building/logical_or_in_conditional.test_complex.built.after.mir index 3e16efe6980d9..72bd4605b2641 100644 --- a/tests/mir-opt/building/logical_or_in_conditional.test_complex.built.after.mir +++ b/tests/mir-opt/building/logical_or_in_conditional.test_complex.built.after.mir @@ -54,7 +54,7 @@ fn test_complex() -> () { StorageLive(_6); StorageLive(_7); _7 = Droppy(const 0_u8); - _6 = (_7.0: u8); + _6 = copy (_7.0: u8); _5 = Gt(move _6, const 0_u8); switchInt(move _5) -> [0: bb10, otherwise: bb9]; } @@ -92,7 +92,7 @@ fn test_complex() -> () { StorageLive(_9); StorageLive(_10); _10 = Droppy(const 1_u8); - _9 = (_10.0: u8); + _9 = copy (_10.0: u8); _8 = Gt(move _9, const 1_u8); switchInt(move _8) -> [0: bb16, otherwise: bb15]; } diff --git a/tests/mir-opt/building/logical_or_in_conditional.test_or.built.after.mir b/tests/mir-opt/building/logical_or_in_conditional.test_or.built.after.mir index 3e7c116016cc1..2fc19e7e0fdcd 100644 --- a/tests/mir-opt/building/logical_or_in_conditional.test_or.built.after.mir +++ b/tests/mir-opt/building/logical_or_in_conditional.test_or.built.after.mir @@ -14,7 +14,7 @@ fn test_or() -> () { StorageLive(_2); StorageLive(_3); _3 = Droppy(const 0_u8); - _2 = (_3.0: u8); + _2 = copy (_3.0: u8); _1 = Gt(move _2, const 0_u8); switchInt(move _1) -> [0: bb2, otherwise: bb1]; } @@ -44,7 +44,7 @@ fn test_or() -> () { StorageLive(_5); StorageLive(_6); _6 = Droppy(const 1_u8); - _5 = (_6.0: u8); + _5 = copy (_6.0: u8); _4 = Gt(move _5, const 1_u8); switchInt(move _4) -> [0: bb7, otherwise: bb6]; } diff --git a/tests/mir-opt/building/match/deref-patterns/string.foo.PreCodegen.after.mir b/tests/mir-opt/building/match/deref-patterns/string.foo.PreCodegen.after.mir index 1e4f7485089ec..9f52a8cd1e55e 100644 --- a/tests/mir-opt/building/match/deref-patterns/string.foo.PreCodegen.after.mir +++ b/tests/mir-opt/building/match/deref-patterns/string.foo.PreCodegen.after.mir @@ -26,7 +26,7 @@ fn foo(_1: Option) -> i32 { } bb2: { - _6 = ::eq(_5, const "a") -> [return: bb3, unwind unreachable]; + _6 = ::eq(copy _5, const "a") -> [return: bb3, unwind unreachable]; } bb3: { @@ -52,7 +52,7 @@ fn foo(_1: Option) -> i32 { } bb7: { - switchInt(_2) -> [0: bb9, otherwise: bb8]; + switchInt(copy _2) -> [0: bb9, otherwise: bb8]; } bb8: { diff --git a/tests/mir-opt/building/match/exponential_or.match_tuple.SimplifyCfg-initial.after.mir b/tests/mir-opt/building/match/exponential_or.match_tuple.SimplifyCfg-initial.after.mir index 596dcef85fd21..d52241b459ebd 100644 --- a/tests/mir-opt/building/match/exponential_or.match_tuple.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/building/match/exponential_or.match_tuple.SimplifyCfg-initial.after.mir @@ -19,7 +19,7 @@ fn match_tuple(_1: (u32, bool, Option, u32)) -> u32 { bb0: { PlaceMention(_1); - switchInt((_1.0: u32)) -> [1: bb2, 4: bb2, otherwise: bb1]; + switchInt(copy (_1.0: u32)) -> [1: bb2, 4: bb2, otherwise: bb1]; } bb1: { @@ -33,26 +33,26 @@ fn match_tuple(_1: (u32, bool, Option, u32)) -> u32 { } bb3: { - switchInt((((_1.2: std::option::Option) as Some).0: i32)) -> [1: bb4, 8: bb4, otherwise: bb1]; + switchInt(copy (((_1.2: std::option::Option) as Some).0: i32)) -> [1: bb4, 8: bb4, otherwise: bb1]; } bb4: { - _5 = Le(const 6_u32, (_1.3: u32)); + _5 = Le(const 6_u32, copy (_1.3: u32)); switchInt(move _5) -> [0: bb5, otherwise: bb7]; } bb5: { - _3 = Le(const 13_u32, (_1.3: u32)); + _3 = Le(const 13_u32, copy (_1.3: u32)); switchInt(move _3) -> [0: bb1, otherwise: bb6]; } bb6: { - _4 = Le((_1.3: u32), const 16_u32); + _4 = Le(copy (_1.3: u32), const 16_u32); switchInt(move _4) -> [0: bb1, otherwise: bb8]; } bb7: { - _6 = Le((_1.3: u32), const 9_u32); + _6 = Le(copy (_1.3: u32), const 9_u32); switchInt(move _6) -> [0: bb5, otherwise: bb8]; } @@ -62,13 +62,13 @@ fn match_tuple(_1: (u32, bool, Option, u32)) -> u32 { bb9: { StorageLive(_7); - _7 = (_1.0: u32); + _7 = copy (_1.0: u32); StorageLive(_8); - _8 = (_1.3: u32); + _8 = copy (_1.3: u32); StorageLive(_9); - _9 = _7; + _9 = copy _7; StorageLive(_10); - _10 = _8; + _10 = copy _8; _0 = BitXor(move _9, move _10); StorageDead(_10); StorageDead(_9); diff --git a/tests/mir-opt/building/match/match_false_edges.full_tested_match.built.after.mir b/tests/mir-opt/building/match/match_false_edges.full_tested_match.built.after.mir index a93743edfac73..4b0cdcfbb8662 100644 --- a/tests/mir-opt/building/match/match_false_edges.full_tested_match.built.after.mir +++ b/tests/mir-opt/building/match/match_false_edges.full_tested_match.built.after.mir @@ -59,9 +59,9 @@ fn full_tested_match() -> () { bb7: { StorageLive(_9); - _9 = ((_2 as Some).0: i32); + _9 = copy ((_2 as Some).0: i32); StorageLive(_10); - _10 = _9; + _10 = copy _9; _1 = (const 2_i32, move _10); StorageDead(_10); StorageDead(_9); @@ -89,9 +89,9 @@ fn full_tested_match() -> () { FakeRead(ForMatchGuard, _3); FakeRead(ForGuardBinding, _6); StorageLive(_5); - _5 = ((_2 as Some).0: i32); + _5 = copy ((_2 as Some).0: i32); StorageLive(_8); - _8 = _5; + _8 = copy _5; _1 = (const 1_i32, move _8); StorageDead(_8); StorageDead(_5); diff --git a/tests/mir-opt/building/match/match_false_edges.full_tested_match2.built.after.mir b/tests/mir-opt/building/match/match_false_edges.full_tested_match2.built.after.mir index 0d0ea2be1b005..63ec71fdf5133 100644 --- a/tests/mir-opt/building/match/match_false_edges.full_tested_match2.built.after.mir +++ b/tests/mir-opt/building/match/match_false_edges.full_tested_match2.built.after.mir @@ -42,9 +42,9 @@ fn full_tested_match2() -> () { bb3: { StorageLive(_9); - _9 = ((_2 as Some).0: i32); + _9 = copy ((_2 as Some).0: i32); StorageLive(_10); - _10 = _9; + _10 = copy _9; _1 = (const 2_i32, move _10); StorageDead(_10); StorageDead(_9); @@ -89,9 +89,9 @@ fn full_tested_match2() -> () { FakeRead(ForMatchGuard, _3); FakeRead(ForGuardBinding, _6); StorageLive(_5); - _5 = ((_2 as Some).0: i32); + _5 = copy ((_2 as Some).0: i32); StorageLive(_8); - _8 = _5; + _8 = copy _5; _1 = (const 1_i32, move _8); StorageDead(_8); StorageDead(_5); diff --git a/tests/mir-opt/building/match/match_false_edges.main.built.after.mir b/tests/mir-opt/building/match/match_false_edges.main.built.after.mir index 87b7e29848f74..3b10adb499cd5 100644 --- a/tests/mir-opt/building/match/match_false_edges.main.built.after.mir +++ b/tests/mir-opt/building/match/match_false_edges.main.built.after.mir @@ -61,7 +61,7 @@ fn main() -> () { bb5: { StorageLive(_14); - _14 = _2; + _14 = copy _2; _1 = const 4_i32; StorageDead(_14); goto -> bb22; @@ -86,7 +86,7 @@ fn main() -> () { _3 = &fake shallow _2; StorageLive(_12); StorageLive(_13); - _13 = (*_11); + _13 = copy (*_11); _12 = guard2(move _13) -> [return: bb18, unwind: bb24]; } @@ -96,7 +96,7 @@ fn main() -> () { bb11: { StorageLive(_9); - _9 = _2; + _9 = copy _2; _1 = const 2_i32; StorageDead(_9); goto -> bb22; @@ -123,7 +123,7 @@ fn main() -> () { FakeRead(ForMatchGuard, _3); FakeRead(ForGuardBinding, _7); StorageLive(_6); - _6 = ((_2 as Some).0: i32); + _6 = copy ((_2 as Some).0: i32); _1 = const 1_i32; StorageDead(_6); StorageDead(_7); @@ -150,7 +150,7 @@ fn main() -> () { FakeRead(ForMatchGuard, _3); FakeRead(ForGuardBinding, _11); StorageLive(_10); - _10 = ((_2 as Some).0: i32); + _10 = copy ((_2 as Some).0: i32); _1 = const 3_i32; StorageDead(_10); StorageDead(_11); diff --git a/tests/mir-opt/building/match/simple_match.match_bool.built.after.mir b/tests/mir-opt/building/match/simple_match.match_bool.built.after.mir index b0ebdc37b067d..0e82d9591a691 100644 --- a/tests/mir-opt/building/match/simple_match.match_bool.built.after.mir +++ b/tests/mir-opt/building/match/simple_match.match_bool.built.after.mir @@ -6,7 +6,7 @@ fn match_bool(_1: bool) -> usize { bb0: { PlaceMention(_1); - switchInt(_1) -> [0: bb1, otherwise: bb2]; + switchInt(copy _1) -> [0: bb1, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/building/match/sort_candidates.constant_eq.SimplifyCfg-initial.after.mir b/tests/mir-opt/building/match/sort_candidates.constant_eq.SimplifyCfg-initial.after.mir index 2bce79a3ae799..b8f54fef0fafc 100644 --- a/tests/mir-opt/building/match/sort_candidates.constant_eq.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/building/match/sort_candidates.constant_eq.SimplifyCfg-initial.after.mir @@ -16,18 +16,18 @@ fn constant_eq(_1: &str, _2: bool) -> u32 { bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; _3 = (move _4, move _5); StorageDead(_5); StorageDead(_4); PlaceMention(_3); - _9 = ::eq((_3.0: &str), const "a") -> [return: bb9, unwind: bb19]; + _9 = ::eq(copy (_3.0: &str), const "a") -> [return: bb9, unwind: bb19]; } bb1: { - switchInt((_3.1: bool)) -> [0: bb10, otherwise: bb11]; + switchInt(copy (_3.1: bool)) -> [0: bb10, otherwise: bb11]; } bb2: { @@ -35,7 +35,7 @@ fn constant_eq(_1: &str, _2: bool) -> u32 { } bb3: { - switchInt((_3.1: bool)) -> [0: bb1, otherwise: bb4]; + switchInt(copy (_3.1: bool)) -> [0: bb1, otherwise: bb4]; } bb4: { @@ -43,11 +43,11 @@ fn constant_eq(_1: &str, _2: bool) -> u32 { } bb5: { - _8 = ::eq((_3.0: &str), const "b") -> [return: bb8, unwind: bb19]; + _8 = ::eq(copy (_3.0: &str), const "b") -> [return: bb8, unwind: bb19]; } bb6: { - switchInt((_3.1: bool)) -> [0: bb1, otherwise: bb7]; + switchInt(copy (_3.1: bool)) -> [0: bb1, otherwise: bb7]; } bb7: { diff --git a/tests/mir-opt/building/match/sort_candidates.disjoint_ranges.SimplifyCfg-initial.after.mir b/tests/mir-opt/building/match/sort_candidates.disjoint_ranges.SimplifyCfg-initial.after.mir index e521fb4509aa1..d625168081435 100644 --- a/tests/mir-opt/building/match/sort_candidates.disjoint_ranges.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/building/match/sort_candidates.disjoint_ranges.SimplifyCfg-initial.after.mir @@ -13,7 +13,7 @@ fn disjoint_ranges(_1: i32, _2: bool) -> u32 { bb0: { PlaceMention(_1); - _6 = Le(const 0_i32, _1); + _6 = Le(const 0_i32, copy _1); switchInt(move _6) -> [0: bb3, otherwise: bb8]; } @@ -27,7 +27,7 @@ fn disjoint_ranges(_1: i32, _2: bool) -> u32 { } bb3: { - _4 = Le(const 10_i32, _1); + _4 = Le(const 10_i32, copy _1); switchInt(move _4) -> [0: bb5, otherwise: bb7]; } @@ -36,7 +36,7 @@ fn disjoint_ranges(_1: i32, _2: bool) -> u32 { } bb5: { - switchInt(_1) -> [4294967295: bb6, otherwise: bb1]; + switchInt(copy _1) -> [4294967295: bb6, otherwise: bb1]; } bb6: { @@ -44,12 +44,12 @@ fn disjoint_ranges(_1: i32, _2: bool) -> u32 { } bb7: { - _5 = Le(_1, const 20_i32); + _5 = Le(copy _1, const 20_i32); switchInt(move _5) -> [0: bb5, otherwise: bb4]; } bb8: { - _7 = Lt(_1, const 10_i32); + _7 = Lt(copy _1, const 10_i32); switchInt(move _7) -> [0: bb3, otherwise: bb2]; } @@ -66,7 +66,7 @@ fn disjoint_ranges(_1: i32, _2: bool) -> u32 { bb11: { _3 = &fake shallow _1; StorageLive(_8); - _8 = _2; + _8 = copy _2; switchInt(move _8) -> [0: bb13, otherwise: bb12]; } diff --git a/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir b/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir index 1855bb0787d2a..296d71a319d1b 100644 --- a/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir +++ b/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir @@ -38,7 +38,7 @@ fn main() -> () { StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; _3 = move _4 as *const Test (PointerCoercion(MutToConstPointer)); StorageDead(_4); _2 = Test::x(move _3) -> [return: bb2, unwind: bb4]; @@ -63,7 +63,7 @@ fn main() -> () { StorageLive(_10); StorageLive(_11); StorageLive(_12); - _12 = (*(*(*(*_5)))); + _12 = copy (*(*(*(*_5)))); _11 = move _12 as *const Test (PointerCoercion(MutToConstPointer)); StorageDead(_12); _10 = Test::x(move _11) -> [return: bb3, unwind: bb4]; diff --git a/tests/mir-opt/building/shifts.shift_signed.built.after.mir b/tests/mir-opt/building/shifts.shift_signed.built.after.mir index 8706ee9d44636..65e2db300cdea 100644 --- a/tests/mir-opt/building/shifts.shift_signed.built.after.mir +++ b/tests/mir-opt/building/shifts.shift_signed.built.after.mir @@ -44,12 +44,12 @@ fn shift_signed(_1: i8, _2: u128, _3: i8, _4: i32, _5: i128) -> ([i8; 3], [u128; StorageLive(_6); StorageLive(_7); StorageLive(_8); - _8 = _1; + _8 = copy _1; StorageLive(_9); - _9 = _3; - _10 = _9 as u8 (IntToInt); + _9 = copy _3; + _10 = copy _9 as u8 (IntToInt); _11 = Lt(move _10, const 8_u8); - assert(move _11, "attempt to shift right by `{}`, which would overflow", _9) -> [success: bb1, unwind: bb7]; + assert(move _11, "attempt to shift right by `{}`, which would overflow", copy _9) -> [success: bb1, unwind: bb7]; } bb1: { @@ -58,12 +58,12 @@ fn shift_signed(_1: i8, _2: u128, _3: i8, _4: i32, _5: i128) -> ([i8; 3], [u128; StorageDead(_8); StorageLive(_12); StorageLive(_13); - _13 = _1; + _13 = copy _1; StorageLive(_14); - _14 = _4; - _15 = _14 as u32 (IntToInt); + _14 = copy _4; + _15 = copy _14 as u32 (IntToInt); _16 = Lt(move _15, const 8_u32); - assert(move _16, "attempt to shift right by `{}`, which would overflow", _14) -> [success: bb2, unwind: bb7]; + assert(move _16, "attempt to shift right by `{}`, which would overflow", copy _14) -> [success: bb2, unwind: bb7]; } bb2: { @@ -72,12 +72,12 @@ fn shift_signed(_1: i8, _2: u128, _3: i8, _4: i32, _5: i128) -> ([i8; 3], [u128; StorageDead(_13); StorageLive(_17); StorageLive(_18); - _18 = _1; + _18 = copy _1; StorageLive(_19); - _19 = _5; - _20 = _19 as u128 (IntToInt); + _19 = copy _5; + _20 = copy _19 as u128 (IntToInt); _21 = Lt(move _20, const 8_u128); - assert(move _21, "attempt to shift right by `{}`, which would overflow", _19) -> [success: bb3, unwind: bb7]; + assert(move _21, "attempt to shift right by `{}`, which would overflow", copy _19) -> [success: bb3, unwind: bb7]; } bb3: { @@ -91,12 +91,12 @@ fn shift_signed(_1: i8, _2: u128, _3: i8, _4: i32, _5: i128) -> ([i8; 3], [u128; StorageLive(_22); StorageLive(_23); StorageLive(_24); - _24 = _2; + _24 = copy _2; StorageLive(_25); - _25 = _3; - _26 = _25 as u8 (IntToInt); + _25 = copy _3; + _26 = copy _25 as u8 (IntToInt); _27 = Lt(move _26, const 128_u8); - assert(move _27, "attempt to shift left by `{}`, which would overflow", _25) -> [success: bb4, unwind: bb7]; + assert(move _27, "attempt to shift left by `{}`, which would overflow", copy _25) -> [success: bb4, unwind: bb7]; } bb4: { @@ -105,12 +105,12 @@ fn shift_signed(_1: i8, _2: u128, _3: i8, _4: i32, _5: i128) -> ([i8; 3], [u128; StorageDead(_24); StorageLive(_28); StorageLive(_29); - _29 = _2; + _29 = copy _2; StorageLive(_30); - _30 = _4; - _31 = _30 as u32 (IntToInt); + _30 = copy _4; + _31 = copy _30 as u32 (IntToInt); _32 = Lt(move _31, const 128_u32); - assert(move _32, "attempt to shift left by `{}`, which would overflow", _30) -> [success: bb5, unwind: bb7]; + assert(move _32, "attempt to shift left by `{}`, which would overflow", copy _30) -> [success: bb5, unwind: bb7]; } bb5: { @@ -119,12 +119,12 @@ fn shift_signed(_1: i8, _2: u128, _3: i8, _4: i32, _5: i128) -> ([i8; 3], [u128; StorageDead(_29); StorageLive(_33); StorageLive(_34); - _34 = _2; + _34 = copy _2; StorageLive(_35); - _35 = _5; - _36 = _35 as u128 (IntToInt); + _35 = copy _5; + _36 = copy _35 as u128 (IntToInt); _37 = Lt(move _36, const 128_u128); - assert(move _37, "attempt to shift left by `{}`, which would overflow", _35) -> [success: bb6, unwind: bb7]; + assert(move _37, "attempt to shift left by `{}`, which would overflow", copy _35) -> [success: bb6, unwind: bb7]; } bb6: { diff --git a/tests/mir-opt/building/shifts.shift_unsigned.built.after.mir b/tests/mir-opt/building/shifts.shift_unsigned.built.after.mir index dfd3b5b35ad59..62536833e4914 100644 --- a/tests/mir-opt/building/shifts.shift_unsigned.built.after.mir +++ b/tests/mir-opt/building/shifts.shift_unsigned.built.after.mir @@ -38,11 +38,11 @@ fn shift_unsigned(_1: u8, _2: i128, _3: u8, _4: u32, _5: u128) -> ([u8; 3], [i12 StorageLive(_6); StorageLive(_7); StorageLive(_8); - _8 = _1; + _8 = copy _1; StorageLive(_9); - _9 = _3; - _10 = Lt(_9, const 8_u8); - assert(move _10, "attempt to shift right by `{}`, which would overflow", _9) -> [success: bb1, unwind: bb7]; + _9 = copy _3; + _10 = Lt(copy _9, const 8_u8); + assert(move _10, "attempt to shift right by `{}`, which would overflow", copy _9) -> [success: bb1, unwind: bb7]; } bb1: { @@ -51,11 +51,11 @@ fn shift_unsigned(_1: u8, _2: i128, _3: u8, _4: u32, _5: u128) -> ([u8; 3], [i12 StorageDead(_8); StorageLive(_11); StorageLive(_12); - _12 = _1; + _12 = copy _1; StorageLive(_13); - _13 = _4; - _14 = Lt(_13, const 8_u32); - assert(move _14, "attempt to shift right by `{}`, which would overflow", _13) -> [success: bb2, unwind: bb7]; + _13 = copy _4; + _14 = Lt(copy _13, const 8_u32); + assert(move _14, "attempt to shift right by `{}`, which would overflow", copy _13) -> [success: bb2, unwind: bb7]; } bb2: { @@ -64,11 +64,11 @@ fn shift_unsigned(_1: u8, _2: i128, _3: u8, _4: u32, _5: u128) -> ([u8; 3], [i12 StorageDead(_12); StorageLive(_15); StorageLive(_16); - _16 = _1; + _16 = copy _1; StorageLive(_17); - _17 = _5; - _18 = Lt(_17, const 8_u128); - assert(move _18, "attempt to shift right by `{}`, which would overflow", _17) -> [success: bb3, unwind: bb7]; + _17 = copy _5; + _18 = Lt(copy _17, const 8_u128); + assert(move _18, "attempt to shift right by `{}`, which would overflow", copy _17) -> [success: bb3, unwind: bb7]; } bb3: { @@ -82,11 +82,11 @@ fn shift_unsigned(_1: u8, _2: i128, _3: u8, _4: u32, _5: u128) -> ([u8; 3], [i12 StorageLive(_19); StorageLive(_20); StorageLive(_21); - _21 = _2; + _21 = copy _2; StorageLive(_22); - _22 = _3; - _23 = Lt(_22, const 128_u8); - assert(move _23, "attempt to shift left by `{}`, which would overflow", _22) -> [success: bb4, unwind: bb7]; + _22 = copy _3; + _23 = Lt(copy _22, const 128_u8); + assert(move _23, "attempt to shift left by `{}`, which would overflow", copy _22) -> [success: bb4, unwind: bb7]; } bb4: { @@ -95,11 +95,11 @@ fn shift_unsigned(_1: u8, _2: i128, _3: u8, _4: u32, _5: u128) -> ([u8; 3], [i12 StorageDead(_21); StorageLive(_24); StorageLive(_25); - _25 = _2; + _25 = copy _2; StorageLive(_26); - _26 = _4; - _27 = Lt(_26, const 128_u32); - assert(move _27, "attempt to shift left by `{}`, which would overflow", _26) -> [success: bb5, unwind: bb7]; + _26 = copy _4; + _27 = Lt(copy _26, const 128_u32); + assert(move _27, "attempt to shift left by `{}`, which would overflow", copy _26) -> [success: bb5, unwind: bb7]; } bb5: { @@ -108,11 +108,11 @@ fn shift_unsigned(_1: u8, _2: i128, _3: u8, _4: u32, _5: u128) -> ([u8; 3], [i12 StorageDead(_25); StorageLive(_28); StorageLive(_29); - _29 = _2; + _29 = copy _2; StorageLive(_30); - _30 = _5; - _31 = Lt(_30, const 128_u128); - assert(move _31, "attempt to shift left by `{}`, which would overflow", _30) -> [success: bb6, unwind: bb7]; + _30 = copy _5; + _31 = Lt(copy _30, const 128_u128); + assert(move _31, "attempt to shift left by `{}`, which would overflow", copy _30) -> [success: bb6, unwind: bb7]; } bb6: { diff --git a/tests/mir-opt/building/while_storage.while_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/building/while_storage.while_loop.PreCodegen.after.panic-abort.mir index 26c82edf2d5fd..44a8b7342b2e4 100644 --- a/tests/mir-opt/building/while_storage.while_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/building/while_storage.while_loop.PreCodegen.after.panic-abort.mir @@ -20,7 +20,7 @@ fn while_loop(_1: bool) -> () { bb1: { StorageLive(_3); StorageLive(_2); - _2 = _1; + _2 = copy _1; _3 = get_bool(move _2) -> [return: bb2, unwind unreachable]; } @@ -40,7 +40,7 @@ fn while_loop(_1: bool) -> () { StorageDead(_2); StorageLive(_5); StorageLive(_4); - _4 = _1; + _4 = copy _1; _5 = get_bool(move _4) -> [return: bb5, unwind unreachable]; } diff --git a/tests/mir-opt/building/while_storage.while_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/building/while_storage.while_loop.PreCodegen.after.panic-unwind.mir index 1bb72074846e7..9a6403006744d 100644 --- a/tests/mir-opt/building/while_storage.while_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/building/while_storage.while_loop.PreCodegen.after.panic-unwind.mir @@ -20,7 +20,7 @@ fn while_loop(_1: bool) -> () { bb1: { StorageLive(_3); StorageLive(_2); - _2 = _1; + _2 = copy _1; _3 = get_bool(move _2) -> [return: bb2, unwind continue]; } @@ -40,7 +40,7 @@ fn while_loop(_1: bool) -> () { StorageDead(_2); StorageLive(_5); StorageLive(_4); - _4 = _1; + _4 = copy _1; _5 = get_bool(move _4) -> [return: bb5, unwind continue]; } diff --git a/tests/mir-opt/const_allocation.main.GVN.after.32bit.mir b/tests/mir-opt/const_allocation.main.GVN.after.32bit.mir index 10d99a1346332..a2bd2bc0d92ab 100644 --- a/tests/mir-opt/const_allocation.main.GVN.after.32bit.mir +++ b/tests/mir-opt/const_allocation.main.GVN.after.32bit.mir @@ -9,7 +9,7 @@ fn main() -> () { StorageLive(_1); StorageLive(_2); _2 = const {ALLOC9: &&[(Option, &[&str])]}; - _1 = (*_2); + _1 = copy (*_2); StorageDead(_2); StorageDead(_1); _0 = const (); diff --git a/tests/mir-opt/const_allocation.main.GVN.after.64bit.mir b/tests/mir-opt/const_allocation.main.GVN.after.64bit.mir index 2f23dbe9ee4fb..a431104d08bec 100644 --- a/tests/mir-opt/const_allocation.main.GVN.after.64bit.mir +++ b/tests/mir-opt/const_allocation.main.GVN.after.64bit.mir @@ -9,7 +9,7 @@ fn main() -> () { StorageLive(_1); StorageLive(_2); _2 = const {ALLOC9: &&[(Option, &[&str])]}; - _1 = (*_2); + _1 = copy (*_2); StorageDead(_2); StorageDead(_1); _0 = const (); diff --git a/tests/mir-opt/const_allocation2.main.GVN.after.32bit.mir b/tests/mir-opt/const_allocation2.main.GVN.after.32bit.mir index 6499e3676aaa4..6fae163f1079f 100644 --- a/tests/mir-opt/const_allocation2.main.GVN.after.32bit.mir +++ b/tests/mir-opt/const_allocation2.main.GVN.after.32bit.mir @@ -9,7 +9,7 @@ fn main() -> () { StorageLive(_1); StorageLive(_2); _2 = const {ALLOC9: &&[(Option, &[&u8])]}; - _1 = (*_2); + _1 = copy (*_2); StorageDead(_2); StorageDead(_1); _0 = const (); diff --git a/tests/mir-opt/const_allocation2.main.GVN.after.64bit.mir b/tests/mir-opt/const_allocation2.main.GVN.after.64bit.mir index 02f5ebab84772..f2bb5f46b16e5 100644 --- a/tests/mir-opt/const_allocation2.main.GVN.after.64bit.mir +++ b/tests/mir-opt/const_allocation2.main.GVN.after.64bit.mir @@ -9,7 +9,7 @@ fn main() -> () { StorageLive(_1); StorageLive(_2); _2 = const {ALLOC9: &&[(Option, &[&u8])]}; - _1 = (*_2); + _1 = copy (*_2); StorageDead(_2); StorageDead(_1); _0 = const (); diff --git a/tests/mir-opt/const_allocation3.main.GVN.after.32bit.mir b/tests/mir-opt/const_allocation3.main.GVN.after.32bit.mir index c95e696946a6d..58776b446fa79 100644 --- a/tests/mir-opt/const_allocation3.main.GVN.after.32bit.mir +++ b/tests/mir-opt/const_allocation3.main.GVN.after.32bit.mir @@ -9,7 +9,7 @@ fn main() -> () { StorageLive(_1); StorageLive(_2); _2 = const {ALLOC4: &&Packed}; - _1 = (*_2); + _1 = copy (*_2); StorageDead(_2); StorageDead(_1); _0 = const (); diff --git a/tests/mir-opt/const_allocation3.main.GVN.after.64bit.mir b/tests/mir-opt/const_allocation3.main.GVN.after.64bit.mir index 198bc8bd07ef1..3ccf4211971c5 100644 --- a/tests/mir-opt/const_allocation3.main.GVN.after.64bit.mir +++ b/tests/mir-opt/const_allocation3.main.GVN.after.64bit.mir @@ -9,7 +9,7 @@ fn main() -> () { StorageLive(_1); StorageLive(_2); _2 = const {ALLOC2: &&Packed}; - _1 = (*_2); + _1 = copy (*_2); StorageDead(_2); StorageDead(_1); _0 = const (); diff --git a/tests/mir-opt/const_goto_const_eval_fail.f.JumpThreading.diff b/tests/mir-opt/const_goto_const_eval_fail.f.JumpThreading.diff index 4fc9254b7baed..086abeba0f848 100644 --- a/tests/mir-opt/const_goto_const_eval_fail.f.JumpThreading.diff +++ b/tests/mir-opt/const_goto_const_eval_fail.f.JumpThreading.diff @@ -22,7 +22,7 @@ } bb3: { - switchInt(_1) -> [0: bb5, otherwise: bb4]; + switchInt(copy _1) -> [0: bb5, otherwise: bb4]; } bb4: { diff --git a/tests/mir-opt/const_prop/address_of_pair.fn0.GVN.diff b/tests/mir-opt/const_prop/address_of_pair.fn0.GVN.diff index ac372f837268b..e33185f17bcf7 100644 --- a/tests/mir-opt/const_prop/address_of_pair.fn0.GVN.diff +++ b/tests/mir-opt/const_prop/address_of_pair.fn0.GVN.diff @@ -34,10 +34,10 @@ - StorageLive(_5); + nop; StorageLive(_6); - _6 = (_2.1: bool); + _6 = copy (_2.1: bool); _5 = Not(move _6); StorageDead(_6); - _0 = _5; + _0 = copy _5; - StorageDead(_5); + nop; StorageDead(_3); diff --git a/tests/mir-opt/const_prop/aggregate.foo.GVN.panic-abort.diff b/tests/mir-opt/const_prop/aggregate.foo.GVN.panic-abort.diff index 4f0f7fa8fa274..c6d3bad0790c4 100644 --- a/tests/mir-opt/const_prop/aggregate.foo.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/aggregate.foo.GVN.panic-abort.diff @@ -24,11 +24,11 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = (const 0_i32, move _5); -+ _4 = (const 0_i32, _1); ++ _4 = (const 0_i32, copy _1); StorageDead(_5); -- _3 = (_4.0: i32); +- _3 = copy (_4.0: i32); - _2 = Add(move _3, const 1_i32); + _3 = const 0_i32; + _2 = const 1_i32; @@ -38,11 +38,11 @@ StorageLive(_7); StorageLive(_8); StorageLive(_9); - _9 = _1; + _9 = copy _1; - _8 = (move _9, const 1_i32); -+ _8 = (_1, const 1_i32); ++ _8 = (copy _1, const 1_i32); StorageDead(_9); -- _7 = (_8.1: i32); +- _7 = copy (_8.1: i32); - _6 = Add(move _7, const 2_i32); + _7 = const 1_i32; + _6 = const 3_i32; diff --git a/tests/mir-opt/const_prop/aggregate.foo.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/aggregate.foo.GVN.panic-unwind.diff index 4f0f7fa8fa274..c6d3bad0790c4 100644 --- a/tests/mir-opt/const_prop/aggregate.foo.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/aggregate.foo.GVN.panic-unwind.diff @@ -24,11 +24,11 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = (const 0_i32, move _5); -+ _4 = (const 0_i32, _1); ++ _4 = (const 0_i32, copy _1); StorageDead(_5); -- _3 = (_4.0: i32); +- _3 = copy (_4.0: i32); - _2 = Add(move _3, const 1_i32); + _3 = const 0_i32; + _2 = const 1_i32; @@ -38,11 +38,11 @@ StorageLive(_7); StorageLive(_8); StorageLive(_9); - _9 = _1; + _9 = copy _1; - _8 = (move _9, const 1_i32); -+ _8 = (_1, const 1_i32); ++ _8 = (copy _1, const 1_i32); StorageDead(_9); -- _7 = (_8.1: i32); +- _7 = copy (_8.1: i32); - _6 = Add(move _7, const 2_i32); + _7 = const 1_i32; + _6 = const 3_i32; diff --git a/tests/mir-opt/const_prop/aggregate.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/aggregate.main.GVN.panic-abort.diff index 854e27445afb9..0a59c59c2ed2c 100644 --- a/tests/mir-opt/const_prop/aggregate.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/aggregate.main.GVN.panic-abort.diff @@ -18,7 +18,7 @@ StorageLive(_2); StorageLive(_3); _3 = (const 0_i32, const 1_u8, const 2_i32); -- _2 = (_3.1: u8); +- _2 = copy (_3.1: u8); - _1 = Add(move _2, const 0_u8); + _2 = const 1_u8; + _1 = const 1_u8; @@ -26,7 +26,7 @@ StorageDead(_3); StorageLive(_4); StorageLive(_5); -- _5 = _1; +- _5 = copy _1; - _4 = foo(move _5) -> [return: bb1, unwind unreachable]; + _5 = const 1_u8; + _4 = foo(const 1_u8) -> [return: bb1, unwind unreachable]; diff --git a/tests/mir-opt/const_prop/aggregate.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/aggregate.main.GVN.panic-unwind.diff index f6c4b2c924097..100369a2eee31 100644 --- a/tests/mir-opt/const_prop/aggregate.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/aggregate.main.GVN.panic-unwind.diff @@ -18,7 +18,7 @@ StorageLive(_2); StorageLive(_3); _3 = (const 0_i32, const 1_u8, const 2_i32); -- _2 = (_3.1: u8); +- _2 = copy (_3.1: u8); - _1 = Add(move _2, const 0_u8); + _2 = const 1_u8; + _1 = const 1_u8; @@ -26,7 +26,7 @@ StorageDead(_3); StorageLive(_4); StorageLive(_5); -- _5 = _1; +- _5 = copy _1; - _4 = foo(move _5) -> [return: bb1, unwind continue]; + _5 = const 1_u8; + _4 = foo(const 1_u8) -> [return: bb1, unwind continue]; diff --git a/tests/mir-opt/const_prop/array_index.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/const_prop/array_index.main.GVN.32bit.panic-abort.diff index 6d00dd5b21260..e754af95ce399 100644 --- a/tests/mir-opt/const_prop/array_index.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/array_index.main.GVN.32bit.panic-abort.diff @@ -19,15 +19,15 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const 4_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = _2[_3]; +- _1 = copy _2[_3]; + _1 = const 2_u32; StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/array_index.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/const_prop/array_index.main.GVN.32bit.panic-unwind.diff index 7e2f72ab31bce..e15a35c7fe945 100644 --- a/tests/mir-opt/const_prop/array_index.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/array_index.main.GVN.32bit.panic-unwind.diff @@ -19,15 +19,15 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind continue]; + _4 = const 4_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = _2[_3]; +- _1 = copy _2[_3]; + _1 = const 2_u32; StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/array_index.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/const_prop/array_index.main.GVN.64bit.panic-abort.diff index 6d00dd5b21260..e754af95ce399 100644 --- a/tests/mir-opt/const_prop/array_index.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/array_index.main.GVN.64bit.panic-abort.diff @@ -19,15 +19,15 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const 4_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = _2[_3]; +- _1 = copy _2[_3]; + _1 = const 2_u32; StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/array_index.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/const_prop/array_index.main.GVN.64bit.panic-unwind.diff index 7e2f72ab31bce..e15a35c7fe945 100644 --- a/tests/mir-opt/const_prop/array_index.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/array_index.main.GVN.64bit.panic-unwind.diff @@ -19,15 +19,15 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind continue]; + _4 = const 4_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = _2[_3]; +- _1 = copy _2[_3]; + _1 = const 2_u32; StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/bad_op_div_by_zero.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/bad_op_div_by_zero.main.GVN.panic-abort.diff index 4838efba6f9d1..8c535b567c328 100644 --- a/tests/mir-opt/const_prop/bad_op_div_by_zero.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/bad_op_div_by_zero.main.GVN.panic-abort.diff @@ -23,8 +23,8 @@ _1 = const 0_i32; StorageLive(_2); StorageLive(_3); -- _3 = _1; -- _4 = Eq(_3, const 0_i32); +- _3 = copy _1; +- _4 = Eq(copy _3, const 0_i32); - assert(!move _4, "attempt to divide `{}` by zero", const 1_i32) -> [success: bb1, unwind unreachable]; + _3 = const 0_i32; + _4 = const true; @@ -32,10 +32,10 @@ } bb1: { -- _5 = Eq(_3, const -1_i32); +- _5 = Eq(copy _3, const -1_i32); - _6 = Eq(const 1_i32, const i32::MIN); - _7 = BitAnd(move _5, move _6); -- assert(!move _7, "attempt to compute `{} / {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind unreachable]; +- assert(!move _7, "attempt to compute `{} / {}`, which would overflow", const 1_i32, copy _3) -> [success: bb2, unwind unreachable]; + _5 = const false; + _6 = const false; + _7 = const false; diff --git a/tests/mir-opt/const_prop/bad_op_div_by_zero.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/bad_op_div_by_zero.main.GVN.panic-unwind.diff index 7f403d6efc103..045f4d81db62e 100644 --- a/tests/mir-opt/const_prop/bad_op_div_by_zero.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/bad_op_div_by_zero.main.GVN.panic-unwind.diff @@ -23,8 +23,8 @@ _1 = const 0_i32; StorageLive(_2); StorageLive(_3); -- _3 = _1; -- _4 = Eq(_3, const 0_i32); +- _3 = copy _1; +- _4 = Eq(copy _3, const 0_i32); - assert(!move _4, "attempt to divide `{}` by zero", const 1_i32) -> [success: bb1, unwind continue]; + _3 = const 0_i32; + _4 = const true; @@ -32,10 +32,10 @@ } bb1: { -- _5 = Eq(_3, const -1_i32); +- _5 = Eq(copy _3, const -1_i32); - _6 = Eq(const 1_i32, const i32::MIN); - _7 = BitAnd(move _5, move _6); -- assert(!move _7, "attempt to compute `{} / {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind continue]; +- assert(!move _7, "attempt to compute `{} / {}`, which would overflow", const 1_i32, copy _3) -> [success: bb2, unwind continue]; + _5 = const false; + _6 = const false; + _7 = const false; diff --git a/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.GVN.panic-abort.diff index 59f2eb86f5095..e5a8726b855c4 100644 --- a/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.GVN.panic-abort.diff @@ -23,8 +23,8 @@ _1 = const 0_i32; StorageLive(_2); StorageLive(_3); -- _3 = _1; -- _4 = Eq(_3, const 0_i32); +- _3 = copy _1; +- _4 = Eq(copy _3, const 0_i32); - assert(!move _4, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> [success: bb1, unwind unreachable]; + _3 = const 0_i32; + _4 = const true; @@ -32,10 +32,10 @@ } bb1: { -- _5 = Eq(_3, const -1_i32); +- _5 = Eq(copy _3, const -1_i32); - _6 = Eq(const 1_i32, const i32::MIN); - _7 = BitAnd(move _5, move _6); -- assert(!move _7, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind unreachable]; +- assert(!move _7, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, copy _3) -> [success: bb2, unwind unreachable]; + _5 = const false; + _6 = const false; + _7 = const false; diff --git a/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.GVN.panic-unwind.diff index 9b866082788cd..1110ff186dc6e 100644 --- a/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.GVN.panic-unwind.diff @@ -23,8 +23,8 @@ _1 = const 0_i32; StorageLive(_2); StorageLive(_3); -- _3 = _1; -- _4 = Eq(_3, const 0_i32); +- _3 = copy _1; +- _4 = Eq(copy _3, const 0_i32); - assert(!move _4, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> [success: bb1, unwind continue]; + _3 = const 0_i32; + _4 = const true; @@ -32,10 +32,10 @@ } bb1: { -- _5 = Eq(_3, const -1_i32); +- _5 = Eq(copy _3, const -1_i32); - _6 = Eq(const 1_i32, const i32::MIN); - _7 = BitAnd(move _5, move _6); -- assert(!move _7, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind continue]; +- assert(!move _7, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, copy _3) -> [success: bb2, unwind continue]; + _5 = const false; + _6 = const false; + _7 = const false; diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-abort.diff index 826f4c3427778..52aa4da49efaf 100644 --- a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-abort.diff @@ -33,15 +33,15 @@ StorageLive(_6); _6 = const 3_usize; _7 = Len((*_1)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; -+ _8 = Lt(const 3_usize, _7); +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind unreachable]; ++ _8 = Lt(const 3_usize, copy _7); + assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 3_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _5 = (*_1)[_6]; -+ _5 = (*_1)[3 of 4]; +- _5 = copy (*_1)[_6]; ++ _5 = copy (*_1)[3 of 4]; StorageDead(_6); _0 = const (); StorageDead(_5); diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-unwind.diff index 0e2ec65652f5c..242ff0e664f1d 100644 --- a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-unwind.diff @@ -33,15 +33,15 @@ StorageLive(_6); _6 = const 3_usize; _7 = Len((*_1)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue]; -+ _8 = Lt(const 3_usize, _7); +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind continue]; ++ _8 = Lt(const 3_usize, copy _7); + assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 3_usize) -> [success: bb1, unwind continue]; } bb1: { -- _5 = (*_1)[_6]; -+ _5 = (*_1)[3 of 4]; +- _5 = copy (*_1)[_6]; ++ _5 = copy (*_1)[3 of 4]; StorageDead(_6); _0 = const (); StorageDead(_5); diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-abort.diff index 826f4c3427778..52aa4da49efaf 100644 --- a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-abort.diff @@ -33,15 +33,15 @@ StorageLive(_6); _6 = const 3_usize; _7 = Len((*_1)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; -+ _8 = Lt(const 3_usize, _7); +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind unreachable]; ++ _8 = Lt(const 3_usize, copy _7); + assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 3_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _5 = (*_1)[_6]; -+ _5 = (*_1)[3 of 4]; +- _5 = copy (*_1)[_6]; ++ _5 = copy (*_1)[3 of 4]; StorageDead(_6); _0 = const (); StorageDead(_5); diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-unwind.diff index 0e2ec65652f5c..242ff0e664f1d 100644 --- a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-unwind.diff @@ -33,15 +33,15 @@ StorageLive(_6); _6 = const 3_usize; _7 = Len((*_1)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue]; -+ _8 = Lt(const 3_usize, _7); +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind continue]; ++ _8 = Lt(const 3_usize, copy _7); + assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 3_usize) -> [success: bb1, unwind continue]; } bb1: { -- _5 = (*_1)[_6]; -+ _5 = (*_1)[3 of 4]; +- _5 = copy (*_1)[_6]; ++ _5 = copy (*_1)[3 of 4]; StorageDead(_6); _0 = const (); StorageDead(_5); diff --git a/tests/mir-opt/const_prop/boolean_identities.test.GVN.diff b/tests/mir-opt/const_prop/boolean_identities.test.GVN.diff index 0bd8413289e63..3fe70302b21cf 100644 --- a/tests/mir-opt/const_prop/boolean_identities.test.GVN.diff +++ b/tests/mir-opt/const_prop/boolean_identities.test.GVN.diff @@ -22,22 +22,22 @@ - StorageLive(_3); + nop; StorageLive(_4); - _4 = _2; + _4 = copy _2; - _3 = BitOr(move _4, const true); + _3 = const true; StorageDead(_4); - StorageLive(_5); + nop; StorageLive(_6); - _6 = _1; + _6 = copy _1; - _5 = BitAnd(move _6, const false); + _5 = const false; StorageDead(_6); StorageLive(_7); -- _7 = _3; +- _7 = copy _3; + _7 = const true; StorageLive(_8); -- _8 = _5; +- _8 = copy _5; - _0 = BitAnd(move _7, move _8); + _8 = const false; + _0 = const false; diff --git a/tests/mir-opt/const_prop/boxes.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/boxes.main.GVN.panic-abort.diff index a408c197fd143..d5f15b750d4ba 100644 --- a/tests/mir-opt/const_prop/boxes.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/boxes.main.GVN.panic-abort.diff @@ -32,15 +32,15 @@ bb1: { StorageLive(_7); _7 = ShallowInitBox(move _6, i32); - _8 = (((_7.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const i32); + _8 = copy (((_7.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const i32); (*_8) = const 42_i32; _3 = move _7; StorageDead(_7); - _9 = (((_3.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const i32); - _2 = (*_9); + _9 = copy (((_3.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const i32); + _2 = copy (*_9); - _1 = Add(move _2, const 0_i32); - StorageDead(_2); -+ _1 = _2; ++ _1 = copy _2; + nop; drop(_3) -> [return: bb2, unwind unreachable]; } diff --git a/tests/mir-opt/const_prop/boxes.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/boxes.main.GVN.panic-unwind.diff index 5706a739602ea..d4d4f21be6e02 100644 --- a/tests/mir-opt/const_prop/boxes.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/boxes.main.GVN.panic-unwind.diff @@ -32,15 +32,15 @@ bb1: { StorageLive(_7); _7 = ShallowInitBox(move _6, i32); - _8 = (((_7.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const i32); + _8 = copy (((_7.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const i32); (*_8) = const 42_i32; _3 = move _7; StorageDead(_7); - _9 = (((_3.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const i32); - _2 = (*_9); + _9 = copy (((_3.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const i32); + _2 = copy (*_9); - _1 = Add(move _2, const 0_i32); - StorageDead(_2); -+ _1 = _2; ++ _1 = copy _2; + nop; drop(_3) -> [return: bb2, unwind: bb3]; } diff --git a/tests/mir-opt/const_prop/discriminant.main.GVN.32bit.diff b/tests/mir-opt/const_prop/discriminant.main.GVN.32bit.diff index 70c3c3fe7e495..2543cf6257d43 100644 --- a/tests/mir-opt/const_prop/discriminant.main.GVN.32bit.diff +++ b/tests/mir-opt/const_prop/discriminant.main.GVN.32bit.diff @@ -26,7 +26,7 @@ } bb1: { -- switchInt(((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2]; +- switchInt(copy ((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2]; + switchInt(const true) -> [0: bb3, otherwise: bb2]; } diff --git a/tests/mir-opt/const_prop/discriminant.main.GVN.64bit.diff b/tests/mir-opt/const_prop/discriminant.main.GVN.64bit.diff index 70c3c3fe7e495..2543cf6257d43 100644 --- a/tests/mir-opt/const_prop/discriminant.main.GVN.64bit.diff +++ b/tests/mir-opt/const_prop/discriminant.main.GVN.64bit.diff @@ -26,7 +26,7 @@ } bb1: { -- switchInt(((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2]; +- switchInt(copy ((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2]; + switchInt(const true) -> [0: bb3, otherwise: bb2]; } diff --git a/tests/mir-opt/const_prop/indirect.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/indirect.main.GVN.panic-abort.diff index f24b9755eaea6..208845942c76d 100644 --- a/tests/mir-opt/const_prop/indirect.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/indirect.main.GVN.panic-abort.diff @@ -14,7 +14,7 @@ StorageLive(_1); StorageLive(_2); - _2 = const 2_u32 as u8 (IntToInt); -- _3 = AddWithOverflow(_2, const 1_u8); +- _3 = AddWithOverflow(copy _2, const 1_u8); - assert(!move (_3.1: bool), "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> [success: bb1, unwind unreachable]; + _2 = const 2_u8; + _3 = const (3_u8, false); diff --git a/tests/mir-opt/const_prop/indirect.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/indirect.main.GVN.panic-unwind.diff index 44ff313b5328b..4a7c69bae3ca8 100644 --- a/tests/mir-opt/const_prop/indirect.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/indirect.main.GVN.panic-unwind.diff @@ -14,7 +14,7 @@ StorageLive(_1); StorageLive(_2); - _2 = const 2_u32 as u8 (IntToInt); -- _3 = AddWithOverflow(_2, const 1_u8); +- _3 = AddWithOverflow(copy _2, const 1_u8); - assert(!move (_3.1: bool), "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> [success: bb1, unwind continue]; + _2 = const 2_u8; + _3 = const (3_u8, false); diff --git a/tests/mir-opt/const_prop/indirect_mutation.bar.GVN.diff b/tests/mir-opt/const_prop/indirect_mutation.bar.GVN.diff index 99a6ba7d08abd..849a57e203061 100644 --- a/tests/mir-opt/const_prop/indirect_mutation.bar.GVN.diff +++ b/tests/mir-opt/const_prop/indirect_mutation.bar.GVN.diff @@ -28,7 +28,7 @@ StorageDead(_2); StorageLive(_4); StorageLive(_5); - _5 = (_1.0: i32); + _5 = copy (_1.0: i32); _4 = Eq(move _5, const 5_i32); StorageDead(_5); _0 = const (); diff --git a/tests/mir-opt/const_prop/indirect_mutation.foo.GVN.diff b/tests/mir-opt/const_prop/indirect_mutation.foo.GVN.diff index c21869dece65c..2435f81206bda 100644 --- a/tests/mir-opt/const_prop/indirect_mutation.foo.GVN.diff +++ b/tests/mir-opt/const_prop/indirect_mutation.foo.GVN.diff @@ -24,7 +24,7 @@ StorageDead(_2); StorageLive(_3); StorageLive(_4); - _4 = (_1.0: i32); + _4 = copy (_1.0: i32); _3 = Eq(move _4, const 5_i32); StorageDead(_4); _0 = const (); diff --git a/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-abort.diff index de9cb7a47a2be..ab39c5be4e37d 100644 --- a/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-abort.diff @@ -19,8 +19,8 @@ StorageLive(_3); _3 = const 1_u8; StorageLive(_4); -- _4 = AddWithOverflow(_2, _3); -- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind unreachable]; +- _4 = AddWithOverflow(copy _2, copy _3); +- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", copy _2, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const (0_u8, true); + assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> [success: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-unwind.diff index 1f19a13c1e8cf..1aea0dbb5d531 100644 --- a/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-unwind.diff @@ -19,8 +19,8 @@ StorageLive(_3); _3 = const 1_u8; StorageLive(_4); -- _4 = AddWithOverflow(_2, _3); -- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind continue]; +- _4 = AddWithOverflow(copy _2, copy _3); +- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", copy _2, copy _3) -> [success: bb1, unwind continue]; + _4 = const (0_u8, true); + assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> [success: bb1, unwind continue]; } diff --git a/tests/mir-opt/const_prop/invalid_constant.main.GVN.diff b/tests/mir-opt/const_prop/invalid_constant.main.GVN.diff index f50413656049f..5e843da867923 100644 --- a/tests/mir-opt/const_prop/invalid_constant.main.GVN.diff +++ b/tests/mir-opt/const_prop/invalid_constant.main.GVN.diff @@ -29,13 +29,13 @@ StorageLive(_1); StorageLive(_2); _2 = InvalidChar { int: const 1114113_u32 }; - _1 = (_2.1: char); + _1 = copy (_2.1: char); StorageDead(_2); StorageLive(_3); StorageLive(_4); StorageLive(_5); _5 = InvalidTag { int: const 4_u32 }; - _4 = (_5.1: E); + _4 = copy (_5.1: E); _3 = [move _4]; StorageDead(_4); StorageDead(_5); diff --git a/tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.diff b/tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.diff index 6e5ad8d6b81ac..6593b329756c2 100644 --- a/tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.diff +++ b/tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.diff @@ -31,13 +31,13 @@ StorageLive(_1); StorageLive(_2); _2 = InvalidChar { int: const 1114113_u32 }; - _1 = (_2.1: char); + _1 = copy (_2.1: char); StorageDead(_2); StorageLive(_3); StorageLive(_4); StorageLive(_5); _5 = InvalidTag { int: const 4_u32 }; - _4 = (_5.1: E); + _4 = copy (_5.1: E); _3 = [move _4]; StorageDead(_4); StorageDead(_5); @@ -47,7 +47,7 @@ + nop; StorageLive(_8); _8 = NoVariants { int: const 0_u32 }; -- _7 = (_8.1: Empty); +- _7 = copy (_8.1: Empty); - _6 = [move _7]; - StorageDead(_7); + nop; diff --git a/tests/mir-opt/const_prop/large_array_index.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/const_prop/large_array_index.main.GVN.32bit.panic-abort.diff index bd987c01ab16f..49ea51deed69d 100644 --- a/tests/mir-opt/const_prop/large_array_index.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/large_array_index.main.GVN.32bit.panic-abort.diff @@ -19,15 +19,15 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const 5000_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 5000_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = _2[_3]; +- _1 = copy _2[_3]; + _1 = const 0_u8; StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/large_array_index.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/const_prop/large_array_index.main.GVN.32bit.panic-unwind.diff index e9ebef84ae048..103bfbcaf6426 100644 --- a/tests/mir-opt/const_prop/large_array_index.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/large_array_index.main.GVN.32bit.panic-unwind.diff @@ -19,15 +19,15 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind continue]; + _4 = const 5000_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 5000_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = _2[_3]; +- _1 = copy _2[_3]; + _1 = const 0_u8; StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/large_array_index.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/const_prop/large_array_index.main.GVN.64bit.panic-abort.diff index bd987c01ab16f..49ea51deed69d 100644 --- a/tests/mir-opt/const_prop/large_array_index.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/large_array_index.main.GVN.64bit.panic-abort.diff @@ -19,15 +19,15 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const 5000_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 5000_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = _2[_3]; +- _1 = copy _2[_3]; + _1 = const 0_u8; StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/large_array_index.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/const_prop/large_array_index.main.GVN.64bit.panic-unwind.diff index e9ebef84ae048..103bfbcaf6426 100644 --- a/tests/mir-opt/const_prop/large_array_index.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/large_array_index.main.GVN.64bit.panic-unwind.diff @@ -19,15 +19,15 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind continue]; + _4 = const 5000_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 5000_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = _2[_3]; +- _1 = copy _2[_3]; + _1 = const 0_u8; StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/mult_by_zero.test.GVN.diff b/tests/mir-opt/const_prop/mult_by_zero.test.GVN.diff index 6c2aab45d48b5..290d9d62ce027 100644 --- a/tests/mir-opt/const_prop/mult_by_zero.test.GVN.diff +++ b/tests/mir-opt/const_prop/mult_by_zero.test.GVN.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = Mul(move _2, const 0_i32); + _0 = const 0_i32; StorageDead(_2); diff --git a/tests/mir-opt/const_prop/mutable_variable.main.GVN.diff b/tests/mir-opt/const_prop/mutable_variable.main.GVN.diff index 11464e3240028..cc25b6caf90d9 100644 --- a/tests/mir-opt/const_prop/mutable_variable.main.GVN.diff +++ b/tests/mir-opt/const_prop/mutable_variable.main.GVN.diff @@ -17,7 +17,7 @@ _1 = const 42_i32; _1 = const 99_i32; StorageLive(_2); - _2 = _1; + _2 = copy _1; _0 = const (); StorageDead(_2); StorageDead(_1); diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate.main.GVN.diff b/tests/mir-opt/const_prop/mutable_variable_aggregate.main.GVN.diff index 7584353620ec5..3cc71eee710bb 100644 --- a/tests/mir-opt/const_prop/mutable_variable_aggregate.main.GVN.diff +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate.main.GVN.diff @@ -18,7 +18,7 @@ + _1 = const (42_i32, 43_i32); (_1.1: i32) = const 99_i32; StorageLive(_2); - _2 = _1; + _2 = copy _1; _0 = const (); StorageDead(_2); StorageDead(_1); diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.GVN.diff b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.GVN.diff index e16e2969eb895..569ad62b5cc5e 100644 --- a/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.GVN.diff +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.GVN.diff @@ -24,7 +24,7 @@ _2 = &mut _1; ((*_2).1: i32) = const 99_i32; StorageLive(_3); - _3 = _1; + _3 = copy _1; _0 = const (); StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.GVN.panic-abort.diff index 6480e480f8c58..5b4d18a3c070f 100644 --- a/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.GVN.panic-abort.diff @@ -21,7 +21,7 @@ (_1.1: i32) = const 99_i32; (_1.0: i32) = const 42_i32; StorageLive(_2); - _2 = (_1.1: i32); + _2 = copy (_1.1: i32); _0 = const (); StorageDead(_2); StorageDead(_1); diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.GVN.panic-unwind.diff index fb757801082ee..d58febe368d10 100644 --- a/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.GVN.panic-unwind.diff @@ -21,7 +21,7 @@ (_1.1: i32) = const 99_i32; (_1.0: i32) = const 42_i32; StorageLive(_2); - _2 = (_1.1: i32); + _2 = copy (_1.1: i32); _0 = const (); StorageDead(_2); StorageDead(_1); diff --git a/tests/mir-opt/const_prop/mutable_variable_no_prop.main.GVN.diff b/tests/mir-opt/const_prop/mutable_variable_no_prop.main.GVN.diff index 31c839f674900..3f8dc12f4ae57 100644 --- a/tests/mir-opt/const_prop/mutable_variable_no_prop.main.GVN.diff +++ b/tests/mir-opt/const_prop/mutable_variable_no_prop.main.GVN.diff @@ -22,14 +22,14 @@ StorageLive(_3); StorageLive(_4); _4 = const {ALLOC0: *mut u32}; - _3 = (*_4); + _3 = copy (*_4); _1 = move _3; StorageDead(_3); StorageDead(_4); _2 = const (); StorageDead(_2); StorageLive(_5); - _5 = _1; + _5 = copy _1; _0 = const (); StorageDead(_5); StorageDead(_1); diff --git a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-abort.diff index 19d79694666f2..7ca1b39d77110 100644 --- a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-abort.diff @@ -32,14 +32,14 @@ - _2 = (const 1_i32, const 2_i32); + _2 = const (1_i32, 2_i32); StorageLive(_3); - _3 = _1; + _3 = copy _1; - (_2.1: i32) = move _3; -+ (_2.1: i32) = _1; ++ (_2.1: i32) = copy _1; StorageDead(_3); StorageLive(_4); - _4 = (_2.1: i32); + _4 = copy (_2.1: i32); StorageLive(_5); - _5 = (_2.0: i32); + _5 = copy (_2.0: i32); _0 = const (); StorageDead(_5); StorageDead(_4); diff --git a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-unwind.diff index 2bb277bf27f7f..f637951380664 100644 --- a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-unwind.diff @@ -32,14 +32,14 @@ - _2 = (const 1_i32, const 2_i32); + _2 = const (1_i32, 2_i32); StorageLive(_3); - _3 = _1; + _3 = copy _1; - (_2.1: i32) = move _3; -+ (_2.1: i32) = _1; ++ (_2.1: i32) = copy _1; StorageDead(_3); StorageLive(_4); - _4 = (_2.1: i32); + _4 = copy (_2.1: i32); StorageLive(_5); - _5 = (_2.0: i32); + _5 = copy (_2.0: i32); _0 = const (); StorageDead(_5); StorageDead(_4); diff --git a/tests/mir-opt/const_prop/overwrite_with_const_with_params.size_of.GVN.diff b/tests/mir-opt/const_prop/overwrite_with_const_with_params.size_of.GVN.diff index 1eadffa4f3659..da6ef0a978b4e 100644 --- a/tests/mir-opt/const_prop/overwrite_with_const_with_params.size_of.GVN.diff +++ b/tests/mir-opt/const_prop/overwrite_with_const_with_params.size_of.GVN.diff @@ -12,7 +12,7 @@ StorageLive(_1); _1 = const 0_usize; _1 = const SizeOfConst::::SIZE; - _0 = _1; + _0 = copy _1; StorageDead(_1); return; } diff --git a/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-abort.diff index 79a95b618d17f..657fa7a5fea19 100644 --- a/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-abort.diff @@ -24,9 +24,9 @@ StorageDead(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = read(move _5) -> [return: bb1, unwind unreachable]; -+ _4 = read(_1) -> [return: bb1, unwind unreachable]; ++ _4 = read(copy _1) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-unwind.diff index 9d1bcd92fef21..8fef6591d41d9 100644 --- a/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-unwind.diff @@ -24,9 +24,9 @@ StorageDead(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = read(move _5) -> [return: bb1, unwind continue]; -+ _4 = read(_1) -> [return: bb1, unwind continue]; ++ _4 = read(copy _1) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/const_prop/read_immutable_static.main.GVN.diff b/tests/mir-opt/const_prop/read_immutable_static.main.GVN.diff index 38f235052303f..8df262b351f12 100644 --- a/tests/mir-opt/const_prop/read_immutable_static.main.GVN.diff +++ b/tests/mir-opt/const_prop/read_immutable_static.main.GVN.diff @@ -19,12 +19,12 @@ + nop; + nop; _3 = const {ALLOC0: &u8}; -- _2 = (*_3); +- _2 = copy (*_3); + _2 = const 2_u8; StorageLive(_4); StorageLive(_5); _5 = const {ALLOC0: &u8}; -- _4 = (*_5); +- _4 = copy (*_5); - _1 = Add(move _2, move _4); + _4 = const 2_u8; + _1 = const 4_u8; diff --git a/tests/mir-opt/const_prop/ref_deref.main.GVN.diff b/tests/mir-opt/const_prop/ref_deref.main.GVN.diff index 509924a91c51d..b9e269266b0b1 100644 --- a/tests/mir-opt/const_prop/ref_deref.main.GVN.diff +++ b/tests/mir-opt/const_prop/ref_deref.main.GVN.diff @@ -16,7 +16,7 @@ StorageLive(_2); _4 = const main::promoted[0]; _2 = &(*_4); -- _1 = (*_2); +- _1 = copy (*_2); + _1 = const 4_i32; StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/const_prop/ref_deref_project.main.GVN.diff b/tests/mir-opt/const_prop/ref_deref_project.main.GVN.diff index 820c6cc068061..dcc13c9251c41 100644 --- a/tests/mir-opt/const_prop/ref_deref_project.main.GVN.diff +++ b/tests/mir-opt/const_prop/ref_deref_project.main.GVN.diff @@ -16,7 +16,7 @@ StorageLive(_2); _4 = const main::promoted[0]; _2 = &((*_4).1: i32); -- _1 = (*_2); +- _1 = copy (*_2); + _1 = const 5_i32; StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/const_prop/repeat.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/const_prop/repeat.main.GVN.32bit.panic-abort.diff index 71635b8e9c3e7..f7c1c2da01fc1 100644 --- a/tests/mir-opt/const_prop/repeat.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/repeat.main.GVN.32bit.panic-abort.diff @@ -21,15 +21,15 @@ StorageLive(_4); _4 = const 2_usize; - _5 = Len(_3); -- _6 = Lt(_4, _5); -- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind unreachable]; +- _6 = Lt(copy _4, copy _5); +- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, copy _4) -> [success: bb1, unwind unreachable]; + _5 = const 8_usize; + _6 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _2 = _3[_4]; +- _2 = copy _3[_4]; - _1 = Add(move _2, const 0_u32); + _2 = const 42_u32; + _1 = const 42_u32; diff --git a/tests/mir-opt/const_prop/repeat.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/const_prop/repeat.main.GVN.32bit.panic-unwind.diff index 84205028d6d2b..436773c855636 100644 --- a/tests/mir-opt/const_prop/repeat.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/repeat.main.GVN.32bit.panic-unwind.diff @@ -21,15 +21,15 @@ StorageLive(_4); _4 = const 2_usize; - _5 = Len(_3); -- _6 = Lt(_4, _5); -- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind continue]; +- _6 = Lt(copy _4, copy _5); +- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, copy _4) -> [success: bb1, unwind continue]; + _5 = const 8_usize; + _6 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _2 = _3[_4]; +- _2 = copy _3[_4]; - _1 = Add(move _2, const 0_u32); + _2 = const 42_u32; + _1 = const 42_u32; diff --git a/tests/mir-opt/const_prop/repeat.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/const_prop/repeat.main.GVN.64bit.panic-abort.diff index 71635b8e9c3e7..f7c1c2da01fc1 100644 --- a/tests/mir-opt/const_prop/repeat.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/repeat.main.GVN.64bit.panic-abort.diff @@ -21,15 +21,15 @@ StorageLive(_4); _4 = const 2_usize; - _5 = Len(_3); -- _6 = Lt(_4, _5); -- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind unreachable]; +- _6 = Lt(copy _4, copy _5); +- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, copy _4) -> [success: bb1, unwind unreachable]; + _5 = const 8_usize; + _6 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _2 = _3[_4]; +- _2 = copy _3[_4]; - _1 = Add(move _2, const 0_u32); + _2 = const 42_u32; + _1 = const 42_u32; diff --git a/tests/mir-opt/const_prop/repeat.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/const_prop/repeat.main.GVN.64bit.panic-unwind.diff index 84205028d6d2b..436773c855636 100644 --- a/tests/mir-opt/const_prop/repeat.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/repeat.main.GVN.64bit.panic-unwind.diff @@ -21,15 +21,15 @@ StorageLive(_4); _4 = const 2_usize; - _5 = Len(_3); -- _6 = Lt(_4, _5); -- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind continue]; +- _6 = Lt(copy _4, copy _5); +- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, copy _4) -> [success: bb1, unwind continue]; + _5 = const 8_usize; + _6 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _2 = _3[_4]; +- _2 = copy _3[_4]; - _1 = Add(move _2, const 0_u32); + _2 = const 42_u32; + _1 = const 42_u32; diff --git a/tests/mir-opt/const_prop/scalar_literal_propagation.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/scalar_literal_propagation.main.GVN.panic-abort.diff index 0a20fb0e59ef0..3c73d34474c13 100644 --- a/tests/mir-opt/const_prop/scalar_literal_propagation.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/scalar_literal_propagation.main.GVN.panic-abort.diff @@ -16,7 +16,7 @@ _1 = const 1_u32; StorageLive(_2); StorageLive(_3); -- _3 = _1; +- _3 = copy _1; - _2 = consume(move _3) -> [return: bb1, unwind unreachable]; + _3 = const 1_u32; + _2 = consume(const 1_u32) -> [return: bb1, unwind unreachable]; diff --git a/tests/mir-opt/const_prop/scalar_literal_propagation.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/scalar_literal_propagation.main.GVN.panic-unwind.diff index 8b9519d3adc49..0a7fddee39b62 100644 --- a/tests/mir-opt/const_prop/scalar_literal_propagation.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/scalar_literal_propagation.main.GVN.panic-unwind.diff @@ -16,7 +16,7 @@ _1 = const 1_u32; StorageLive(_2); StorageLive(_3); -- _3 = _1; +- _3 = copy _1; - _2 = consume(move _3) -> [return: bb1, unwind continue]; + _3 = const 1_u32; + _2 = consume(const 1_u32) -> [return: bb1, unwind continue]; diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff index 21d91d0320ae2..e834a5802c33f 100644 --- a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff @@ -22,24 +22,24 @@ StorageLive(_3); StorageLive(_4); _9 = const main::promoted[0]; - _4 = _9; -- _3 = _4; + _4 = copy _9; +- _3 = copy _4; - _2 = move _3 as &[u32] (PointerCoercion(Unsize)); -+ _3 = _9; -+ _2 = _9 as &[u32] (PointerCoercion(Unsize)); ++ _3 = copy _9; ++ _2 = copy _9 as &[u32] (PointerCoercion(Unsize)); StorageDead(_3); StorageLive(_6); _6 = const 1_usize; - _7 = Len((*_2)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind unreachable]; + _7 = const 3_usize; + _8 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = (*_2)[_6]; +- _1 = copy (*_2)[_6]; + _1 = const 2_u32; StorageDead(_6); StorageDead(_4); diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff index 889114c986236..55ffc50180569 100644 --- a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff @@ -22,24 +22,24 @@ StorageLive(_3); StorageLive(_4); _9 = const main::promoted[0]; - _4 = _9; -- _3 = _4; + _4 = copy _9; +- _3 = copy _4; - _2 = move _3 as &[u32] (PointerCoercion(Unsize)); -+ _3 = _9; -+ _2 = _9 as &[u32] (PointerCoercion(Unsize)); ++ _3 = copy _9; ++ _2 = copy _9 as &[u32] (PointerCoercion(Unsize)); StorageDead(_3); StorageLive(_6); _6 = const 1_usize; - _7 = Len((*_2)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue]; +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind continue]; + _7 = const 3_usize; + _8 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = (*_2)[_6]; +- _1 = copy (*_2)[_6]; + _1 = const 2_u32; StorageDead(_6); StorageDead(_4); diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff index 21d91d0320ae2..e834a5802c33f 100644 --- a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff @@ -22,24 +22,24 @@ StorageLive(_3); StorageLive(_4); _9 = const main::promoted[0]; - _4 = _9; -- _3 = _4; + _4 = copy _9; +- _3 = copy _4; - _2 = move _3 as &[u32] (PointerCoercion(Unsize)); -+ _3 = _9; -+ _2 = _9 as &[u32] (PointerCoercion(Unsize)); ++ _3 = copy _9; ++ _2 = copy _9 as &[u32] (PointerCoercion(Unsize)); StorageDead(_3); StorageLive(_6); _6 = const 1_usize; - _7 = Len((*_2)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind unreachable]; + _7 = const 3_usize; + _8 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = (*_2)[_6]; +- _1 = copy (*_2)[_6]; + _1 = const 2_u32; StorageDead(_6); StorageDead(_4); diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff index 889114c986236..55ffc50180569 100644 --- a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff @@ -22,24 +22,24 @@ StorageLive(_3); StorageLive(_4); _9 = const main::promoted[0]; - _4 = _9; -- _3 = _4; + _4 = copy _9; +- _3 = copy _4; - _2 = move _3 as &[u32] (PointerCoercion(Unsize)); -+ _3 = _9; -+ _2 = _9 as &[u32] (PointerCoercion(Unsize)); ++ _3 = copy _9; ++ _2 = copy _9 as &[u32] (PointerCoercion(Unsize)); StorageDead(_3); StorageLive(_6); _6 = const 1_usize; - _7 = Len((*_2)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue]; +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind continue]; + _7 = const 3_usize; + _8 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = (*_2)[_6]; +- _1 = copy (*_2)[_6]; + _1 = const 2_u32; StorageDead(_6); StorageDead(_4); diff --git a/tests/mir-opt/const_prop/switch_int.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/switch_int.main.GVN.panic-abort.diff index ee9f2d5c7f5bd..2339f110f5a1d 100644 --- a/tests/mir-opt/const_prop/switch_int.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/switch_int.main.GVN.panic-abort.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_1); _1 = const 1_i32; -- switchInt(_1) -> [1: bb2, otherwise: bb1]; +- switchInt(copy _1) -> [1: bb2, otherwise: bb1]; + switchInt(const 1_i32) -> [1: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/const_prop/switch_int.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/switch_int.main.GVN.panic-unwind.diff index 143d04ac984bc..49082e6ba5260 100644 --- a/tests/mir-opt/const_prop/switch_int.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/switch_int.main.GVN.panic-unwind.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_1); _1 = const 1_i32; -- switchInt(_1) -> [1: bb2, otherwise: bb1]; +- switchInt(copy _1) -> [1: bb2, otherwise: bb1]; + switchInt(const 1_i32) -> [1: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.32bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.32bit.diff index 7a289563c5069..de0b1a57f8080 100644 --- a/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.32bit.diff +++ b/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.32bit.diff @@ -12,7 +12,7 @@ bb0: { StorageLive(_1); - _1 = const 1_usize as std::boxed::Box (Transmute); -- _2 = (((_1.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const Never); +- _2 = copy (((_1.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const Never); + _1 = const Box::(Unique:: {{ pointer: NonNull:: {{ pointer: {0x1 as *const Never} }}, _marker: PhantomData:: }}, std::alloc::Global); + _2 = const {0x1 as *const Never}; unreachable; diff --git a/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.64bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.64bit.diff index 7a289563c5069..de0b1a57f8080 100644 --- a/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.64bit.diff +++ b/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.64bit.diff @@ -12,7 +12,7 @@ bb0: { StorageLive(_1); - _1 = const 1_usize as std::boxed::Box (Transmute); -- _2 = (((_1.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const Never); +- _2 = copy (((_1.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const Never); + _1 = const Box::(Unique:: {{ pointer: NonNull:: {{ pointer: {0x1 as *const Never} }}, _marker: PhantomData:: }}, std::alloc::Global); + _2 = const {0x1 as *const Never}; unreachable; diff --git a/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-abort.diff index bf8fece3d37b9..01d86ce8717d1 100644 --- a/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-abort.diff @@ -17,7 +17,7 @@ + _1 = const (1_u32, 2_u32); StorageLive(_2); StorageLive(_3); -- _3 = _1; +- _3 = copy _1; - _2 = consume(move _3) -> [return: bb1, unwind unreachable]; + _3 = const (1_u32, 2_u32); + _2 = consume(const (1_u32, 2_u32)) -> [return: bb1, unwind unreachable]; diff --git a/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-unwind.diff index 02a75849d8872..bd7d494212ce6 100644 --- a/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-unwind.diff @@ -17,7 +17,7 @@ + _1 = const (1_u32, 2_u32); StorageLive(_2); StorageLive(_3); -- _3 = _1; +- _3 = copy _1; - _2 = consume(move _3) -> [return: bb1, unwind continue]; + _3 = const (1_u32, 2_u32); + _2 = consume(const (1_u32, 2_u32)) -> [return: bb1, unwind continue]; diff --git a/tests/mir-opt/const_prop/while_let_loops.change_loop_body.GVN.diff b/tests/mir-opt/const_prop/while_let_loops.change_loop_body.GVN.diff index 9548afc9d4027..f830624cae76e 100644 --- a/tests/mir-opt/const_prop/while_let_loops.change_loop_body.GVN.diff +++ b/tests/mir-opt/const_prop/while_let_loops.change_loop_body.GVN.diff @@ -30,7 +30,7 @@ } bb1: { -- switchInt(((_3 as Some).0: u32)) -> [0: bb2, otherwise: bb3]; +- switchInt(copy ((_3 as Some).0: u32)) -> [0: bb2, otherwise: bb3]; + switchInt(const Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: u32) -> [0: bb2, otherwise: bb3]; } diff --git a/tests/mir-opt/copy-prop/borrowed_local.borrowed.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/borrowed_local.borrowed.CopyProp.panic-abort.diff index 897592a0e2fdd..40e8c06f357e1 100644 --- a/tests/mir-opt/copy-prop/borrowed_local.borrowed.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/borrowed_local.borrowed.CopyProp.panic-abort.diff @@ -7,14 +7,14 @@ let mut _3: &T; bb0: { -- _2 = _1; +- _2 = copy _1; _3 = &_1; - _0 = opaque::<&T>(_3) -> [return: bb1, unwind unreachable]; + _0 = opaque::<&T>(copy _3) -> [return: bb1, unwind unreachable]; } bb1: { -- _0 = opaque::(_2) -> [return: bb2, unwind unreachable]; -+ _0 = opaque::(_1) -> [return: bb2, unwind unreachable]; +- _0 = opaque::(copy _2) -> [return: bb2, unwind unreachable]; ++ _0 = opaque::(copy _1) -> [return: bb2, unwind unreachable]; } bb2: { diff --git a/tests/mir-opt/copy-prop/borrowed_local.borrowed.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/borrowed_local.borrowed.CopyProp.panic-unwind.diff index 33c05af91a10e..d09c96c0f2ba1 100644 --- a/tests/mir-opt/copy-prop/borrowed_local.borrowed.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/borrowed_local.borrowed.CopyProp.panic-unwind.diff @@ -7,14 +7,14 @@ let mut _3: &T; bb0: { -- _2 = _1; +- _2 = copy _1; _3 = &_1; - _0 = opaque::<&T>(_3) -> [return: bb1, unwind continue]; + _0 = opaque::<&T>(copy _3) -> [return: bb1, unwind continue]; } bb1: { -- _0 = opaque::(_2) -> [return: bb2, unwind continue]; -+ _0 = opaque::(_1) -> [return: bb2, unwind continue]; +- _0 = opaque::(copy _2) -> [return: bb2, unwind continue]; ++ _0 = opaque::(copy _1) -> [return: bb2, unwind continue]; } bb2: { diff --git a/tests/mir-opt/copy-prop/borrowed_local.compare_address.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/borrowed_local.compare_address.CopyProp.panic-abort.diff index 3d6b5dffba456..7e63911d84341 100644 --- a/tests/mir-opt/copy-prop/borrowed_local.compare_address.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/borrowed_local.compare_address.CopyProp.panic-abort.diff @@ -11,13 +11,13 @@ bb0: { _1 = const 5_u8; _2 = &_1; - _3 = _1; + _3 = copy _1; _4 = &_3; - _0 = cmp_ref(_2, _4) -> [return: bb1, unwind unreachable]; + _0 = cmp_ref(copy _2, copy _4) -> [return: bb1, unwind unreachable]; } bb1: { - _0 = opaque::(_3) -> [return: bb2, unwind unreachable]; + _0 = opaque::(copy _3) -> [return: bb2, unwind unreachable]; } bb2: { diff --git a/tests/mir-opt/copy-prop/borrowed_local.compare_address.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/borrowed_local.compare_address.CopyProp.panic-unwind.diff index 0f29d2681de8c..8e5f8b21fe708 100644 --- a/tests/mir-opt/copy-prop/borrowed_local.compare_address.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/borrowed_local.compare_address.CopyProp.panic-unwind.diff @@ -11,13 +11,13 @@ bb0: { _1 = const 5_u8; _2 = &_1; - _3 = _1; + _3 = copy _1; _4 = &_3; - _0 = cmp_ref(_2, _4) -> [return: bb1, unwind continue]; + _0 = cmp_ref(copy _2, copy _4) -> [return: bb1, unwind continue]; } bb1: { - _0 = opaque::(_3) -> [return: bb2, unwind continue]; + _0 = opaque::(copy _3) -> [return: bb2, unwind continue]; } bb2: { diff --git a/tests/mir-opt/copy-prop/borrowed_local.non_freeze.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/borrowed_local.non_freeze.CopyProp.panic-abort.diff index af2aeb0dcab25..99dda2a95ffa2 100644 --- a/tests/mir-opt/copy-prop/borrowed_local.non_freeze.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/borrowed_local.non_freeze.CopyProp.panic-abort.diff @@ -7,13 +7,13 @@ let mut _3: &T; bb0: { - _2 = _1; + _2 = copy _1; _3 = &_1; - _0 = opaque::<&T>(_3) -> [return: bb1, unwind unreachable]; + _0 = opaque::<&T>(copy _3) -> [return: bb1, unwind unreachable]; } bb1: { - _0 = opaque::(_2) -> [return: bb2, unwind unreachable]; + _0 = opaque::(copy _2) -> [return: bb2, unwind unreachable]; } bb2: { diff --git a/tests/mir-opt/copy-prop/borrowed_local.non_freeze.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/borrowed_local.non_freeze.CopyProp.panic-unwind.diff index 040ed0aec1669..6eb48cd8dbcf3 100644 --- a/tests/mir-opt/copy-prop/borrowed_local.non_freeze.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/borrowed_local.non_freeze.CopyProp.panic-unwind.diff @@ -7,13 +7,13 @@ let mut _3: &T; bb0: { - _2 = _1; + _2 = copy _1; _3 = &_1; - _0 = opaque::<&T>(_3) -> [return: bb1, unwind continue]; + _0 = opaque::<&T>(copy _3) -> [return: bb1, unwind continue]; } bb1: { - _0 = opaque::(_2) -> [return: bb2, unwind continue]; + _0 = opaque::(copy _2) -> [return: bb2, unwind continue]; } bb2: { diff --git a/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-abort.diff index 3334cdf92e7d7..c8889ee716ff4 100644 --- a/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-abort.diff @@ -30,7 +30,7 @@ } bb3: { - _2 = _1; + _2 = copy _1; goto -> bb6; } @@ -41,13 +41,13 @@ bb5: { StorageDead(_4); - _2 = _1; + _2 = copy _1; goto -> bb6; } bb6: { StorageDead(_3); - _0 = _2; + _0 = copy _2; StorageDead(_2); StorageDead(_1); return; diff --git a/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-unwind.diff index 2f92d8818cff3..a41c28cb8c8ab 100644 --- a/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-unwind.diff @@ -30,7 +30,7 @@ } bb3: { - _2 = _1; + _2 = copy _1; goto -> bb6; } @@ -41,13 +41,13 @@ bb5: { StorageDead(_4); - _2 = _1; + _2 = copy _1; goto -> bb6; } bb6: { StorageDead(_3); - _0 = _2; + _0 = copy _2; StorageDead(_2); StorageDead(_1); return; diff --git a/tests/mir-opt/copy-prop/calls.multiple_edges.CopyProp.diff b/tests/mir-opt/copy-prop/calls.multiple_edges.CopyProp.diff index 4d56a8b25d360..9d0a1644ae4f3 100644 --- a/tests/mir-opt/copy-prop/calls.multiple_edges.CopyProp.diff +++ b/tests/mir-opt/copy-prop/calls.multiple_edges.CopyProp.diff @@ -6,7 +6,7 @@ let mut _2: u8; bb0: { - switchInt(_1) -> [1: bb1, otherwise: bb2]; + switchInt(copy _1) -> [1: bb1, otherwise: bb2]; } bb1: { @@ -14,7 +14,7 @@ } bb2: { - _0 = _2; + _0 = copy _2; return; } } diff --git a/tests/mir-opt/copy-prop/calls.nrvo.CopyProp.diff b/tests/mir-opt/copy-prop/calls.nrvo.CopyProp.diff index b5d56909b0ddb..29d9ec3f2fcb1 100644 --- a/tests/mir-opt/copy-prop/calls.nrvo.CopyProp.diff +++ b/tests/mir-opt/copy-prop/calls.nrvo.CopyProp.diff @@ -16,7 +16,7 @@ } bb1: { -- _0 = _1; +- _0 = copy _1; - StorageDead(_1); return; } diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-abort.diff index 70674a912edd2..280908ac63a6d 100644 --- a/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-abort.diff @@ -12,10 +12,10 @@ bb0: { - StorageLive(_2); -- _2 = _1; -+ _0 = _1; +- _2 = copy _1; ++ _0 = copy _1; _1 = const 123_i32; -- _0 = _2; +- _0 = copy _2; - StorageDead(_2); return; } diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-unwind.diff index 70674a912edd2..280908ac63a6d 100644 --- a/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-unwind.diff @@ -12,10 +12,10 @@ bb0: { - StorageLive(_2); -- _2 = _1; -+ _0 = _1; +- _2 = copy _1; ++ _0 = copy _1; _1 = const 123_i32; -- _0 = _2; +- _0 = copy _2; - StorageDead(_2); return; } diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-abort.diff index 9ec014e2b256b..eea07d5839d44 100644 --- a/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-abort.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = dummy(move _3) -> [return: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-unwind.diff index ef9c343a264d8..b0e5219913a59 100644 --- a/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-unwind.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = dummy(move _3) -> [return: bb1, unwind continue]; } diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-abort.diff index 71facf91df78c..5fb14902fefd1 100644 --- a/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-abort.diff @@ -8,10 +8,10 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; _1 = move _2; StorageDead(_2); - _0 = _1; + _0 = copy _1; return; } } diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-unwind.diff index 71facf91df78c..5fb14902fefd1 100644 --- a/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-unwind.diff @@ -8,10 +8,10 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; _1 = move _2; StorageDead(_2); - _0 = _1; + _0 = copy _1; return; } } diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-abort.diff index 81b73e18763fd..685a290492e22 100644 --- a/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-abort.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = dummy(move _3) -> [return: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-unwind.diff index 769089e16f34c..4a0601431abcc 100644 --- a/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-unwind.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = dummy(move _3) -> [return: bb1, unwind continue]; } diff --git a/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-abort.diff index 7ba8530105179..1445b899dee20 100644 --- a/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-abort.diff @@ -7,15 +7,15 @@ let mut _3: NotCopy; bb0: { -- _2 = _1; +- _2 = copy _1; - _0 = opaque::(move _1) -> [return: bb1, unwind unreachable]; -+ _0 = opaque::(_1) -> [return: bb1, unwind unreachable]; ++ _0 = opaque::(copy _1) -> [return: bb1, unwind unreachable]; } bb1: { - _3 = move _2; -- _0 = opaque::(_3) -> [return: bb2, unwind unreachable]; -+ _0 = opaque::(_1) -> [return: bb2, unwind unreachable]; +- _0 = opaque::(copy _3) -> [return: bb2, unwind unreachable]; ++ _0 = opaque::(copy _1) -> [return: bb2, unwind unreachable]; } bb2: { diff --git a/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-unwind.diff index 7ba8530105179..1445b899dee20 100644 --- a/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-unwind.diff @@ -7,15 +7,15 @@ let mut _3: NotCopy; bb0: { -- _2 = _1; +- _2 = copy _1; - _0 = opaque::(move _1) -> [return: bb1, unwind unreachable]; -+ _0 = opaque::(_1) -> [return: bb1, unwind unreachable]; ++ _0 = opaque::(copy _1) -> [return: bb1, unwind unreachable]; } bb1: { - _3 = move _2; -- _0 = opaque::(_3) -> [return: bb2, unwind unreachable]; -+ _0 = opaque::(_1) -> [return: bb2, unwind unreachable]; +- _0 = opaque::(copy _3) -> [return: bb2, unwind unreachable]; ++ _0 = opaque::(copy _1) -> [return: bb2, unwind unreachable]; } bb2: { diff --git a/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-abort.diff index 8f97c4e439e9d..d133091e6a438 100644 --- a/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-abort.diff @@ -27,17 +27,17 @@ bb1: { - StorageLive(_2); - _2 = _1; + _2 = copy _1; - StorageLive(_3); -- _3 = _2; +- _3 = copy _2; - StorageLive(_4); -- _4 = _3; +- _4 = copy _3; - _1 = move _4; - StorageDead(_4); -+ _1 = _2; ++ _1 = copy _2; StorageLive(_5); StorageLive(_6); - _6 = _1; + _6 = copy _1; _5 = std::mem::drop::(move _6) -> [return: bb2, unwind unreachable]; } diff --git a/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-unwind.diff index e343b78924ab1..bd4ad737cec13 100644 --- a/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-unwind.diff @@ -27,17 +27,17 @@ bb1: { - StorageLive(_2); - _2 = _1; + _2 = copy _1; - StorageLive(_3); -- _3 = _2; +- _3 = copy _2; - StorageLive(_4); -- _4 = _3; +- _4 = copy _3; - _1 = move _4; - StorageDead(_4); -+ _1 = _2; ++ _1 = copy _2; StorageLive(_5); StorageLive(_6); - _6 = _1; + _6 = copy _1; _5 = std::mem::drop::(move _6) -> [return: bb2, unwind continue]; } diff --git a/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-abort.mir b/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-abort.mir index 02b88d1400353..4781fdfd902a4 100644 --- a/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-abort.mir +++ b/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-abort.mir @@ -11,11 +11,11 @@ fn f(_1: usize) -> usize { } bb0: { - _2 = _1; + _2 = copy _1; _1 = const 5_usize; - _1 = _2; + _1 = copy _2; StorageLive(_4); - _4 = _1; + _4 = copy _1; _0 = id::(move _4) -> [return: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-unwind.mir b/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-unwind.mir index f8c285ff3843b..f5fded45c13b4 100644 --- a/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-unwind.mir +++ b/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-unwind.mir @@ -11,11 +11,11 @@ fn f(_1: usize) -> usize { } bb0: { - _2 = _1; + _2 = copy _1; _1 = const 5_usize; - _1 = _2; + _1 = copy _2; StorageLive(_4); - _4 = _1; + _4 = copy _1; _0 = id::(move _4) -> [return: bb1, unwind continue]; } diff --git a/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-abort.mir b/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-abort.mir index 02b88d1400353..4781fdfd902a4 100644 --- a/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-abort.mir +++ b/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-abort.mir @@ -11,11 +11,11 @@ fn f(_1: usize) -> usize { } bb0: { - _2 = _1; + _2 = copy _1; _1 = const 5_usize; - _1 = _2; + _1 = copy _2; StorageLive(_4); - _4 = _1; + _4 = copy _1; _0 = id::(move _4) -> [return: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-unwind.mir b/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-unwind.mir index f8c285ff3843b..f5fded45c13b4 100644 --- a/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-unwind.mir +++ b/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-unwind.mir @@ -11,11 +11,11 @@ fn f(_1: usize) -> usize { } bb0: { - _2 = _1; + _2 = copy _1; _1 = const 5_usize; - _1 = _2; + _1 = copy _2; StorageLive(_4); - _4 = _1; + _4 = copy _1; _0 = id::(move _4) -> [return: bb1, unwind continue]; } diff --git a/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-abort.diff index 51390e2abbe9a..f4411886f9a7a 100644 --- a/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-abort.diff @@ -88,15 +88,15 @@ bb6: { - StorageLive(_16); - _16 = ((_11 as Some).0: usize); + _16 = copy ((_11 as Some).0: usize); StorageLive(_17); - StorageLive(_18); -- _18 = _16; +- _18 = copy _16; _19 = Len(_2); -- _20 = Lt(_18, _19); -- assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, _18) -> [success: bb8, unwind unreachable]; -+ _20 = Lt(_16, _19); -+ assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, _16) -> [success: bb8, unwind unreachable]; +- _20 = Lt(copy _18, copy _19); +- assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, copy _18) -> [success: bb8, unwind unreachable]; ++ _20 = Lt(copy _16, copy _19); ++ assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, copy _16) -> [success: bb8, unwind unreachable]; } bb7: { @@ -112,9 +112,9 @@ } bb8: { -- _17 = _2[_18]; -+ _17 = _2[_16]; - _1 = Add(_1, move _17); +- _17 = copy _2[_18]; ++ _17 = copy _2[_16]; + _1 = Add(copy _1, move _17); StorageDead(_17); - StorageDead(_18); - _10 = const (); diff --git a/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-unwind.diff index 8a2cbb68824c8..833588aa4e920 100644 --- a/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-unwind.diff @@ -88,15 +88,15 @@ bb6: { - StorageLive(_16); - _16 = ((_11 as Some).0: usize); + _16 = copy ((_11 as Some).0: usize); StorageLive(_17); - StorageLive(_18); -- _18 = _16; +- _18 = copy _16; _19 = Len(_2); -- _20 = Lt(_18, _19); -- assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, _18) -> [success: bb8, unwind continue]; -+ _20 = Lt(_16, _19); -+ assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, _16) -> [success: bb8, unwind continue]; +- _20 = Lt(copy _18, copy _19); +- assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, copy _18) -> [success: bb8, unwind continue]; ++ _20 = Lt(copy _16, copy _19); ++ assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, copy _16) -> [success: bb8, unwind continue]; } bb7: { @@ -112,9 +112,9 @@ } bb8: { -- _17 = _2[_18]; -+ _17 = _2[_16]; - _1 = Add(_1, move _17); +- _17 = copy _2[_18]; ++ _17 = copy _2[_16]; + _1 = Add(copy _1, move _17); StorageDead(_17); - StorageDead(_18); - _10 = const (); diff --git a/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-abort.diff index cf04f213efb91..da9904bfa01f5 100644 --- a/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-abort.diff @@ -15,14 +15,14 @@ bb0: { - StorageLive(_2); -- _2 = _1; +- _2 = copy _1; StorageLive(_3); - StorageLive(_4); -- _4 = _1; +- _4 = copy _1; - StorageLive(_5); -- _5 = _2; +- _5 = copy _2; - _3 = g::(move _4, move _5) -> [return: bb1, unwind unreachable]; -+ _3 = g::(_1, _1) -> [return: bb1, unwind unreachable]; ++ _3 = g::(copy _1, copy _1) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-unwind.diff index 0c6a3c6d5c954..9b0de655bd262 100644 --- a/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-unwind.diff @@ -15,14 +15,14 @@ bb0: { - StorageLive(_2); -- _2 = _1; +- _2 = copy _1; StorageLive(_3); - StorageLive(_4); -- _4 = _1; +- _4 = copy _1; - StorageLive(_5); -- _5 = _2; +- _5 = copy _2; - _3 = g::(move _4, move _5) -> [return: bb1, unwind continue]; -+ _3 = g::(_1, _1) -> [return: bb1, unwind continue]; ++ _3 = g::(copy _1, copy _1) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-abort.diff index b2b89968d70b0..973bcd6de8395 100644 --- a/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-abort.diff @@ -7,11 +7,11 @@ let mut _3: u8; bb0: { -- _2 = _1; +- _2 = copy _1; - _3 = move (_2.0: u8); - _0 = opaque::(move _1) -> [return: bb1, unwind unreachable]; -+ _3 = (_1.0: u8); -+ _0 = opaque::(_1) -> [return: bb1, unwind unreachable]; ++ _3 = copy (_1.0: u8); ++ _0 = opaque::(copy _1) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-unwind.diff index b2b89968d70b0..973bcd6de8395 100644 --- a/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-unwind.diff @@ -7,11 +7,11 @@ let mut _3: u8; bb0: { -- _2 = _1; +- _2 = copy _1; - _3 = move (_2.0: u8); - _0 = opaque::(move _1) -> [return: bb1, unwind unreachable]; -+ _3 = (_1.0: u8); -+ _0 = opaque::(_1) -> [return: bb1, unwind unreachable]; ++ _3 = copy (_1.0: u8); ++ _0 = opaque::(copy _1) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/copy-prop/mutate_through_pointer.f.CopyProp.diff b/tests/mir-opt/copy-prop/mutate_through_pointer.f.CopyProp.diff index 7f6802beeae2f..f96be62712945 100644 --- a/tests/mir-opt/copy-prop/mutate_through_pointer.f.CopyProp.diff +++ b/tests/mir-opt/copy-prop/mutate_through_pointer.f.CopyProp.diff @@ -8,11 +8,11 @@ let mut _4: *mut bool; bb0: { - _2 = _1; + _2 = copy _1; _3 = &raw const _2; _4 = &raw mut (*_3); (*_4) = const false; - _0 = _1; + _0 = copy _1; return; } } diff --git a/tests/mir-opt/copy-prop/non_dominate.f.CopyProp.diff b/tests/mir-opt/copy-prop/non_dominate.f.CopyProp.diff index 5bf2335943cf6..6955d694e5ab2 100644 --- a/tests/mir-opt/copy-prop/non_dominate.f.CopyProp.diff +++ b/tests/mir-opt/copy-prop/non_dominate.f.CopyProp.diff @@ -11,18 +11,18 @@ } bb1: { - _3 = _1; - switchInt(_3) -> [0: bb3, otherwise: bb2]; + _3 = copy _1; + switchInt(copy _3) -> [0: bb3, otherwise: bb2]; } bb2: { - _2 = _3; + _2 = copy _3; _1 = const false; goto -> bb1; } bb3: { - _0 = _2; + _0 = copy _2; return; } } diff --git a/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-abort.diff index ef30ac2fc8c09..676c5cee34387 100644 --- a/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-abort.diff @@ -30,12 +30,12 @@ _3 = &mut (*_4); StorageDead(_4); - StorageLive(_5); -- _5 = _2; +- _5 = copy _2; StorageLive(_6); - StorageLive(_7); -- _7 = _5; +- _7 = copy _5; - _6 = opaque::<*mut u8>(move _7) -> [return: bb1, unwind unreachable]; -+ _6 = opaque::<*mut u8>(_2) -> [return: bb1, unwind unreachable]; ++ _6 = opaque::<*mut u8>(copy _2) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-unwind.diff index a743a3e829a71..ca2232ce54a1f 100644 --- a/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-unwind.diff @@ -30,12 +30,12 @@ _3 = &mut (*_4); StorageDead(_4); - StorageLive(_5); -- _5 = _2; +- _5 = copy _2; StorageLive(_6); - StorageLive(_7); -- _7 = _5; +- _7 = copy _5; - _6 = opaque::<*mut u8>(move _7) -> [return: bb1, unwind continue]; -+ _6 = opaque::<*mut u8>(_2) -> [return: bb1, unwind continue]; ++ _6 = opaque::<*mut u8>(copy _2) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-abort.diff index 2de6f85ce64bf..1968696905fc7 100644 --- a/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-abort.diff @@ -26,12 +26,12 @@ StorageLive(_3); _3 = &raw mut (*_2); - StorageLive(_4); -- _4 = _2; +- _4 = copy _2; StorageLive(_5); - StorageLive(_6); -- _6 = _4; +- _6 = copy _4; - _5 = opaque::<*mut u8>(move _6) -> [return: bb1, unwind unreachable]; -+ _5 = opaque::<*mut u8>(_2) -> [return: bb1, unwind unreachable]; ++ _5 = opaque::<*mut u8>(copy _2) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-unwind.diff index 2afec4898bc86..9a3c9665bc8f3 100644 --- a/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-unwind.diff @@ -26,12 +26,12 @@ StorageLive(_3); _3 = &raw mut (*_2); - StorageLive(_4); -- _4 = _2; +- _4 = copy _2; StorageLive(_5); - StorageLive(_6); -- _6 = _4; +- _6 = copy _4; - _5 = opaque::<*mut u8>(move _6) -> [return: bb1, unwind continue]; -+ _5 = opaque::<*mut u8>(_2) -> [return: bb1, unwind continue]; ++ _5 = opaque::<*mut u8>(copy _2) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff b/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff index 3d791734f4626..eeeac70b5b8e7 100644 --- a/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff +++ b/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff @@ -71,33 +71,33 @@ bb5: { + Coverage::ExpressionUsed(2); StorageLive(_9); - _9 = ((_1 as A).0: u32); + _9 = copy ((_1 as A).0: u32); StorageLive(_10); - _10 = _9; + _10 = copy _9; _0 = consume(move _10) -> [return: bb12, unwind: bb14]; } bb6: { StorageLive(_7); - _7 = ((_1 as B).0: u32); + _7 = copy ((_1 as B).0: u32); StorageLive(_8); - _8 = _7; + _8 = copy _7; _0 = consume(move _8) -> [return: bb11, unwind: bb14]; } bb7: { StorageLive(_5); - _5 = ((_1 as C).0: u32); + _5 = copy ((_1 as C).0: u32); StorageLive(_6); - _6 = _5; + _6 = copy _5; _0 = consume(move _6) -> [return: bb10, unwind: bb14]; } bb8: { StorageLive(_3); - _3 = ((_1 as D).0: u32); + _3 = copy ((_1 as D).0: u32); StorageLive(_4); - _4 = _3; + _4 = copy _3; _0 = consume(move _4) -> [return: bb9, unwind: bb14]; } diff --git a/tests/mir-opt/dataflow-const-prop/aggregate_copy.foo.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/aggregate_copy.foo.DataflowConstProp.diff index 3b739a25cb864..8dd34d845801d 100644 --- a/tests/mir-opt/dataflow-const-prop/aggregate_copy.foo.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/aggregate_copy.foo.DataflowConstProp.diff @@ -22,14 +22,14 @@ StorageLive(_1); _1 = const Foo; StorageLive(_2); -- _2 = _1; +- _2 = copy _1; + _2 = const (5_u32, 3_u32); StorageLive(_3); -- _3 = (_2.1: u32); +- _3 = copy (_2.1: u32); + _3 = const 3_u32; StorageLive(_4); StorageLive(_5); -- _5 = _3; +- _5 = copy _3; - _4 = Ge(move _5, const 2_u32); - switchInt(move _4) -> [0: bb2, otherwise: bb1]; + _5 = const 3_u32; @@ -39,7 +39,7 @@ bb1: { StorageDead(_5); -- _0 = (_2.0: u32); +- _0 = copy (_2.0: u32); + _0 = const 5_u32; goto -> bb3; } diff --git a/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.32bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.32bit.panic-abort.diff index 212ddc5b15418..a46daef435f3b 100644 --- a/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.32bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.32bit.panic-abort.diff @@ -19,16 +19,16 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const 4_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = _2[_3]; -+ _1 = _2[2 of 3]; +- _1 = copy _2[_3]; ++ _1 = copy _2[2 of 3]; StorageDead(_3); StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.32bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.32bit.panic-unwind.diff index 5c53d4f446131..1a4e15b45faad 100644 --- a/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.32bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.32bit.panic-unwind.diff @@ -19,16 +19,16 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind continue]; + _4 = const 4_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = _2[_3]; -+ _1 = _2[2 of 3]; +- _1 = copy _2[_3]; ++ _1 = copy _2[2 of 3]; StorageDead(_3); StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.64bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.64bit.panic-abort.diff index 212ddc5b15418..a46daef435f3b 100644 --- a/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.64bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.64bit.panic-abort.diff @@ -19,16 +19,16 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const 4_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = _2[_3]; -+ _1 = _2[2 of 3]; +- _1 = copy _2[_3]; ++ _1 = copy _2[2 of 3]; StorageDead(_3); StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.64bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.64bit.panic-unwind.diff index 5c53d4f446131..1a4e15b45faad 100644 --- a/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.64bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.64bit.panic-unwind.diff @@ -19,16 +19,16 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind continue]; + _4 = const 4_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = _2[_3]; -+ _1 = _2[2 of 3]; +- _1 = copy _2[_3]; ++ _1 = copy _2[2 of 3]; StorageDead(_3); StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/boolean_identities.test.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/boolean_identities.test.DataflowConstProp.diff index 5440c38ce4bcf..89175fbad5c79 100644 --- a/tests/mir-opt/dataflow-const-prop/boolean_identities.test.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/boolean_identities.test.DataflowConstProp.diff @@ -13,13 +13,13 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _2; + _4 = copy _2; - _3 = BitOr(move _4, const true); + _3 = const true; StorageDead(_4); StorageLive(_5); StorageLive(_6); - _6 = _1; + _6 = copy _1; - _5 = BitAnd(move _6, const false); + _5 = const false; StorageDead(_6); diff --git a/tests/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff index 0ca446c89f2e0..f2c262f9fe2c0 100644 --- a/tests/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff @@ -20,7 +20,7 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); -- _4 = _1; +- _4 = copy _1; - _3 = move _4 as u8 (IntToInt); + _4 = const 257_i32; + _3 = const 1_u8; diff --git a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff index 79ea55617481e..867e768790f6f 100644 --- a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff @@ -36,11 +36,11 @@ _2 = const 2_i32; StorageLive(_3); StorageLive(_4); -- _4 = _1; +- _4 = copy _1; + _4 = const 1_i32; StorageLive(_5); -- _5 = _2; -- _6 = AddWithOverflow(_4, _5); +- _5 = copy _2; +- _6 = AddWithOverflow(copy _4, copy _5); - assert(!move (_6.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, move _5) -> [success: bb1, unwind unreachable]; + _5 = const 2_i32; + _6 = const (3_i32, false); @@ -56,8 +56,8 @@ _7 = const core::num::::MAX; StorageLive(_8); StorageLive(_9); -- _9 = _7; -- _10 = AddWithOverflow(_9, const 1_i32); +- _9 = copy _7; +- _10 = AddWithOverflow(copy _9, const 1_i32); - assert(!move (_10.1: bool), "attempt to compute `{} + {}`, which would overflow", move _9, const 1_i32) -> [success: bb2, unwind unreachable]; + _9 = const i32::MAX; + _10 = const (i32::MIN, true); diff --git a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff index bd22c50dd8fcf..c22edaaec4098 100644 --- a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff @@ -36,11 +36,11 @@ _2 = const 2_i32; StorageLive(_3); StorageLive(_4); -- _4 = _1; +- _4 = copy _1; + _4 = const 1_i32; StorageLive(_5); -- _5 = _2; -- _6 = AddWithOverflow(_4, _5); +- _5 = copy _2; +- _6 = AddWithOverflow(copy _4, copy _5); - assert(!move (_6.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, move _5) -> [success: bb1, unwind continue]; + _5 = const 2_i32; + _6 = const (3_i32, false); @@ -56,8 +56,8 @@ _7 = const core::num::::MAX; StorageLive(_8); StorageLive(_9); -- _9 = _7; -- _10 = AddWithOverflow(_9, const 1_i32); +- _9 = copy _7; +- _10 = AddWithOverflow(copy _9, const 1_i32); - assert(!move (_10.1: bool), "attempt to compute `{} + {}`, which would overflow", move _9, const 1_i32) -> [success: bb2, unwind continue]; + _9 = const i32::MAX; + _10 = const (i32::MIN, true); diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff index 9d96e895c8aa5..c7870a7902b98 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff @@ -50,7 +50,7 @@ StorageLive(_6); StorageLive(_7); - _7 = AlignOf([bool; 0]); -- _6 = _7 as *mut [bool; 0] (Transmute); +- _6 = copy _7 as *mut [bool; 0] (Transmute); + _7 = const 1_usize; + _6 = const {0x1 as *mut [bool; 0]}; StorageDead(_7); @@ -67,7 +67,7 @@ bb2: { StorageLive(_10); -- _10 = _6 as *mut () (PtrToPtr); +- _10 = copy _6 as *mut () (PtrToPtr); - _9 = NonNull::::new_unchecked::precondition_check(move _10) -> [return: bb3, unwind unreachable]; + _10 = const {0x1 as *mut ()}; + _9 = NonNull::::new_unchecked::precondition_check(const {0x1 as *mut ()}) -> [return: bb3, unwind unreachable]; @@ -80,8 +80,8 @@ bb4: { StorageDead(_8); -- _11 = _6 as *const [bool; 0] (PtrToPtr); -- _5 = NonNull::<[bool; 0]> { pointer: _11 }; +- _11 = copy _6 as *const [bool; 0] (PtrToPtr); +- _5 = NonNull::<[bool; 0]> { pointer: copy _11 }; + _11 = const {0x1 as *const [bool; 0]}; + _5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}; StorageDead(_11); @@ -92,7 +92,7 @@ - _3 = move _4 as std::ptr::Unique<[bool]> (PointerCoercion(Unsize)); + _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}; StorageDead(_4); -- _2 = Box::<[bool]>(_3, const std::alloc::Global); +- _2 = Box::<[bool]>(copy _3, const std::alloc::Global); + _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global); StorageDead(_9); StorageDead(_3); diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff index 0bdff584b01ec..f5de7a361bc10 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff @@ -50,7 +50,7 @@ StorageLive(_6); StorageLive(_7); - _7 = AlignOf([bool; 0]); -- _6 = _7 as *mut [bool; 0] (Transmute); +- _6 = copy _7 as *mut [bool; 0] (Transmute); + _7 = const 1_usize; + _6 = const {0x1 as *mut [bool; 0]}; StorageDead(_7); @@ -71,7 +71,7 @@ bb3: { StorageLive(_10); -- _10 = _6 as *mut () (PtrToPtr); +- _10 = copy _6 as *mut () (PtrToPtr); - _9 = NonNull::::new_unchecked::precondition_check(move _10) -> [return: bb4, unwind unreachable]; + _10 = const {0x1 as *mut ()}; + _9 = NonNull::::new_unchecked::precondition_check(const {0x1 as *mut ()}) -> [return: bb4, unwind unreachable]; @@ -84,8 +84,8 @@ bb5: { StorageDead(_8); -- _11 = _6 as *const [bool; 0] (PtrToPtr); -- _5 = NonNull::<[bool; 0]> { pointer: _11 }; +- _11 = copy _6 as *const [bool; 0] (PtrToPtr); +- _5 = NonNull::<[bool; 0]> { pointer: copy _11 }; + _11 = const {0x1 as *const [bool; 0]}; + _5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}; StorageDead(_11); @@ -96,7 +96,7 @@ - _3 = move _4 as std::ptr::Unique<[bool]> (PointerCoercion(Unsize)); + _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}; StorageDead(_4); -- _2 = Box::<[bool]>(_3, const std::alloc::Global); +- _2 = Box::<[bool]>(copy _3, const std::alloc::Global); + _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global); StorageDead(_9); StorageDead(_3); diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff index 99e96fe5d70fd..3b0bc6377da62 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff @@ -50,7 +50,7 @@ StorageLive(_6); StorageLive(_7); - _7 = AlignOf([bool; 0]); -- _6 = _7 as *mut [bool; 0] (Transmute); +- _6 = copy _7 as *mut [bool; 0] (Transmute); + _7 = const 1_usize; + _6 = const {0x1 as *mut [bool; 0]}; StorageDead(_7); @@ -67,7 +67,7 @@ bb2: { StorageLive(_10); -- _10 = _6 as *mut () (PtrToPtr); +- _10 = copy _6 as *mut () (PtrToPtr); - _9 = NonNull::::new_unchecked::precondition_check(move _10) -> [return: bb3, unwind unreachable]; + _10 = const {0x1 as *mut ()}; + _9 = NonNull::::new_unchecked::precondition_check(const {0x1 as *mut ()}) -> [return: bb3, unwind unreachable]; @@ -80,8 +80,8 @@ bb4: { StorageDead(_8); -- _11 = _6 as *const [bool; 0] (PtrToPtr); -- _5 = NonNull::<[bool; 0]> { pointer: _11 }; +- _11 = copy _6 as *const [bool; 0] (PtrToPtr); +- _5 = NonNull::<[bool; 0]> { pointer: copy _11 }; + _11 = const {0x1 as *const [bool; 0]}; + _5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}; StorageDead(_11); @@ -92,7 +92,7 @@ - _3 = move _4 as std::ptr::Unique<[bool]> (PointerCoercion(Unsize)); + _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}; StorageDead(_4); -- _2 = Box::<[bool]>(_3, const std::alloc::Global); +- _2 = Box::<[bool]>(copy _3, const std::alloc::Global); + _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global); StorageDead(_9); StorageDead(_3); diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff index 5eefabeac3868..5dd7ad9a11773 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff @@ -50,7 +50,7 @@ StorageLive(_6); StorageLive(_7); - _7 = AlignOf([bool; 0]); -- _6 = _7 as *mut [bool; 0] (Transmute); +- _6 = copy _7 as *mut [bool; 0] (Transmute); + _7 = const 1_usize; + _6 = const {0x1 as *mut [bool; 0]}; StorageDead(_7); @@ -71,7 +71,7 @@ bb3: { StorageLive(_10); -- _10 = _6 as *mut () (PtrToPtr); +- _10 = copy _6 as *mut () (PtrToPtr); - _9 = NonNull::::new_unchecked::precondition_check(move _10) -> [return: bb4, unwind unreachable]; + _10 = const {0x1 as *mut ()}; + _9 = NonNull::::new_unchecked::precondition_check(const {0x1 as *mut ()}) -> [return: bb4, unwind unreachable]; @@ -84,8 +84,8 @@ bb5: { StorageDead(_8); -- _11 = _6 as *const [bool; 0] (PtrToPtr); -- _5 = NonNull::<[bool; 0]> { pointer: _11 }; +- _11 = copy _6 as *const [bool; 0] (PtrToPtr); +- _5 = NonNull::<[bool; 0]> { pointer: copy _11 }; + _11 = const {0x1 as *const [bool; 0]}; + _5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}; StorageDead(_11); @@ -96,7 +96,7 @@ - _3 = move _4 as std::ptr::Unique<[bool]> (PointerCoercion(Unsize)); + _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}; StorageDead(_4); -- _2 = Box::<[bool]>(_3, const std::alloc::Global); +- _2 = Box::<[bool]>(copy _3, const std::alloc::Global); + _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global); StorageDead(_9); StorageDead(_3); diff --git a/tests/mir-opt/dataflow-const-prop/enum.constant.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/enum.constant.DataflowConstProp.32bit.diff index 9da1caf9004e8..ef3b24cd44002 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.constant.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.constant.DataflowConstProp.32bit.diff @@ -37,16 +37,16 @@ bb2: { StorageLive(_5); - _5 = ((_1 as V2).0: i32); - _2 = _5; + _5 = copy ((_1 as V2).0: i32); + _2 = copy _5; StorageDead(_5); goto -> bb4; } bb3: { StorageLive(_4); -- _4 = ((_1 as V1).0: i32); -- _2 = _4; +- _4 = copy ((_1 as V1).0: i32); +- _2 = copy _4; + _4 = const 0_i32; + _2 = const 0_i32; StorageDead(_4); diff --git a/tests/mir-opt/dataflow-const-prop/enum.constant.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/enum.constant.DataflowConstProp.64bit.diff index 9da1caf9004e8..ef3b24cd44002 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.constant.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.constant.DataflowConstProp.64bit.diff @@ -37,16 +37,16 @@ bb2: { StorageLive(_5); - _5 = ((_1 as V2).0: i32); - _2 = _5; + _5 = copy ((_1 as V2).0: i32); + _2 = copy _5; StorageDead(_5); goto -> bb4; } bb3: { StorageLive(_4); -- _4 = ((_1 as V1).0: i32); -- _2 = _4; +- _4 = copy ((_1 as V1).0: i32); +- _2 = copy _4; + _4 = const 0_i32; + _2 = const 0_i32; StorageDead(_4); diff --git a/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.32bit.diff index 10d33767c90d9..db8352bcbcf90 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.32bit.diff @@ -28,13 +28,13 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; switchInt(move _4) -> [0: bb2, otherwise: bb1]; } bb1: { StorageLive(_5); - _5 = _2; + _5 = copy _2; _3 = Option::::Some(move _5); StorageDead(_5); goto -> bb3; @@ -63,15 +63,15 @@ bb6: { StorageLive(_8); - _8 = ((_3 as Some).0: u8); - _6 = _8; + _8 = copy ((_3 as Some).0: u8); + _6 = copy _8; StorageDead(_8); goto -> bb7; } bb7: { StorageLive(_9); - _9 = _6; + _9 = copy _6; _0 = const (); StorageDead(_9); StorageDead(_6); diff --git a/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.64bit.diff index 10d33767c90d9..db8352bcbcf90 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.64bit.diff @@ -28,13 +28,13 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; switchInt(move _4) -> [0: bb2, otherwise: bb1]; } bb1: { StorageLive(_5); - _5 = _2; + _5 = copy _2; _3 = Option::::Some(move _5); StorageDead(_5); goto -> bb3; @@ -63,15 +63,15 @@ bb6: { StorageLive(_8); - _8 = ((_3 as Some).0: u8); - _6 = _8; + _8 = copy ((_3 as Some).0: u8); + _6 = copy _8; StorageDead(_8); goto -> bb7; } bb7: { StorageLive(_9); - _9 = _6; + _9 = copy _6; _0 = const (); StorageDead(_9); StorageDead(_6); diff --git a/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.32bit.diff index 960e69ee9165e..e2cd73404bec3 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.32bit.diff @@ -10,7 +10,7 @@ discriminant(_1) = 1; (((_1 as variant#1).0: NonZeroUsize).0: usize) = const 0_usize; _2 = discriminant(_1); - switchInt(_2) -> [0: bb1, otherwise: bb2]; + switchInt(copy _2) -> [0: bb1, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.64bit.diff index 960e69ee9165e..e2cd73404bec3 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.64bit.diff @@ -10,7 +10,7 @@ discriminant(_1) = 1; (((_1 as variant#1).0: NonZeroUsize).0: usize) = const 0_usize; _2 = discriminant(_1); - switchInt(_2) -> [0: bb1, otherwise: bb2]; + switchInt(copy _2) -> [0: bb1, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.32bit.diff index a64dda0d06c48..d79c163effc13 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.32bit.diff @@ -38,16 +38,16 @@ bb2: { StorageLive(_5); - _5 = ((_1 as V2).0: i32); - _2 = _5; + _5 = copy ((_1 as V2).0: i32); + _2 = copy _5; StorageDead(_5); goto -> bb4; } bb3: { StorageLive(_4); -- _4 = ((_1 as V1).0: i32); -- _2 = _4; +- _4 = copy ((_1 as V1).0: i32); +- _2 = copy _4; + _4 = const 0_i32; + _2 = const 0_i32; StorageDead(_4); diff --git a/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.64bit.diff index a64dda0d06c48..d79c163effc13 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.64bit.diff @@ -38,16 +38,16 @@ bb2: { StorageLive(_5); - _5 = ((_1 as V2).0: i32); - _2 = _5; + _5 = copy ((_1 as V2).0: i32); + _2 = copy _5; StorageDead(_5); goto -> bb4; } bb3: { StorageLive(_4); -- _4 = ((_1 as V1).0: i32); -- _2 = _4; +- _4 = copy ((_1 as V1).0: i32); +- _2 = copy _4; + _4 = const 0_i32; + _2 = const 0_i32; StorageDead(_4); diff --git a/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.32bit.diff index b4d14f25fe2ab..9823a48785a5b 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.32bit.diff @@ -44,7 +44,7 @@ StorageLive(_1); StorageLive(_2); _2 = const {ALLOC0: &E}; -- _1 = (*_2); +- _1 = copy (*_2); + _1 = const E::V1(0_i32); StorageDead(_2); StorageLive(_3); @@ -60,16 +60,16 @@ bb2: { StorageLive(_6); - _6 = ((_1 as V2).0: i32); - _3 = _6; + _6 = copy ((_1 as V2).0: i32); + _3 = copy _6; StorageDead(_6); goto -> bb4; } bb3: { StorageLive(_5); -- _5 = ((_1 as V1).0: i32); -- _3 = _5; +- _5 = copy ((_1 as V1).0: i32); +- _3 = copy _5; + _5 = const 0_i32; + _3 = const 0_i32; StorageDead(_5); @@ -80,7 +80,7 @@ StorageLive(_7); StorageLive(_8); _8 = const {ALLOC1: &&E}; - _7 = (*_8); + _7 = copy (*_8); StorageDead(_8); StorageLive(_9); _10 = discriminant((*_7)); @@ -98,7 +98,7 @@ bb6: { StorageLive(_11); _11 = &(((*_7) as V1).0: i32); - _9 = _11; + _9 = copy _11; StorageDead(_11); goto -> bb7; } diff --git a/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.64bit.diff index 57d02b87d1369..e4e68483f2557 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.64bit.diff @@ -44,7 +44,7 @@ StorageLive(_1); StorageLive(_2); _2 = const {ALLOC0: &E}; -- _1 = (*_2); +- _1 = copy (*_2); + _1 = const E::V1(0_i32); StorageDead(_2); StorageLive(_3); @@ -60,16 +60,16 @@ bb2: { StorageLive(_6); - _6 = ((_1 as V2).0: i32); - _3 = _6; + _6 = copy ((_1 as V2).0: i32); + _3 = copy _6; StorageDead(_6); goto -> bb4; } bb3: { StorageLive(_5); -- _5 = ((_1 as V1).0: i32); -- _3 = _5; +- _5 = copy ((_1 as V1).0: i32); +- _3 = copy _5; + _5 = const 0_i32; + _3 = const 0_i32; StorageDead(_5); @@ -80,7 +80,7 @@ StorageLive(_7); StorageLive(_8); _8 = const {ALLOC1: &&E}; - _7 = (*_8); + _7 = copy (*_8); StorageDead(_8); StorageLive(_9); _10 = discriminant((*_7)); @@ -98,7 +98,7 @@ bb6: { StorageLive(_11); _11 = &(((*_7) as V1).0: i32); - _9 = _11; + _9 = copy _11; StorageDead(_11); goto -> bb7; } diff --git a/tests/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff index 355f28b03db53..5f013b1d134db 100644 --- a/tests/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff @@ -37,7 +37,7 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); -- _4 = _1; +- _4 = copy _1; - _3 = Eq(move _4, const 1_i32); - switchInt(move _3) -> [0: bb2, otherwise: bb1]; + _4 = const 1_i32; @@ -61,7 +61,7 @@ StorageDead(_3); StorageLive(_5); StorageLive(_6); -- _6 = _2; +- _6 = copy _2; - _5 = Add(move _6, const 1_i32); + _6 = const 2_i32; + _5 = const 3_i32; @@ -69,7 +69,7 @@ StorageLive(_7); StorageLive(_8); StorageLive(_9); -- _9 = _1; +- _9 = copy _1; - _8 = Eq(move _9, const 1_i32); - switchInt(move _8) -> [0: bb5, otherwise: bb4]; + _9 = const 1_i32; @@ -79,7 +79,7 @@ bb4: { StorageDead(_9); -- _7 = _1; +- _7 = copy _1; + _7 = const 1_i32; goto -> bb6; } @@ -87,7 +87,7 @@ bb5: { StorageDead(_9); StorageLive(_10); - _10 = _1; + _10 = copy _1; _7 = Add(move _10, const 1_i32); StorageDead(_10); goto -> bb6; @@ -97,7 +97,7 @@ StorageDead(_8); StorageLive(_11); StorageLive(_12); -- _12 = _7; +- _12 = copy _7; - _11 = Add(move _12, const 1_i32); + _12 = const 1_i32; + _11 = const 2_i32; diff --git a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff index 8d62de0c82152..1b695e4b53c3e 100644 --- a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff @@ -19,8 +19,8 @@ StorageLive(_3); _3 = const 1_u8; StorageLive(_4); -- _4 = AddWithOverflow(_2, _3); -- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind unreachable]; +- _4 = AddWithOverflow(copy _2, copy _3); +- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", copy _2, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const (0_u8, true); + assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> [success: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff index 25624851cb34d..a0bd8e17d8c4d 100644 --- a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff @@ -19,8 +19,8 @@ StorageLive(_3); _3 = const 1_u8; StorageLive(_4); -- _4 = AddWithOverflow(_2, _3); -- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind continue]; +- _4 = AddWithOverflow(copy _2, copy _3); +- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", copy _2, copy _3) -> [success: bb1, unwind continue]; + _4 = const (0_u8, true); + assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> [success: bb1, unwind continue]; } diff --git a/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.32bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.32bit.panic-abort.diff index 6c612d4672500..b7ff0b671f7bf 100644 --- a/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.32bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.32bit.panic-abort.diff @@ -19,16 +19,16 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const 5000_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 5000_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = _2[_3]; -+ _1 = _2[2 of 3]; +- _1 = copy _2[_3]; ++ _1 = copy _2[2 of 3]; StorageDead(_3); StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.32bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.32bit.panic-unwind.diff index 87024da2628bf..af6e3626142fc 100644 --- a/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.32bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.32bit.panic-unwind.diff @@ -19,16 +19,16 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind continue]; + _4 = const 5000_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 5000_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = _2[_3]; -+ _1 = _2[2 of 3]; +- _1 = copy _2[_3]; ++ _1 = copy _2[2 of 3]; StorageDead(_3); StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.64bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.64bit.panic-abort.diff index 6c612d4672500..b7ff0b671f7bf 100644 --- a/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.64bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.64bit.panic-abort.diff @@ -19,16 +19,16 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const 5000_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 5000_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = _2[_3]; -+ _1 = _2[2 of 3]; +- _1 = copy _2[_3]; ++ _1 = copy _2[2 of 3]; StorageDead(_3); StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.64bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.64bit.panic-unwind.diff index 87024da2628bf..af6e3626142fc 100644 --- a/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.64bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.64bit.panic-unwind.diff @@ -19,16 +19,16 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind continue]; + _4 = const 5000_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 5000_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = _2[_3]; -+ _1 = _2[2 of 3]; +- _1 = copy _2[_3]; ++ _1 = copy _2[2 of 3]; StorageDead(_3); StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/mult_by_zero.test.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/mult_by_zero.test.DataflowConstProp.diff index 91bc10a562f7a..8b05386b38ae3 100644 --- a/tests/mir-opt/dataflow-const-prop/mult_by_zero.test.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/mult_by_zero.test.DataflowConstProp.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = Mul(move _2, const 0_i32); + _0 = const 0_i32; StorageDead(_2); diff --git a/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-abort.diff index fbbfd61bbedc1..a0e83265d31c5 100644 --- a/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-abort.diff @@ -39,7 +39,7 @@ bb2: { StorageDead(_5); StorageLive(_6); - _6 = _1; + _6 = copy _1; _0 = const (); StorageDead(_6); StorageDead(_1); diff --git a/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-unwind.diff index 4e1d26acfa3fc..6dead031a9f6a 100644 --- a/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-unwind.diff @@ -39,7 +39,7 @@ bb2: { StorageDead(_5); StorageLive(_6); - _6 = _1; + _6 = copy _1; _0 = const (); StorageDead(_6); StorageDead(_1); diff --git a/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.32bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.32bit.panic-abort.diff index a18ef6c9db763..dfa541b1200d5 100644 --- a/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.32bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.32bit.panic-abort.diff @@ -21,16 +21,16 @@ StorageLive(_4); _4 = const 2_usize; - _5 = Len(_3); -- _6 = Lt(_4, _5); -- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind unreachable]; +- _6 = Lt(copy _4, copy _5); +- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, copy _4) -> [success: bb1, unwind unreachable]; + _5 = const 8_usize; + _6 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _2 = _3[_4]; -+ _2 = _3[2 of 3]; +- _2 = copy _3[_4]; ++ _2 = copy _3[2 of 3]; _1 = Add(move _2, const 0_u32); StorageDead(_2); StorageDead(_4); diff --git a/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.32bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.32bit.panic-unwind.diff index 3356ef98b14a8..9ede3c5f7ac21 100644 --- a/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.32bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.32bit.panic-unwind.diff @@ -21,16 +21,16 @@ StorageLive(_4); _4 = const 2_usize; - _5 = Len(_3); -- _6 = Lt(_4, _5); -- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind continue]; +- _6 = Lt(copy _4, copy _5); +- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, copy _4) -> [success: bb1, unwind continue]; + _5 = const 8_usize; + _6 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _2 = _3[_4]; -+ _2 = _3[2 of 3]; +- _2 = copy _3[_4]; ++ _2 = copy _3[2 of 3]; _1 = Add(move _2, const 0_u32); StorageDead(_2); StorageDead(_4); diff --git a/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.64bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.64bit.panic-abort.diff index a18ef6c9db763..dfa541b1200d5 100644 --- a/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.64bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.64bit.panic-abort.diff @@ -21,16 +21,16 @@ StorageLive(_4); _4 = const 2_usize; - _5 = Len(_3); -- _6 = Lt(_4, _5); -- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind unreachable]; +- _6 = Lt(copy _4, copy _5); +- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, copy _4) -> [success: bb1, unwind unreachable]; + _5 = const 8_usize; + _6 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _2 = _3[_4]; -+ _2 = _3[2 of 3]; +- _2 = copy _3[_4]; ++ _2 = copy _3[2 of 3]; _1 = Add(move _2, const 0_u32); StorageDead(_2); StorageDead(_4); diff --git a/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.64bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.64bit.panic-unwind.diff index 3356ef98b14a8..9ede3c5f7ac21 100644 --- a/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.64bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.64bit.panic-unwind.diff @@ -21,16 +21,16 @@ StorageLive(_4); _4 = const 2_usize; - _5 = Len(_3); -- _6 = Lt(_4, _5); -- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind continue]; +- _6 = Lt(copy _4, copy _5); +- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, copy _4) -> [success: bb1, unwind continue]; + _5 = const 8_usize; + _6 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _2 = _3[_4]; -+ _2 = _3[2 of 3]; +- _2 = copy _3[_4]; ++ _2 = copy _3[2 of 3]; _1 = Add(move _2, const 0_u32); StorageDead(_2); StorageDead(_4); diff --git a/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff index 98bd40ab2c3da..d0915432aaa63 100644 --- a/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff @@ -22,10 +22,10 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); -- _4 = (_1.0: i32); +- _4 = copy (_1.0: i32); + _4 = const 0_i32; StorageLive(_5); -- _5 = (_1.0: i32); +- _5 = copy (_1.0: i32); - _3 = Add(move _4, move _5); + _5 = const 0_i32; + _3 = const 0_i32; diff --git a/tests/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff index fbdbb3fa35caf..e54a0d64b166d 100644 --- a/tests/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff @@ -20,21 +20,21 @@ StorageLive(_1); _1 = const 0_i32; StorageLive(_2); - _2 = _1; + _2 = copy _1; _1 = Add(move _2, const 1_i32); StorageDead(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _1 = move _3; StorageDead(_3); StorageLive(_4); _4 = &_1; StorageLive(_5); - _5 = _4; + _5 = copy _4; _4 = move _5; StorageDead(_5); StorageLive(_6); - _6 = (*_4); + _6 = copy (*_4); _1 = move _6; StorageDead(_6); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff index e2468a9645d61..77762ed904132 100644 --- a/tests/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff @@ -11,8 +11,8 @@ bb0: { StorageLive(_1); _1 = const 0_i32; -- _1 = Add(_1, const 1_i32); -- _1 = Add(_1, const 1_i32); +- _1 = Add(copy _1, const 1_i32); +- _1 = Add(copy _1, const 1_i32); + _1 = const 1_i32; + _1 = const 2_i32; _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-abort.diff index a5e4099075101..178ebad6105ac 100644 --- a/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-abort.diff @@ -27,7 +27,7 @@ _3 = &raw mut (_1.0: u8); StorageLive(_4); StorageLive(_5); - _5 = _3; + _5 = copy _3; _4 = std::ptr::mut_ptr::::add(move _5, const 1_usize) -> [return: bb1, unwind unreachable]; } @@ -39,7 +39,7 @@ StorageDead(_3); StorageDead(_2); StorageLive(_6); - _6 = (_1.1: u8); + _6 = copy (_1.1: u8); _0 = const (); StorageDead(_6); StorageDead(_1); diff --git a/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-unwind.diff index ce2178ddbee61..ce2545589f183 100644 --- a/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-unwind.diff @@ -27,7 +27,7 @@ _3 = &raw mut (_1.0: u8); StorageLive(_4); StorageLive(_5); - _5 = _3; + _5 = copy _3; _4 = std::ptr::mut_ptr::::add(move _5, const 1_usize) -> [return: bb1, unwind continue]; } @@ -39,7 +39,7 @@ StorageDead(_3); StorageDead(_2); StorageLive(_6); - _6 = (_1.1: u8); + _6 = copy (_1.1: u8); _0 = const (); StorageDead(_6); StorageDead(_1); diff --git a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-abort.diff index efba4a4646cd4..40632db667a8d 100644 --- a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-abort.diff @@ -30,23 +30,23 @@ StorageLive(_3); StorageLive(_4); _14 = const main::promoted[0]; - _4 = _14; - _3 = _4; + _4 = copy _14; + _3 = copy _4; _2 = move _3 as &[u32] (PointerCoercion(Unsize)); StorageDead(_3); StorageLive(_6); _6 = const 1_usize; - _7 = Len((*_2)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind unreachable]; + _7 = const 3_usize; + _8 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = (*_2)[_6]; -+ _1 = (*_2)[1 of 2]; +- _1 = copy (*_2)[_6]; ++ _1 = copy (*_2)[1 of 2]; StorageDead(_6); StorageDead(_4); StorageDead(_2); @@ -56,16 +56,16 @@ StorageLive(_11); _11 = const 1_usize; - _12 = Len((*_10)); -- _13 = Lt(_11, _12); -- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> [success: bb2, unwind unreachable]; +- _13 = Lt(copy _11, copy _12); +- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb2, unwind unreachable]; + _12 = const 3_usize; + _13 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb2, unwind unreachable]; } bb2: { -- _9 = (*_10)[_11]; -+ _9 = (*_10)[1 of 2]; +- _9 = copy (*_10)[_11]; ++ _9 = copy (*_10)[1 of 2]; StorageDead(_11); StorageDead(_10); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-unwind.diff index bf477d7e041e9..596b4ac9b1e5b 100644 --- a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-unwind.diff @@ -30,23 +30,23 @@ StorageLive(_3); StorageLive(_4); _14 = const main::promoted[0]; - _4 = _14; - _3 = _4; + _4 = copy _14; + _3 = copy _4; _2 = move _3 as &[u32] (PointerCoercion(Unsize)); StorageDead(_3); StorageLive(_6); _6 = const 1_usize; - _7 = Len((*_2)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue]; +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind continue]; + _7 = const 3_usize; + _8 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = (*_2)[_6]; -+ _1 = (*_2)[1 of 2]; +- _1 = copy (*_2)[_6]; ++ _1 = copy (*_2)[1 of 2]; StorageDead(_6); StorageDead(_4); StorageDead(_2); @@ -56,16 +56,16 @@ StorageLive(_11); _11 = const 1_usize; - _12 = Len((*_10)); -- _13 = Lt(_11, _12); -- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> [success: bb2, unwind continue]; +- _13 = Lt(copy _11, copy _12); +- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb2, unwind continue]; + _12 = const 3_usize; + _13 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb2, unwind continue]; } bb2: { -- _9 = (*_10)[_11]; -+ _9 = (*_10)[1 of 2]; +- _9 = copy (*_10)[_11]; ++ _9 = copy (*_10)[1 of 2]; StorageDead(_11); StorageDead(_10); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-abort.diff index efba4a4646cd4..40632db667a8d 100644 --- a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-abort.diff @@ -30,23 +30,23 @@ StorageLive(_3); StorageLive(_4); _14 = const main::promoted[0]; - _4 = _14; - _3 = _4; + _4 = copy _14; + _3 = copy _4; _2 = move _3 as &[u32] (PointerCoercion(Unsize)); StorageDead(_3); StorageLive(_6); _6 = const 1_usize; - _7 = Len((*_2)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind unreachable]; + _7 = const 3_usize; + _8 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = (*_2)[_6]; -+ _1 = (*_2)[1 of 2]; +- _1 = copy (*_2)[_6]; ++ _1 = copy (*_2)[1 of 2]; StorageDead(_6); StorageDead(_4); StorageDead(_2); @@ -56,16 +56,16 @@ StorageLive(_11); _11 = const 1_usize; - _12 = Len((*_10)); -- _13 = Lt(_11, _12); -- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> [success: bb2, unwind unreachable]; +- _13 = Lt(copy _11, copy _12); +- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb2, unwind unreachable]; + _12 = const 3_usize; + _13 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb2, unwind unreachable]; } bb2: { -- _9 = (*_10)[_11]; -+ _9 = (*_10)[1 of 2]; +- _9 = copy (*_10)[_11]; ++ _9 = copy (*_10)[1 of 2]; StorageDead(_11); StorageDead(_10); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-unwind.diff index bf477d7e041e9..596b4ac9b1e5b 100644 --- a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-unwind.diff @@ -30,23 +30,23 @@ StorageLive(_3); StorageLive(_4); _14 = const main::promoted[0]; - _4 = _14; - _3 = _4; + _4 = copy _14; + _3 = copy _4; _2 = move _3 as &[u32] (PointerCoercion(Unsize)); StorageDead(_3); StorageLive(_6); _6 = const 1_usize; - _7 = Len((*_2)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue]; +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind continue]; + _7 = const 3_usize; + _8 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = (*_2)[_6]; -+ _1 = (*_2)[1 of 2]; +- _1 = copy (*_2)[_6]; ++ _1 = copy (*_2)[1 of 2]; StorageDead(_6); StorageDead(_4); StorageDead(_2); @@ -56,16 +56,16 @@ StorageLive(_11); _11 = const 1_usize; - _12 = Len((*_10)); -- _13 = Lt(_11, _12); -- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> [success: bb2, unwind continue]; +- _13 = Lt(copy _11, copy _12); +- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb2, unwind continue]; + _12 = const 3_usize; + _13 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb2, unwind continue]; } bb2: { -- _9 = (*_10)[_11]; -+ _9 = (*_10)[1 of 2]; +- _9 = copy (*_10)[_11]; ++ _9 = copy (*_10)[1 of 2]; StorageDead(_11); StorageDead(_10); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.32bit.diff index 5e89382ea8f46..3ea49265cee33 100644 --- a/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.32bit.diff @@ -83,7 +83,7 @@ + _1 = const S(1_i32); StorageLive(_2); StorageLive(_3); -- _3 = (_1.0: i32); +- _3 = copy (_1.0: i32); - _2 = Add(move _3, const 2_i32); + _3 = const 1_i32; + _2 = const 3_i32; @@ -91,10 +91,10 @@ (_1.0: i32) = const 3_i32; StorageLive(_4); StorageLive(_5); -- _5 = _2; +- _5 = copy _2; + _5 = const 3_i32; StorageLive(_6); -- _6 = (_1.0: i32); +- _6 = copy (_1.0: i32); - _4 = Add(move _5, move _6); + _6 = const 3_i32; + _4 = const 6_i32; @@ -103,35 +103,35 @@ StorageLive(_10); _10 = const main::SMALL_VAL; StorageLive(_7); -- _7 = (_10.0: f32); +- _7 = copy (_10.0: f32); + _7 = const 4f32; StorageLive(_8); - _8 = (_10.1: std::option::Option); + _8 = copy (_10.1: std::option::Option); StorageLive(_9); - _9 = (_10.2: &[f32]); + _9 = copy (_10.2: &[f32]); StorageDead(_10); StorageLive(_14); _14 = const {ALLOC0: &&SmallStruct}; _31 = deref_copy (*_14); StorageLive(_11); _32 = deref_copy (*_14); -- _11 = ((*_32).0: f32); +- _11 = copy ((*_32).0: f32); + _11 = const 9f32; StorageLive(_12); _33 = deref_copy (*_14); - _12 = ((*_33).1: std::option::Option); + _12 = copy ((*_33).1: std::option::Option); StorageLive(_13); _34 = deref_copy (*_14); - _13 = ((*_34).2: &[f32]); + _13 = copy ((*_34).2: &[f32]); StorageDead(_14); StorageLive(_15); StorageLive(_16); -- _16 = _11; +- _16 = copy _11; + _16 = const 9f32; StorageLive(_17); - _17 = _12; + _17 = copy _12; StorageLive(_18); - _18 = _13; + _18 = copy _13; - _15 = SmallStruct(move _16, move _17, move _18); + _15 = SmallStruct(const 9f32, move _17, move _18); StorageDead(_18); @@ -140,35 +140,35 @@ StorageLive(_22); _22 = const main::BIG_VAL; StorageLive(_19); -- _19 = (_22.0: f32); +- _19 = copy (_22.0: f32); + _19 = const 25f32; StorageLive(_20); - _20 = (_22.1: std::option::Option); + _20 = copy (_22.1: std::option::Option); StorageLive(_21); - _21 = (_22.2: &[f32]); + _21 = copy (_22.2: &[f32]); StorageDead(_22); StorageLive(_26); _26 = const {ALLOC1: &&BigStruct}; _35 = deref_copy (*_26); StorageLive(_23); _36 = deref_copy (*_26); -- _23 = ((*_36).0: f32); +- _23 = copy ((*_36).0: f32); + _23 = const 82f32; StorageLive(_24); _37 = deref_copy (*_26); - _24 = ((*_37).1: std::option::Option); + _24 = copy ((*_37).1: std::option::Option); StorageLive(_25); _38 = deref_copy (*_26); - _25 = ((*_38).2: &[f32]); + _25 = copy ((*_38).2: &[f32]); StorageDead(_26); StorageLive(_27); StorageLive(_28); -- _28 = _23; +- _28 = copy _23; + _28 = const 82f32; StorageLive(_29); - _29 = _24; + _29 = copy _24; StorageLive(_30); - _30 = _25; + _30 = copy _25; - _27 = BigStruct(move _28, move _29, move _30); + _27 = BigStruct(const 82f32, move _29, move _30); StorageDead(_30); diff --git a/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.64bit.diff index a707d7e5e76e4..78a0944975c86 100644 --- a/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.64bit.diff @@ -83,7 +83,7 @@ + _1 = const S(1_i32); StorageLive(_2); StorageLive(_3); -- _3 = (_1.0: i32); +- _3 = copy (_1.0: i32); - _2 = Add(move _3, const 2_i32); + _3 = const 1_i32; + _2 = const 3_i32; @@ -91,10 +91,10 @@ (_1.0: i32) = const 3_i32; StorageLive(_4); StorageLive(_5); -- _5 = _2; +- _5 = copy _2; + _5 = const 3_i32; StorageLive(_6); -- _6 = (_1.0: i32); +- _6 = copy (_1.0: i32); - _4 = Add(move _5, move _6); + _6 = const 3_i32; + _4 = const 6_i32; @@ -103,35 +103,35 @@ StorageLive(_10); _10 = const main::SMALL_VAL; StorageLive(_7); -- _7 = (_10.0: f32); +- _7 = copy (_10.0: f32); + _7 = const 4f32; StorageLive(_8); - _8 = (_10.1: std::option::Option); + _8 = copy (_10.1: std::option::Option); StorageLive(_9); - _9 = (_10.2: &[f32]); + _9 = copy (_10.2: &[f32]); StorageDead(_10); StorageLive(_14); _14 = const {ALLOC0: &&SmallStruct}; _31 = deref_copy (*_14); StorageLive(_11); _32 = deref_copy (*_14); -- _11 = ((*_32).0: f32); +- _11 = copy ((*_32).0: f32); + _11 = const 9f32; StorageLive(_12); _33 = deref_copy (*_14); - _12 = ((*_33).1: std::option::Option); + _12 = copy ((*_33).1: std::option::Option); StorageLive(_13); _34 = deref_copy (*_14); - _13 = ((*_34).2: &[f32]); + _13 = copy ((*_34).2: &[f32]); StorageDead(_14); StorageLive(_15); StorageLive(_16); -- _16 = _11; +- _16 = copy _11; + _16 = const 9f32; StorageLive(_17); - _17 = _12; + _17 = copy _12; StorageLive(_18); - _18 = _13; + _18 = copy _13; - _15 = SmallStruct(move _16, move _17, move _18); + _15 = SmallStruct(const 9f32, move _17, move _18); StorageDead(_18); @@ -140,35 +140,35 @@ StorageLive(_22); _22 = const main::BIG_VAL; StorageLive(_19); -- _19 = (_22.0: f32); +- _19 = copy (_22.0: f32); + _19 = const 25f32; StorageLive(_20); - _20 = (_22.1: std::option::Option); + _20 = copy (_22.1: std::option::Option); StorageLive(_21); - _21 = (_22.2: &[f32]); + _21 = copy (_22.2: &[f32]); StorageDead(_22); StorageLive(_26); _26 = const {ALLOC1: &&BigStruct}; _35 = deref_copy (*_26); StorageLive(_23); _36 = deref_copy (*_26); -- _23 = ((*_36).0: f32); +- _23 = copy ((*_36).0: f32); + _23 = const 82f32; StorageLive(_24); _37 = deref_copy (*_26); - _24 = ((*_37).1: std::option::Option); + _24 = copy ((*_37).1: std::option::Option); StorageLive(_25); _38 = deref_copy (*_26); - _25 = ((*_38).2: &[f32]); + _25 = copy ((*_38).2: &[f32]); StorageDead(_26); StorageLive(_27); StorageLive(_28); -- _28 = _23; +- _28 = copy _23; + _28 = const 82f32; StorageLive(_29); - _29 = _24; + _29 = copy _24; StorageLive(_30); - _30 = _25; + _30 = copy _25; - _27 = BigStruct(move _28, move _29, move _30); + _27 = BigStruct(const 82f32, move _29, move _30); StorageDead(_30); diff --git a/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-abort.diff index c0f378cc21f88..e13b2aa9f7e36 100644 --- a/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-abort.diff @@ -17,7 +17,7 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); -- _4 = _1; +- _4 = copy _1; - _3 = Add(move _4, const 1_i32); + _4 = const 1_i32; + _3 = const 2_i32; diff --git a/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-unwind.diff index 395620fec524a..4be25fdcc38d7 100644 --- a/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-unwind.diff @@ -17,7 +17,7 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); -- _4 = _1; +- _4 = copy _1; - _3 = Add(move _4, const 1_i32); + _4 = const 1_i32; + _3 = const 2_i32; diff --git a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.32bit.diff index 258e2b454ebe2..2d67ac92209b3 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.32bit.diff @@ -13,7 +13,7 @@ StorageLive(_1); - _1 = const 1_usize as std::boxed::Box (Transmute); + _1 = const Box::(Unique:: {{ pointer: NonNull:: {{ pointer: {0x1 as *const Never} }}, _marker: PhantomData:: }}, std::alloc::Global); - _2 = (((_1.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const Never); + _2 = copy (((_1.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const Never); unreachable; } } diff --git a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.64bit.diff index 258e2b454ebe2..2d67ac92209b3 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.64bit.diff @@ -13,7 +13,7 @@ StorageLive(_1); - _1 = const 1_usize as std::boxed::Box (Transmute); + _1 = const Box::(Unique:: {{ pointer: NonNull:: {{ pointer: {0x1 as *const Never} }}, _marker: PhantomData:: }}, std::alloc::Global); - _2 = (((_1.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const Never); + _2 = copy (((_1.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const Never); unreachable; } } diff --git a/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.32bit.diff index e4031b65caafe..f7846823e196c 100644 --- a/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.32bit.diff @@ -37,10 +37,10 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); -- _4 = (_1.0: i32); +- _4 = copy (_1.0: i32); + _4 = const 1_i32; StorageLive(_5); -- _5 = (_1.1: i32); +- _5 = copy (_1.1: i32); - _3 = Add(move _4, move _5); + _5 = const 2_i32; + _3 = const 3_i32; @@ -54,17 +54,17 @@ StorageLive(_6); StorageLive(_7); StorageLive(_8); -- _8 = (_1.0: i32); +- _8 = copy (_1.0: i32); + _8 = const 2_i32; StorageLive(_9); -- _9 = (_1.1: i32); +- _9 = copy (_1.1: i32); - _7 = Add(move _8, move _9); + _9 = const 3_i32; + _7 = const 5_i32; StorageDead(_9); StorageDead(_8); StorageLive(_10); -- _10 = _2; +- _10 = copy _2; - _6 = Add(move _7, move _10); + _10 = const 6_i32; + _6 = const 11_i32; @@ -72,13 +72,13 @@ StorageDead(_7); StorageLive(_11); StorageLive(_12); -- _12 = _2; +- _12 = copy _2; + _12 = const 6_i32; StorageLive(_13); -- _13 = _1; +- _13 = copy _1; + _13 = const (2_i32, 3_i32); StorageLive(_14); -- _14 = _6; +- _14 = copy _6; - _11 = (move _12, move _13, move _14); + _14 = const 11_i32; + _11 = (const 6_i32, const (2_i32, 3_i32), const 11_i32); diff --git a/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.64bit.diff index e4031b65caafe..f7846823e196c 100644 --- a/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.64bit.diff @@ -37,10 +37,10 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); -- _4 = (_1.0: i32); +- _4 = copy (_1.0: i32); + _4 = const 1_i32; StorageLive(_5); -- _5 = (_1.1: i32); +- _5 = copy (_1.1: i32); - _3 = Add(move _4, move _5); + _5 = const 2_i32; + _3 = const 3_i32; @@ -54,17 +54,17 @@ StorageLive(_6); StorageLive(_7); StorageLive(_8); -- _8 = (_1.0: i32); +- _8 = copy (_1.0: i32); + _8 = const 2_i32; StorageLive(_9); -- _9 = (_1.1: i32); +- _9 = copy (_1.1: i32); - _7 = Add(move _8, move _9); + _9 = const 3_i32; + _7 = const 5_i32; StorageDead(_9); StorageDead(_8); StorageLive(_10); -- _10 = _2; +- _10 = copy _2; - _6 = Add(move _7, move _10); + _10 = const 6_i32; + _6 = const 11_i32; @@ -72,13 +72,13 @@ StorageDead(_7); StorageLive(_11); StorageLive(_12); -- _12 = _2; +- _12 = copy _2; + _12 = const 6_i32; StorageLive(_13); -- _13 = _1; +- _13 = copy _1; + _13 = const (2_i32, 3_i32); StorageLive(_14); -- _14 = _6; +- _14 = copy _6; - _11 = (move _12, move _13, move _14); + _14 = const 11_i32; + _11 = (const 6_i32, const (2_i32, 3_i32), const 11_i32); diff --git a/tests/mir-opt/dead-store-elimination/call_arg_copy.move_packed.DeadStoreElimination-final.panic-abort.diff b/tests/mir-opt/dead-store-elimination/call_arg_copy.move_packed.DeadStoreElimination-final.panic-abort.diff index 07fb8301b9a94..80b727dd1a451 100644 --- a/tests/mir-opt/dead-store-elimination/call_arg_copy.move_packed.DeadStoreElimination-final.panic-abort.diff +++ b/tests/mir-opt/dead-store-elimination/call_arg_copy.move_packed.DeadStoreElimination-final.panic-abort.diff @@ -5,7 +5,7 @@ let mut _0: (); bb0: { - _0 = use_both(const 0_i32, (_1.1: i32)) -> [return: bb1, unwind unreachable]; + _0 = use_both(const 0_i32, copy (_1.1: i32)) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/dead-store-elimination/call_arg_copy.move_packed.DeadStoreElimination-final.panic-unwind.diff b/tests/mir-opt/dead-store-elimination/call_arg_copy.move_packed.DeadStoreElimination-final.panic-unwind.diff index cac3badfa6732..c7aff795bd8c5 100644 --- a/tests/mir-opt/dead-store-elimination/call_arg_copy.move_packed.DeadStoreElimination-final.panic-unwind.diff +++ b/tests/mir-opt/dead-store-elimination/call_arg_copy.move_packed.DeadStoreElimination-final.panic-unwind.diff @@ -5,7 +5,7 @@ let mut _0: (); bb0: { - _0 = use_both(const 0_i32, (_1.1: i32)) -> [return: bb1, unwind continue]; + _0 = use_both(const 0_i32, copy (_1.1: i32)) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/dead-store-elimination/call_arg_copy.move_simple.DeadStoreElimination-final.panic-abort.diff b/tests/mir-opt/dead-store-elimination/call_arg_copy.move_simple.DeadStoreElimination-final.panic-abort.diff index f9bc9405d6a4b..a09ef3e4f34a9 100644 --- a/tests/mir-opt/dead-store-elimination/call_arg_copy.move_simple.DeadStoreElimination-final.panic-abort.diff +++ b/tests/mir-opt/dead-store-elimination/call_arg_copy.move_simple.DeadStoreElimination-final.panic-abort.diff @@ -10,8 +10,8 @@ bb0: { StorageLive(_2); -- _2 = use_both(_1, _1) -> [return: bb1, unwind unreachable]; -+ _2 = use_both(_1, move _1) -> [return: bb1, unwind unreachable]; +- _2 = use_both(copy _1, copy _1) -> [return: bb1, unwind unreachable]; ++ _2 = use_both(copy _1, move _1) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/dead-store-elimination/call_arg_copy.move_simple.DeadStoreElimination-final.panic-unwind.diff b/tests/mir-opt/dead-store-elimination/call_arg_copy.move_simple.DeadStoreElimination-final.panic-unwind.diff index efe165422d943..09413c99fefb1 100644 --- a/tests/mir-opt/dead-store-elimination/call_arg_copy.move_simple.DeadStoreElimination-final.panic-unwind.diff +++ b/tests/mir-opt/dead-store-elimination/call_arg_copy.move_simple.DeadStoreElimination-final.panic-unwind.diff @@ -10,8 +10,8 @@ bb0: { StorageLive(_2); -- _2 = use_both(_1, _1) -> [return: bb1, unwind continue]; -+ _2 = use_both(_1, move _1) -> [return: bb1, unwind continue]; +- _2 = use_both(copy _1, copy _1) -> [return: bb1, unwind continue]; ++ _2 = use_both(copy _1, move _1) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination-initial.diff b/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination-initial.diff index 2766b6ce6a9fa..ff18df1efcfc9 100644 --- a/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination-initial.diff +++ b/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination-initial.diff @@ -11,14 +11,14 @@ } bb1: { - switchInt(_4) -> [1: bb2, otherwise: bb3]; + switchInt(copy _4) -> [1: bb2, otherwise: bb3]; } bb2: { -- _5 = _3; -- _3 = _2; -- _2 = _1; -- _1 = _5; +- _5 = copy _3; +- _3 = copy _2; +- _2 = copy _1; +- _1 = copy _5; + nop; + nop; + nop; diff --git a/tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination-initial.diff b/tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination-initial.diff index 56d5c24ae1dc4..5d054e2ea16f4 100644 --- a/tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination-initial.diff +++ b/tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination-initial.diff @@ -18,12 +18,12 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = move _3 as usize (PointerExposeProvenance); StorageDead(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; _4 = move _5 as isize (PointerExposeProvenance); StorageDead(_5); _0 = const (); diff --git a/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-abort.diff b/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-abort.diff index efb28ba344b2b..60742ef0e9a90 100644 --- a/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-abort.diff +++ b/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-abort.diff @@ -37,40 +37,40 @@ } bb3: { - switchInt((*_2)[0 of 4]) -> [47: bb4, otherwise: bb2]; + switchInt(copy (*_2)[0 of 4]) -> [47: bb4, otherwise: bb2]; } bb4: { - switchInt((*_2)[1 of 4]) -> [47: bb5, otherwise: bb2]; + switchInt(copy (*_2)[1 of 4]) -> [47: bb5, otherwise: bb2]; } bb5: { - switchInt((*_2)[2 of 4]) -> [47: bb6, otherwise: bb2]; + switchInt(copy (*_2)[2 of 4]) -> [47: bb6, otherwise: bb2]; } bb6: { -- switchInt((*_2)[3 of 4]) -> [47: bb13, otherwise: bb2]; -+ switchInt((*_2)[3 of 4]) -> [47: bb11, otherwise: bb2]; +- switchInt(copy (*_2)[3 of 4]) -> [47: bb13, otherwise: bb2]; ++ switchInt(copy (*_2)[3 of 4]) -> [47: bb11, otherwise: bb2]; } bb7: { - _0 = const false; - goto -> bb14; -+ switchInt((*_2)[0 of 3]) -> [47: bb8, otherwise: bb11]; ++ switchInt(copy (*_2)[0 of 3]) -> [47: bb8, otherwise: bb11]; } bb8: { -- switchInt((*_2)[0 of 3]) -> [47: bb9, otherwise: bb7]; -+ switchInt((*_2)[1 of 3]) -> [47: bb9, otherwise: bb11]; +- switchInt(copy (*_2)[0 of 3]) -> [47: bb9, otherwise: bb7]; ++ switchInt(copy (*_2)[1 of 3]) -> [47: bb9, otherwise: bb11]; } bb9: { -- switchInt((*_2)[1 of 3]) -> [47: bb10, otherwise: bb7]; -+ switchInt((*_2)[2 of 3]) -> [47: bb10, 33: bb10, otherwise: bb11]; +- switchInt(copy (*_2)[1 of 3]) -> [47: bb10, otherwise: bb7]; ++ switchInt(copy (*_2)[2 of 3]) -> [47: bb10, 33: bb10, otherwise: bb11]; } bb10: { -- switchInt((*_2)[2 of 3]) -> [47: bb12, 33: bb11, otherwise: bb7]; +- switchInt(copy (*_2)[2 of 3]) -> [47: bb12, 33: bb11, otherwise: bb7]; - } - - bb11: { diff --git a/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-unwind.diff b/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-unwind.diff index c6e2d3a551259..7337a32f525f9 100644 --- a/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-unwind.diff +++ b/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-unwind.diff @@ -37,40 +37,40 @@ } bb3: { - switchInt((*_2)[0 of 4]) -> [47: bb4, otherwise: bb2]; + switchInt(copy (*_2)[0 of 4]) -> [47: bb4, otherwise: bb2]; } bb4: { - switchInt((*_2)[1 of 4]) -> [47: bb5, otherwise: bb2]; + switchInt(copy (*_2)[1 of 4]) -> [47: bb5, otherwise: bb2]; } bb5: { - switchInt((*_2)[2 of 4]) -> [47: bb6, otherwise: bb2]; + switchInt(copy (*_2)[2 of 4]) -> [47: bb6, otherwise: bb2]; } bb6: { -- switchInt((*_2)[3 of 4]) -> [47: bb13, otherwise: bb2]; -+ switchInt((*_2)[3 of 4]) -> [47: bb11, otherwise: bb2]; +- switchInt(copy (*_2)[3 of 4]) -> [47: bb13, otherwise: bb2]; ++ switchInt(copy (*_2)[3 of 4]) -> [47: bb11, otherwise: bb2]; } bb7: { - _0 = const false; - goto -> bb14; -+ switchInt((*_2)[0 of 3]) -> [47: bb8, otherwise: bb11]; ++ switchInt(copy (*_2)[0 of 3]) -> [47: bb8, otherwise: bb11]; } bb8: { -- switchInt((*_2)[0 of 3]) -> [47: bb9, otherwise: bb7]; -+ switchInt((*_2)[1 of 3]) -> [47: bb9, otherwise: bb11]; +- switchInt(copy (*_2)[0 of 3]) -> [47: bb9, otherwise: bb7]; ++ switchInt(copy (*_2)[1 of 3]) -> [47: bb9, otherwise: bb11]; } bb9: { -- switchInt((*_2)[1 of 3]) -> [47: bb10, otherwise: bb7]; -+ switchInt((*_2)[2 of 3]) -> [47: bb10, 33: bb10, otherwise: bb11]; +- switchInt(copy (*_2)[1 of 3]) -> [47: bb10, otherwise: bb7]; ++ switchInt(copy (*_2)[2 of 3]) -> [47: bb10, 33: bb10, otherwise: bb11]; } bb10: { -- switchInt((*_2)[2 of 3]) -> [47: bb12, 33: bb11, otherwise: bb7]; +- switchInt(copy (*_2)[2 of 3]) -> [47: bb12, 33: bb11, otherwise: bb7]; - } - - bb11: { diff --git a/tests/mir-opt/derefer_complex_case.main.Derefer.panic-abort.diff b/tests/mir-opt/derefer_complex_case.main.Derefer.panic-abort.diff index 4ead50e96d8b1..bac62c886688d 100644 --- a/tests/mir-opt/derefer_complex_case.main.Derefer.panic-abort.diff +++ b/tests/mir-opt/derefer_complex_case.main.Derefer.panic-abort.diff @@ -64,11 +64,11 @@ bb5: { StorageLive(_12); -- _12 = (*((_7 as Some).0: &i32)); +- _12 = copy (*((_7 as Some).0: &i32)); + _15 = deref_copy ((_7 as Some).0: &i32); -+ _12 = (*_15); ++ _12 = copy (*_15); StorageLive(_13); - _13 = _12; + _13 = copy _12; _6 = std::mem::drop::(move _13) -> [return: bb7, unwind: bb8]; } diff --git a/tests/mir-opt/derefer_complex_case.main.Derefer.panic-unwind.diff b/tests/mir-opt/derefer_complex_case.main.Derefer.panic-unwind.diff index c7cf5f02e0ea7..55cd2e427eea9 100644 --- a/tests/mir-opt/derefer_complex_case.main.Derefer.panic-unwind.diff +++ b/tests/mir-opt/derefer_complex_case.main.Derefer.panic-unwind.diff @@ -64,11 +64,11 @@ bb5: { StorageLive(_12); -- _12 = (*((_7 as Some).0: &i32)); +- _12 = copy (*((_7 as Some).0: &i32)); + _15 = deref_copy ((_7 as Some).0: &i32); -+ _12 = (*_15); ++ _12 = copy (*_15); StorageLive(_13); - _13 = _12; + _13 = copy _12; _6 = std::mem::drop::(move _13) -> [return: bb7, unwind continue]; } diff --git a/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-abort.diff b/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-abort.diff index f4c034517f7e7..012d2eb8b72c5 100644 --- a/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-abort.diff +++ b/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-abort.diff @@ -52,7 +52,7 @@ _5 = &_6; _4 = &_5; - PlaceMention((*(*(*(*_4))))); -- switchInt((*(*(*(*_4))))) -> [0: bb3, otherwise: bb4]; +- switchInt(copy (*(*(*(*_4))))) -> [0: bb3, otherwise: bb4]; + _10 = deref_copy (*_4); + _11 = deref_copy (*_10); + _12 = deref_copy (*_11); @@ -60,7 +60,7 @@ + _13 = deref_copy (*_4); + _14 = deref_copy (*_13); + _15 = deref_copy (*_14); -+ switchInt((*_15)) -> [0: bb3, otherwise: bb4]; ++ switchInt(copy (*_15)) -> [0: bb3, otherwise: bb4]; } bb3: { diff --git a/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-unwind.diff b/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-unwind.diff index e3c0c6b7dd271..43cee2923352c 100644 --- a/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-unwind.diff +++ b/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-unwind.diff @@ -52,7 +52,7 @@ _5 = &_6; _4 = &_5; - PlaceMention((*(*(*(*_4))))); -- switchInt((*(*(*(*_4))))) -> [0: bb3, otherwise: bb4]; +- switchInt(copy (*(*(*(*_4))))) -> [0: bb3, otherwise: bb4]; + _10 = deref_copy (*_4); + _11 = deref_copy (*_10); + _12 = deref_copy (*_11); @@ -60,7 +60,7 @@ + _13 = deref_copy (*_4); + _14 = deref_copy (*_13); + _15 = deref_copy (*_14); -+ switchInt((*_15)) -> [0: bb3, otherwise: bb4]; ++ switchInt(copy (*_15)) -> [0: bb3, otherwise: bb4]; } bb3: { diff --git a/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-abort.diff index 10ec3aa555ee1..775d51ea49f34 100644 --- a/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-abort.diff +++ b/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-abort.diff @@ -35,7 +35,7 @@ } bb3: { -- _2 = _1; +- _2 = copy _1; + nop; goto -> bb6; } @@ -47,14 +47,14 @@ bb5: { StorageDead(_4); -- _2 = _1; +- _2 = copy _1; + nop; goto -> bb6; } bb6: { StorageDead(_3); -- _0 = _2; +- _0 = copy _2; - StorageDead(_2); - StorageDead(_1); + nop; diff --git a/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-unwind.diff index 759c1cabf45e7..875ef8829d083 100644 --- a/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-unwind.diff +++ b/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-unwind.diff @@ -35,7 +35,7 @@ } bb3: { -- _2 = _1; +- _2 = copy _1; + nop; goto -> bb6; } @@ -47,14 +47,14 @@ bb5: { StorageDead(_4); -- _2 = _1; +- _2 = copy _1; + nop; goto -> bb6; } bb6: { StorageDead(_3); -- _0 = _2; +- _0 = copy _2; - StorageDead(_2); - StorageDead(_1); + nop; diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-abort.diff index 1aed07f9e6ab1..a4908c05e2e11 100644 --- a/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-abort.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-abort.diff @@ -12,11 +12,11 @@ bb0: { - StorageLive(_2); -- _2 = _1; +- _2 = copy _1; + nop; -+ _0 = _1; ++ _0 = copy _1; _1 = const 123_i32; -- _0 = _2; +- _0 = copy _2; - StorageDead(_2); + nop; + nop; diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-unwind.diff index 1aed07f9e6ab1..a4908c05e2e11 100644 --- a/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-unwind.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-unwind.diff @@ -12,11 +12,11 @@ bb0: { - StorageLive(_2); -- _2 = _1; +- _2 = copy _1; + nop; -+ _0 = _1; ++ _0 = copy _1; _1 = const 123_i32; -- _0 = _2; +- _0 = copy _2; - StorageDead(_2); + nop; + nop; diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-abort.diff index 641dea594e119..24f2b464e2cb8 100644 --- a/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-abort.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-abort.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); - StorageLive(_3); -- _3 = _1; +- _3 = copy _1; - _2 = dummy(move _3) -> [return: bb1, unwind unreachable]; + nop; + nop; diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-unwind.diff index 8b2835c8ced2a..d42ac52b6319a 100644 --- a/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-unwind.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-unwind.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); - StorageLive(_3); -- _3 = _1; +- _3 = copy _1; - _2 = dummy(move _3) -> [return: bb1, unwind continue]; + nop; + nop; diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-abort.diff index 4cddaec01d2d3..f1f1714b472ec 100644 --- a/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-abort.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-abort.diff @@ -8,14 +8,14 @@ bb0: { - StorageLive(_2); -- _2 = _1; +- _2 = copy _1; - _1 = move _2; - StorageDead(_2); + nop; + nop; + nop; + nop; - _0 = _1; + _0 = copy _1; return; } } diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-unwind.diff index 4cddaec01d2d3..f1f1714b472ec 100644 --- a/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-unwind.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-unwind.diff @@ -8,14 +8,14 @@ bb0: { - StorageLive(_2); -- _2 = _1; +- _2 = copy _1; - _1 = move _2; - StorageDead(_2); + nop; + nop; + nop; + nop; - _0 = _1; + _0 = copy _1; return; } } diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-abort.diff index b461869be3189..0328fc6b745b2 100644 --- a/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-abort.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-abort.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); - StorageLive(_3); -- _3 = _1; +- _3 = copy _1; - _2 = dummy(move _3) -> [return: bb1, unwind unreachable]; + nop; + nop; diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-unwind.diff index d5c2e07c6c234..30e2248db8205 100644 --- a/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-unwind.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-unwind.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); - StorageLive(_3); -- _3 = _1; +- _3 = copy _1; - _2 = dummy(move _3) -> [return: bb1, unwind continue]; + nop; + nop; diff --git a/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-abort.diff index 98b4ee866d2b6..5d8aaedae3742 100644 --- a/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-abort.diff +++ b/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-abort.diff @@ -31,11 +31,11 @@ bb1: { - StorageLive(_2); -- _2 = _1; +- _2 = copy _1; - StorageLive(_3); -- _3 = _2; +- _3 = copy _2; - StorageLive(_4); -- _4 = _3; +- _4 = copy _3; - _1 = move _4; - StorageDead(_4); + nop; @@ -48,7 +48,7 @@ + nop; StorageLive(_5); - StorageLive(_6); -- _6 = _1; +- _6 = copy _1; + nop; + nop; _5 = std::mem::drop::(move _6) -> [return: bb2, unwind unreachable]; diff --git a/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-unwind.diff index 6f6e01d37b1a6..05c9bcc1d7371 100644 --- a/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-unwind.diff +++ b/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-unwind.diff @@ -31,11 +31,11 @@ bb1: { - StorageLive(_2); -- _2 = _1; +- _2 = copy _1; - StorageLive(_3); -- _3 = _2; +- _3 = copy _2; - StorageLive(_4); -- _4 = _3; +- _4 = copy _3; - _1 = move _4; - StorageDead(_4); + nop; @@ -48,7 +48,7 @@ + nop; StorageLive(_5); - StorageLive(_6); -- _6 = _1; +- _6 = copy _1; + nop; + nop; _5 = std::mem::drop::(move _6) -> [return: bb2, unwind continue]; diff --git a/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-abort.mir b/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-abort.mir index eb160fc194a81..eb4209731c62f 100644 --- a/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-abort.mir +++ b/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-abort.mir @@ -12,7 +12,7 @@ fn f(_1: usize) -> usize { bb0: { nop; - _3 = _1; + _3 = copy _1; _1 = const 5_usize; nop; nop; diff --git a/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-unwind.mir b/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-unwind.mir index 9147de2ec473b..fe9a7376a5856 100644 --- a/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-unwind.mir +++ b/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-unwind.mir @@ -12,7 +12,7 @@ fn f(_1: usize) -> usize { bb0: { nop; - _3 = _1; + _3 = copy _1; _1 = const 5_usize; nop; nop; diff --git a/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-abort.mir b/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-abort.mir index eb160fc194a81..eb4209731c62f 100644 --- a/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-abort.mir +++ b/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-abort.mir @@ -12,7 +12,7 @@ fn f(_1: usize) -> usize { bb0: { nop; - _3 = _1; + _3 = copy _1; _1 = const 5_usize; nop; nop; diff --git a/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-unwind.mir b/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-unwind.mir index 9147de2ec473b..fe9a7376a5856 100644 --- a/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-unwind.mir +++ b/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-unwind.mir @@ -12,7 +12,7 @@ fn f(_1: usize) -> usize { bb0: { nop; - _3 = _1; + _3 = copy _1; _1 = const 5_usize; nop; nop; diff --git a/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-abort.diff index 4d34f43fd5ce6..e9fbcf20a7228 100644 --- a/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-abort.diff +++ b/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-abort.diff @@ -18,7 +18,7 @@ _2 = [const 0_u8; 1024]; StorageLive(_3); - StorageLive(_4); -- _4 = _1; +- _4 = copy _1; + nop; + nop; StorageLive(_5); @@ -35,7 +35,7 @@ + nop; StorageDead(_6); StorageDead(_3); - _0 = _2; + _0 = copy _2; StorageDead(_2); return; } diff --git a/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-unwind.diff index 9c3cbef38d698..95d5fe1b9304b 100644 --- a/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-unwind.diff +++ b/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-unwind.diff @@ -18,7 +18,7 @@ _2 = [const 0_u8; 1024]; StorageLive(_3); - StorageLive(_4); -- _4 = _1; +- _4 = copy _1; + nop; + nop; StorageLive(_5); @@ -35,7 +35,7 @@ + nop; StorageDead(_6); StorageDead(_3); - _0 = _2; + _0 = copy _2; StorageDead(_2); return; } diff --git a/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff index b596e25ddfdff..557320f017984 100644 --- a/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff +++ b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff @@ -22,7 +22,7 @@ _1 = Un { us: const 1_u32 }; StorageDead(_2); StorageLive(_3); - _3 = (_1.0: u32); + _3 = copy (_1.0: u32); StorageDead(_3); StorageDead(_1); return; diff --git a/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff index b596e25ddfdff..557320f017984 100644 --- a/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff +++ b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff @@ -22,7 +22,7 @@ _1 = Un { us: const 1_u32 }; StorageDead(_2); StorageLive(_3); - _3 = (_1.0: u32); + _3 = copy (_1.0: u32); StorageDead(_3); StorageDead(_1); return; diff --git a/tests/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff index 4af3ed3e1d1ba..51c41996678c8 100644 --- a/tests/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff @@ -20,9 +20,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; _3 = (move _4, move _5); StorageDead(_5); StorageDead(_4); @@ -42,9 +42,9 @@ bb3: { StorageLive(_8); - _8 = (((_3.0: std::option::Option) as Some).0: u32); + _8 = copy (((_3.0: std::option::Option) as Some).0: u32); StorageLive(_9); - _9 = (((_3.1: std::option::Option) as Some).0: u32); + _9 = copy (((_3.1: std::option::Option) as Some).0: u32); _0 = const 0_u32; StorageDead(_9); StorageDead(_8); diff --git a/tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff index 41ae2fd3af3f4..f17ebee9416fe 100644 --- a/tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff @@ -21,9 +21,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; _3 = (move _4, move _5); StorageDead(_5); StorageDead(_4); @@ -53,9 +53,9 @@ bb5: { StorageLive(_9); - _9 = (((_3.0: std::option::Option) as Some).0: u32); + _9 = copy (((_3.0: std::option::Option) as Some).0: u32); StorageLive(_10); - _10 = (((_3.1: std::option::Option) as Some).0: u32); + _10 = copy (((_3.1: std::option::Option) as Some).0: u32); _0 = const 0_u32; StorageDead(_10); StorageDead(_9); diff --git a/tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff index 302fd0bfded4b..7b94a4c2bf737 100644 --- a/tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff @@ -35,7 +35,7 @@ + StorageLive(_12); + _12 = discriminant((_3.1: Option2)); + StorageLive(_13); -+ _13 = Ne(_9, move _12); ++ _13 = Ne(copy _9, move _12); + StorageDead(_12); + switchInt(move _13) -> [0: bb7, otherwise: bb1]; } @@ -78,9 +78,9 @@ - bb7: { + bb4: { StorageLive(_10); - _10 = (((_3.0: Option2) as Some).0: u32); + _10 = copy (((_3.0: Option2) as Some).0: u32); StorageLive(_11); - _11 = (((_3.1: Option2) as Some).0: bool); + _11 = copy (((_3.1: Option2) as Some).0: bool); _0 = const 0_u32; StorageDead(_11); StorageDead(_10); @@ -101,7 +101,7 @@ + + bb7: { + StorageDead(_13); -+ switchInt(_9) -> [0: bb4, 1: bb3, 2: bb2, otherwise: bb6]; ++ switchInt(copy _9) -> [0: bb4, 1: bb3, 2: bb2, otherwise: bb6]; } } diff --git a/tests/mir-opt/early_otherwise_branch.opt4.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch.opt4.EarlyOtherwiseBranch.diff index eef4fb3278c1c..f52795baef81b 100644 --- a/tests/mir-opt/early_otherwise_branch.opt4.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch.opt4.EarlyOtherwiseBranch.diff @@ -35,7 +35,7 @@ + StorageLive(_12); + _12 = discriminant((_3.1: Option2)); + StorageLive(_13); -+ _13 = Ne(_9, move _12); ++ _13 = Ne(copy _9, move _12); + StorageDead(_12); + switchInt(move _13) -> [0: bb7, otherwise: bb1]; } @@ -78,9 +78,9 @@ - bb7: { + bb4: { StorageLive(_10); - _10 = (((_3.0: Option2) as Some).0: u32); + _10 = copy (((_3.0: Option2) as Some).0: u32); StorageLive(_11); - _11 = (((_3.1: Option2) as Some).0: u32); + _11 = copy (((_3.1: Option2) as Some).0: u32); _0 = const 0_u32; StorageDead(_11); StorageDead(_10); @@ -101,7 +101,7 @@ + + bb7: { + StorageDead(_13); -+ switchInt(_9) -> [0: bb4, 1: bb3, 2: bb2, otherwise: bb6]; ++ switchInt(copy _9) -> [0: bb4, 1: bb3, 2: bb2, otherwise: bb6]; } } diff --git a/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff index cb03e2697ccd3..98df9934af05d 100644 --- a/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff @@ -27,11 +27,11 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; StorageLive(_6); - _6 = _2; + _6 = copy _2; StorageLive(_7); - _7 = _3; + _7 = copy _3; _4 = (move _5, move _6, move _7); StorageDead(_7); StorageDead(_6); @@ -72,11 +72,11 @@ bb7: { StorageLive(_13); - _13 = (((_4.0: std::option::Option) as Some).0: u32); + _13 = copy (((_4.0: std::option::Option) as Some).0: u32); StorageLive(_14); - _14 = (((_4.1: std::option::Option) as Some).0: u32); + _14 = copy (((_4.1: std::option::Option) as Some).0: u32); StorageLive(_15); - _15 = (((_4.2: std::option::Option) as Some).0: u32); + _15 = copy (((_4.2: std::option::Option) as Some).0: u32); _0 = const 0_u32; StorageDead(_15); StorageDead(_14); diff --git a/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt2.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt2.EarlyOtherwiseBranch.diff index 5634df253a5d0..831d8cbb4d60b 100644 --- a/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt2.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt2.EarlyOtherwiseBranch.diff @@ -45,7 +45,7 @@ + StorageLive(_18); + _18 = discriminant((_4.1: Option2)); + StorageLive(_19); -+ _19 = Ne(_14, move _18); ++ _19 = Ne(copy _14, move _18); + StorageDead(_18); + switchInt(move _19) -> [0: bb10, otherwise: bb1]; } @@ -109,11 +109,11 @@ - bb10: { + bb7: { StorageLive(_15); - _15 = (((_4.0: Option2) as Some).0: u32); + _15 = copy (((_4.0: Option2) as Some).0: u32); StorageLive(_16); - _16 = (((_4.1: Option2) as Some).0: u32); + _16 = copy (((_4.1: Option2) as Some).0: u32); StorageLive(_17); - _17 = (((_4.2: Option2) as Some).0: u32); + _17 = copy (((_4.2: Option2) as Some).0: u32); _0 = const 0_u32; StorageDead(_17); StorageDead(_16); @@ -135,7 +135,7 @@ + + bb10: { + StorageDead(_19); -+ switchInt(_14) -> [0: bb2, 1: bb3, 2: bb4, otherwise: bb9]; ++ switchInt(copy _14) -> [0: bb2, 1: bb3, 2: bb4, otherwise: bb9]; } } diff --git a/tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff index 8179d9dd11505..fec318c1ab492 100644 --- a/tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff @@ -70,9 +70,9 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; StorageLive(_6); - _6 = _2; + _6 = copy _2; _4 = (move _5, move _6); StorageDead(_6); StorageDead(_5); @@ -118,15 +118,15 @@ bb6: { StorageLive(_27); _39 = deref_copy (_4.0: &ViewportPercentageLength); - _27 = (((*_39) as Vmax).0: f32); + _27 = copy (((*_39) as Vmax).0: f32); StorageLive(_28); _40 = deref_copy (_4.1: &ViewportPercentageLength); - _28 = (((*_40) as Vmax).0: f32); + _28 = copy (((*_40) as Vmax).0: f32); StorageLive(_29); StorageLive(_30); - _30 = _27; + _30 = copy _27; StorageLive(_31); - _31 = _28; + _31 = copy _28; _29 = Add(move _30, move _31); StorageDead(_31); StorageDead(_30); @@ -140,15 +140,15 @@ bb7: { StorageLive(_22); _41 = deref_copy (_4.0: &ViewportPercentageLength); - _22 = (((*_41) as Vmin).0: f32); + _22 = copy (((*_41) as Vmin).0: f32); StorageLive(_23); _42 = deref_copy (_4.1: &ViewportPercentageLength); - _23 = (((*_42) as Vmin).0: f32); + _23 = copy (((*_42) as Vmin).0: f32); StorageLive(_24); StorageLive(_25); - _25 = _22; + _25 = copy _22; StorageLive(_26); - _26 = _23; + _26 = copy _23; _24 = Add(move _25, move _26); StorageDead(_26); StorageDead(_25); @@ -162,15 +162,15 @@ bb8: { StorageLive(_17); _43 = deref_copy (_4.0: &ViewportPercentageLength); - _17 = (((*_43) as Vh).0: f32); + _17 = copy (((*_43) as Vh).0: f32); StorageLive(_18); _44 = deref_copy (_4.1: &ViewportPercentageLength); - _18 = (((*_44) as Vh).0: f32); + _18 = copy (((*_44) as Vh).0: f32); StorageLive(_19); StorageLive(_20); - _20 = _17; + _20 = copy _17; StorageLive(_21); - _21 = _18; + _21 = copy _18; _19 = Add(move _20, move _21); StorageDead(_21); StorageDead(_20); @@ -184,15 +184,15 @@ bb9: { StorageLive(_12); _45 = deref_copy (_4.0: &ViewportPercentageLength); - _12 = (((*_45) as Vw).0: f32); + _12 = copy (((*_45) as Vw).0: f32); StorageLive(_13); _46 = deref_copy (_4.1: &ViewportPercentageLength); - _13 = (((*_46) as Vw).0: f32); + _13 = copy (((*_46) as Vw).0: f32); StorageLive(_14); StorageLive(_15); - _15 = _12; + _15 = copy _12; StorageLive(_16); - _16 = _13; + _16 = copy _13; _14 = Add(move _15, move _16); StorageDead(_16); StorageDead(_15); diff --git a/tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff index 651b1de4ddd37..8ed2274a72beb 100644 --- a/tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff @@ -29,9 +29,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; _3 = (move _4, move _5); StorageDead(_5); StorageDead(_4); @@ -60,7 +60,7 @@ bb5: { StorageLive(_12); - _12 = (((_3.1: std::option::Option) as Some).0: u32); + _12 = copy (((_3.1: std::option::Option) as Some).0: u32); _0 = const 2_u32; StorageDead(_12); goto -> bb8; @@ -68,7 +68,7 @@ bb6: { StorageLive(_11); - _11 = (((_3.0: std::option::Option) as Some).0: u32); + _11 = copy (((_3.0: std::option::Option) as Some).0: u32); _0 = const 1_u32; StorageDead(_11); goto -> bb8; @@ -76,9 +76,9 @@ bb7: { StorageLive(_9); - _9 = (((_3.0: std::option::Option) as Some).0: u32); + _9 = copy (((_3.0: std::option::Option) as Some).0: u32); StorageLive(_10); - _10 = (((_3.1: std::option::Option) as Some).0: u32); + _10 = copy (((_3.1: std::option::Option) as Some).0: u32); _0 = const 0_u32; StorageDead(_10); StorageDead(_9); diff --git a/tests/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff index 8eab59823f4b9..eeb8b766b5d13 100644 --- a/tests/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff @@ -34,8 +34,8 @@ bb4: { StorageLive(_5); - _5 = (((*_2) as Some).0: i32); - _0 = _5; + _5 = copy (((*_2) as Some).0: i32); + _0 = copy _5; StorageDead(_5); goto -> bb5; } diff --git a/tests/mir-opt/enum_opt.cand.EnumSizeOpt.32bit.diff b/tests/mir-opt/enum_opt.cand.EnumSizeOpt.32bit.diff index 085c55caaa03c..727efe4b0d95d 100644 --- a/tests/mir-opt/enum_opt.cand.EnumSizeOpt.32bit.diff +++ b/tests/mir-opt/enum_opt.cand.EnumSizeOpt.32bit.diff @@ -38,28 +38,28 @@ + StorageLive(_4); + _4 = const [2_usize, 8197_usize]; + _5 = discriminant(_2); -+ _6 = _5 as usize (IntToInt); -+ _7 = _4[_6]; ++ _6 = copy _5 as usize (IntToInt); ++ _7 = copy _4[_6]; + _8 = &raw mut _1; -+ _9 = _8 as *mut u8 (PtrToPtr); ++ _9 = copy _8 as *mut u8 (PtrToPtr); + _10 = &raw const _2; -+ _11 = _10 as *const u8 (PtrToPtr); ++ _11 = copy _10 as *const u8 (PtrToPtr); + Deinit(_8); -+ copy_nonoverlapping(dst = _9, src = _11, count = _7); ++ copy_nonoverlapping(dst = copy _9, src = copy _11, count = copy _7); + StorageDead(_4); StorageDead(_2); - _0 = move _1; + StorageLive(_12); + _12 = const [2_usize, 8197_usize]; + _13 = discriminant(_1); -+ _14 = _13 as usize (IntToInt); -+ _15 = _12[_14]; ++ _14 = copy _13 as usize (IntToInt); ++ _15 = copy _12[_14]; + _16 = &raw mut _0; -+ _17 = _16 as *mut u8 (PtrToPtr); ++ _17 = copy _16 as *mut u8 (PtrToPtr); + _18 = &raw const _1; -+ _19 = _18 as *const u8 (PtrToPtr); ++ _19 = copy _18 as *const u8 (PtrToPtr); + Deinit(_16); -+ copy_nonoverlapping(dst = _17, src = _19, count = _15); ++ copy_nonoverlapping(dst = copy _17, src = copy _19, count = copy _15); + StorageDead(_12); StorageDead(_1); return; diff --git a/tests/mir-opt/enum_opt.cand.EnumSizeOpt.64bit.diff b/tests/mir-opt/enum_opt.cand.EnumSizeOpt.64bit.diff index 798b7c10fe8d5..8d0cd97f78661 100644 --- a/tests/mir-opt/enum_opt.cand.EnumSizeOpt.64bit.diff +++ b/tests/mir-opt/enum_opt.cand.EnumSizeOpt.64bit.diff @@ -38,28 +38,28 @@ + StorageLive(_4); + _4 = const [2_usize, 8197_usize]; + _5 = discriminant(_2); -+ _6 = _5 as usize (IntToInt); -+ _7 = _4[_6]; ++ _6 = copy _5 as usize (IntToInt); ++ _7 = copy _4[_6]; + _8 = &raw mut _1; -+ _9 = _8 as *mut u8 (PtrToPtr); ++ _9 = copy _8 as *mut u8 (PtrToPtr); + _10 = &raw const _2; -+ _11 = _10 as *const u8 (PtrToPtr); ++ _11 = copy _10 as *const u8 (PtrToPtr); + Deinit(_8); -+ copy_nonoverlapping(dst = _9, src = _11, count = _7); ++ copy_nonoverlapping(dst = copy _9, src = copy _11, count = copy _7); + StorageDead(_4); StorageDead(_2); - _0 = move _1; + StorageLive(_12); + _12 = const [2_usize, 8197_usize]; + _13 = discriminant(_1); -+ _14 = _13 as usize (IntToInt); -+ _15 = _12[_14]; ++ _14 = copy _13 as usize (IntToInt); ++ _15 = copy _12[_14]; + _16 = &raw mut _0; -+ _17 = _16 as *mut u8 (PtrToPtr); ++ _17 = copy _16 as *mut u8 (PtrToPtr); + _18 = &raw const _1; -+ _19 = _18 as *const u8 (PtrToPtr); ++ _19 = copy _18 as *const u8 (PtrToPtr); + Deinit(_16); -+ copy_nonoverlapping(dst = _17, src = _19, count = _15); ++ copy_nonoverlapping(dst = copy _17, src = copy _19, count = copy _15); + StorageDead(_12); StorageDead(_1); return; diff --git a/tests/mir-opt/enum_opt.unin.EnumSizeOpt.32bit.diff b/tests/mir-opt/enum_opt.unin.EnumSizeOpt.32bit.diff index a04829af4b532..6d1e2a72fdb73 100644 --- a/tests/mir-opt/enum_opt.unin.EnumSizeOpt.32bit.diff +++ b/tests/mir-opt/enum_opt.unin.EnumSizeOpt.32bit.diff @@ -38,28 +38,28 @@ + StorageLive(_4); + _4 = const [8197_usize, 1_usize]; + _5 = discriminant(_2); -+ _6 = _5 as usize (IntToInt); -+ _7 = _4[_6]; ++ _6 = copy _5 as usize (IntToInt); ++ _7 = copy _4[_6]; + _8 = &raw mut _1; -+ _9 = _8 as *mut u8 (PtrToPtr); ++ _9 = copy _8 as *mut u8 (PtrToPtr); + _10 = &raw const _2; -+ _11 = _10 as *const u8 (PtrToPtr); ++ _11 = copy _10 as *const u8 (PtrToPtr); + Deinit(_8); -+ copy_nonoverlapping(dst = _9, src = _11, count = _7); ++ copy_nonoverlapping(dst = copy _9, src = copy _11, count = copy _7); + StorageDead(_4); StorageDead(_2); - _0 = move _1; + StorageLive(_12); + _12 = const [8197_usize, 1_usize]; + _13 = discriminant(_1); -+ _14 = _13 as usize (IntToInt); -+ _15 = _12[_14]; ++ _14 = copy _13 as usize (IntToInt); ++ _15 = copy _12[_14]; + _16 = &raw mut _0; -+ _17 = _16 as *mut u8 (PtrToPtr); ++ _17 = copy _16 as *mut u8 (PtrToPtr); + _18 = &raw const _1; -+ _19 = _18 as *const u8 (PtrToPtr); ++ _19 = copy _18 as *const u8 (PtrToPtr); + Deinit(_16); -+ copy_nonoverlapping(dst = _17, src = _19, count = _15); ++ copy_nonoverlapping(dst = copy _17, src = copy _19, count = copy _15); + StorageDead(_12); StorageDead(_1); return; diff --git a/tests/mir-opt/enum_opt.unin.EnumSizeOpt.64bit.diff b/tests/mir-opt/enum_opt.unin.EnumSizeOpt.64bit.diff index f5521a1e22a47..4b1406d0d623b 100644 --- a/tests/mir-opt/enum_opt.unin.EnumSizeOpt.64bit.diff +++ b/tests/mir-opt/enum_opt.unin.EnumSizeOpt.64bit.diff @@ -38,28 +38,28 @@ + StorageLive(_4); + _4 = const [8197_usize, 1_usize]; + _5 = discriminant(_2); -+ _6 = _5 as usize (IntToInt); -+ _7 = _4[_6]; ++ _6 = copy _5 as usize (IntToInt); ++ _7 = copy _4[_6]; + _8 = &raw mut _1; -+ _9 = _8 as *mut u8 (PtrToPtr); ++ _9 = copy _8 as *mut u8 (PtrToPtr); + _10 = &raw const _2; -+ _11 = _10 as *const u8 (PtrToPtr); ++ _11 = copy _10 as *const u8 (PtrToPtr); + Deinit(_8); -+ copy_nonoverlapping(dst = _9, src = _11, count = _7); ++ copy_nonoverlapping(dst = copy _9, src = copy _11, count = copy _7); + StorageDead(_4); StorageDead(_2); - _0 = move _1; + StorageLive(_12); + _12 = const [8197_usize, 1_usize]; + _13 = discriminant(_1); -+ _14 = _13 as usize (IntToInt); -+ _15 = _12[_14]; ++ _14 = copy _13 as usize (IntToInt); ++ _15 = copy _12[_14]; + _16 = &raw mut _0; -+ _17 = _16 as *mut u8 (PtrToPtr); ++ _17 = copy _16 as *mut u8 (PtrToPtr); + _18 = &raw const _1; -+ _19 = _18 as *const u8 (PtrToPtr); ++ _19 = copy _18 as *const u8 (PtrToPtr); + Deinit(_16); -+ copy_nonoverlapping(dst = _17, src = _19, count = _15); ++ copy_nonoverlapping(dst = copy _17, src = copy _19, count = copy _15); + StorageDead(_12); StorageDead(_1); return; diff --git a/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff b/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff index 8a701641ff9ab..ed72ca7262959 100644 --- a/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff +++ b/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff @@ -42,13 +42,13 @@ StorageLive(_4); StorageLive(_20); StorageLive(_21); - _21 = ((*_1).0: u32); + _21 = copy ((*_1).0: u32); _20 = BitAnd(move _21, const 1_u32); StorageDead(_21); _4 = Ne(move _20, const 0_u32); StorageDead(_20); StorageLive(_5); - switchInt(_4) -> [0: bb2, otherwise: bb1]; + switchInt(copy _4) -> [0: bb2, otherwise: bb1]; } bb1: { @@ -65,7 +65,7 @@ bb3: { StorageLive(_6); - _6 = ((*_1).4: std::option::Option); + _6 = copy ((*_1).4: std::option::Option); _7 = discriminant(_6); switchInt(move _7) -> [1: bb4, 0: bb6, otherwise: bb9]; } @@ -73,26 +73,26 @@ bb4: { - StorageLive(_8); + nop; - _8 = ((_6 as Some).0: usize); + _8 = copy ((_6 as Some).0: usize); StorageLive(_9); - _9 = _1; + _9 = copy _1; StorageLive(_10); - _10 = _2; + _10 = copy _2; StorageLive(_11); - _11 = _5; + _11 = copy _5; StorageLive(_12); StorageLive(_13); StorageLive(_14); - _14 = _8; + _14 = copy _8; - _13 = move _14 as u32 (IntToInt); -+ _13 = _8 as u32 (IntToInt); ++ _13 = copy _8 as u32 (IntToInt); StorageDead(_14); _12 = Add(move _13, const 1_u32); StorageDead(_13); StorageLive(_15); - _15 = _3; + _15 = copy _3; - _0 = float_to_exponential_common_exact::(move _9, move _10, move _11, move _12, move _15) -> [return: bb5, unwind unreachable]; -+ _0 = float_to_exponential_common_exact::(_1, _2, move _11, move _12, _3) -> [return: bb5, unwind unreachable]; ++ _0 = float_to_exponential_common_exact::(copy _1, copy _2, move _11, move _12, copy _3) -> [return: bb5, unwind unreachable]; } bb5: { @@ -108,15 +108,15 @@ bb6: { StorageLive(_16); - _16 = _1; + _16 = copy _1; StorageLive(_17); - _17 = _2; + _17 = copy _2; StorageLive(_18); - _18 = _5; + _18 = copy _5; StorageLive(_19); - _19 = _3; + _19 = copy _3; - _0 = float_to_exponential_common_shortest::(move _16, move _17, move _18, move _19) -> [return: bb7, unwind unreachable]; -+ _0 = float_to_exponential_common_shortest::(_1, _2, move _18, _3) -> [return: bb7, unwind unreachable]; ++ _0 = float_to_exponential_common_shortest::(copy _1, copy _2, move _18, copy _3) -> [return: bb7, unwind unreachable]; } bb7: { diff --git a/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-unwind.diff b/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-unwind.diff index 5e65700ee4aae..42d9988374959 100644 --- a/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-unwind.diff +++ b/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-unwind.diff @@ -42,13 +42,13 @@ StorageLive(_4); StorageLive(_20); StorageLive(_21); - _21 = ((*_1).0: u32); + _21 = copy ((*_1).0: u32); _20 = BitAnd(move _21, const 1_u32); StorageDead(_21); _4 = Ne(move _20, const 0_u32); StorageDead(_20); StorageLive(_5); - switchInt(_4) -> [0: bb2, otherwise: bb1]; + switchInt(copy _4) -> [0: bb2, otherwise: bb1]; } bb1: { @@ -65,7 +65,7 @@ bb3: { StorageLive(_6); - _6 = ((*_1).4: std::option::Option); + _6 = copy ((*_1).4: std::option::Option); _7 = discriminant(_6); switchInt(move _7) -> [1: bb4, 0: bb6, otherwise: bb9]; } @@ -73,26 +73,26 @@ bb4: { - StorageLive(_8); + nop; - _8 = ((_6 as Some).0: usize); + _8 = copy ((_6 as Some).0: usize); StorageLive(_9); - _9 = _1; + _9 = copy _1; StorageLive(_10); - _10 = _2; + _10 = copy _2; StorageLive(_11); - _11 = _5; + _11 = copy _5; StorageLive(_12); StorageLive(_13); StorageLive(_14); - _14 = _8; + _14 = copy _8; - _13 = move _14 as u32 (IntToInt); -+ _13 = _8 as u32 (IntToInt); ++ _13 = copy _8 as u32 (IntToInt); StorageDead(_14); _12 = Add(move _13, const 1_u32); StorageDead(_13); StorageLive(_15); - _15 = _3; + _15 = copy _3; - _0 = float_to_exponential_common_exact::(move _9, move _10, move _11, move _12, move _15) -> [return: bb5, unwind continue]; -+ _0 = float_to_exponential_common_exact::(_1, _2, move _11, move _12, _3) -> [return: bb5, unwind continue]; ++ _0 = float_to_exponential_common_exact::(copy _1, copy _2, move _11, move _12, copy _3) -> [return: bb5, unwind continue]; } bb5: { @@ -108,15 +108,15 @@ bb6: { StorageLive(_16); - _16 = _1; + _16 = copy _1; StorageLive(_17); - _17 = _2; + _17 = copy _2; StorageLive(_18); - _18 = _5; + _18 = copy _5; StorageLive(_19); - _19 = _3; + _19 = copy _3; - _0 = float_to_exponential_common_shortest::(move _16, move _17, move _18, move _19) -> [return: bb7, unwind continue]; -+ _0 = float_to_exponential_common_shortest::(_1, _2, move _18, _3) -> [return: bb7, unwind continue]; ++ _0 = float_to_exponential_common_shortest::(copy _1, copy _2, move _18, copy _3) -> [return: bb7, unwind continue]; } bb7: { diff --git a/tests/mir-opt/gvn.arithmetic.GVN.panic-abort.diff b/tests/mir-opt/gvn.arithmetic.GVN.panic-abort.diff index cb87d9020150a..f980645b1d092 100644 --- a/tests/mir-opt/gvn.arithmetic.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.arithmetic.GVN.panic-abort.diff @@ -82,12 +82,12 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; - _3 = Add(move _4, const 0_u64); -+ _3 = _1; ++ _3 = copy _1; StorageDead(_4); - _2 = opaque::(move _3) -> [return: bb1, unwind unreachable]; -+ _2 = opaque::(_1) -> [return: bb1, unwind unreachable]; ++ _2 = opaque::(copy _1) -> [return: bb1, unwind unreachable]; } bb1: { @@ -96,12 +96,12 @@ StorageLive(_5); StorageLive(_6); StorageLive(_7); - _7 = _1; + _7 = copy _1; - _6 = Sub(move _7, const 0_u64); -+ _6 = _1; ++ _6 = copy _1; StorageDead(_7); - _5 = opaque::(move _6) -> [return: bb2, unwind unreachable]; -+ _5 = opaque::(_1) -> [return: bb2, unwind unreachable]; ++ _5 = opaque::(copy _1) -> [return: bb2, unwind unreachable]; } bb2: { @@ -111,9 +111,9 @@ - StorageLive(_9); + nop; StorageLive(_10); - _10 = _1; + _10 = copy _1; StorageLive(_11); - _11 = _1; + _11 = copy _1; - _9 = Sub(move _10, move _11); + _9 = const 0_u64; StorageDead(_11); @@ -129,7 +129,7 @@ StorageLive(_12); StorageLive(_13); StorageLive(_14); - _14 = _1; + _14 = copy _1; - _13 = Mul(move _14, const 0_u64); + _13 = const 0_u64; StorageDead(_14); @@ -143,12 +143,12 @@ StorageLive(_15); StorageLive(_16); StorageLive(_17); - _17 = _1; + _17 = copy _1; - _16 = Mul(move _17, const 1_u64); -+ _16 = _1; ++ _16 = copy _1; StorageDead(_17); - _15 = opaque::(move _16) -> [return: bb5, unwind unreachable]; -+ _15 = opaque::(_1) -> [return: bb5, unwind unreachable]; ++ _15 = opaque::(copy _1) -> [return: bb5, unwind unreachable]; } bb5: { @@ -157,16 +157,16 @@ StorageLive(_18); StorageLive(_19); StorageLive(_20); - _20 = _1; + _20 = copy _1; - _21 = Eq(const 0_u64, const 0_u64); -- assert(!move _21, "attempt to divide `{}` by zero", _20) -> [success: bb6, unwind unreachable]; +- assert(!move _21, "attempt to divide `{}` by zero", copy _20) -> [success: bb6, unwind unreachable]; + _21 = const true; -+ assert(!const true, "attempt to divide `{}` by zero", _1) -> [success: bb6, unwind unreachable]; ++ assert(!const true, "attempt to divide `{}` by zero", copy _1) -> [success: bb6, unwind unreachable]; } bb6: { - _19 = Div(move _20, const 0_u64); -+ _19 = Div(_1, const 0_u64); ++ _19 = Div(copy _1, const 0_u64); StorageDead(_20); _18 = opaque::(move _19) -> [return: bb7, unwind unreachable]; } @@ -177,19 +177,19 @@ StorageLive(_22); StorageLive(_23); StorageLive(_24); - _24 = _1; + _24 = copy _1; - _25 = Eq(const 1_u64, const 0_u64); -- assert(!move _25, "attempt to divide `{}` by zero", _24) -> [success: bb8, unwind unreachable]; +- assert(!move _25, "attempt to divide `{}` by zero", copy _24) -> [success: bb8, unwind unreachable]; + _25 = const false; -+ assert(!const false, "attempt to divide `{}` by zero", _1) -> [success: bb8, unwind unreachable]; ++ assert(!const false, "attempt to divide `{}` by zero", copy _1) -> [success: bb8, unwind unreachable]; } bb8: { - _23 = Div(move _24, const 1_u64); -+ _23 = _1; ++ _23 = copy _1; StorageDead(_24); - _22 = opaque::(move _23) -> [return: bb9, unwind unreachable]; -+ _22 = opaque::(_1) -> [return: bb9, unwind unreachable]; ++ _22 = opaque::(copy _1) -> [return: bb9, unwind unreachable]; } bb9: { @@ -198,11 +198,11 @@ StorageLive(_26); StorageLive(_27); StorageLive(_28); - _28 = _1; -- _29 = Eq(_28, const 0_u64); + _28 = copy _1; +- _29 = Eq(copy _28, const 0_u64); - assert(!move _29, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb10, unwind unreachable]; -+ _29 = Eq(_1, const 0_u64); -+ assert(!_29, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb10, unwind unreachable]; ++ _29 = Eq(copy _1, const 0_u64); ++ assert(!copy _29, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb10, unwind unreachable]; } bb10: { @@ -219,16 +219,16 @@ StorageLive(_30); StorageLive(_31); StorageLive(_32); - _32 = _1; -- _33 = Eq(_32, const 0_u64); + _32 = copy _1; +- _33 = Eq(copy _32, const 0_u64); - assert(!move _33, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb12, unwind unreachable]; -+ _33 = _29; -+ assert(!_29, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb12, unwind unreachable]; ++ _33 = copy _29; ++ assert(!copy _29, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb12, unwind unreachable]; } bb12: { - _31 = Div(const 1_u64, move _32); -+ _31 = Div(const 1_u64, _1); ++ _31 = Div(const 1_u64, copy _1); StorageDead(_32); _30 = opaque::(move _31) -> [return: bb13, unwind unreachable]; } @@ -239,16 +239,16 @@ StorageLive(_34); StorageLive(_35); StorageLive(_36); - _36 = _1; + _36 = copy _1; - _37 = Eq(const 0_u64, const 0_u64); -- assert(!move _37, "attempt to calculate the remainder of `{}` with a divisor of zero", _36) -> [success: bb14, unwind unreachable]; +- assert(!move _37, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _36) -> [success: bb14, unwind unreachable]; + _37 = const true; -+ assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb14, unwind unreachable]; ++ assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _1) -> [success: bb14, unwind unreachable]; } bb14: { - _35 = Rem(move _36, const 0_u64); -+ _35 = Rem(_1, const 0_u64); ++ _35 = Rem(copy _1, const 0_u64); StorageDead(_36); _34 = opaque::(move _35) -> [return: bb15, unwind unreachable]; } @@ -259,11 +259,11 @@ StorageLive(_38); StorageLive(_39); StorageLive(_40); - _40 = _1; + _40 = copy _1; - _41 = Eq(const 1_u64, const 0_u64); -- assert(!move _41, "attempt to calculate the remainder of `{}` with a divisor of zero", _40) -> [success: bb16, unwind unreachable]; +- assert(!move _41, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _40) -> [success: bb16, unwind unreachable]; + _41 = const false; -+ assert(!const false, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb16, unwind unreachable]; ++ assert(!const false, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _1) -> [success: bb16, unwind unreachable]; } bb16: { @@ -280,11 +280,11 @@ StorageLive(_42); StorageLive(_43); StorageLive(_44); - _44 = _1; -- _45 = Eq(_44, const 0_u64); + _44 = copy _1; +- _45 = Eq(copy _44, const 0_u64); - assert(!move _45, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb18, unwind unreachable]; -+ _45 = _29; -+ assert(!_29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb18, unwind unreachable]; ++ _45 = copy _29; ++ assert(!copy _29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb18, unwind unreachable]; } bb18: { @@ -301,16 +301,16 @@ StorageLive(_46); StorageLive(_47); StorageLive(_48); - _48 = _1; -- _49 = Eq(_48, const 0_u64); + _48 = copy _1; +- _49 = Eq(copy _48, const 0_u64); - assert(!move _49, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb20, unwind unreachable]; -+ _49 = _29; -+ assert(!_29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb20, unwind unreachable]; ++ _49 = copy _29; ++ assert(!copy _29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb20, unwind unreachable]; } bb20: { - _47 = Rem(const 1_u64, move _48); -+ _47 = Rem(const 1_u64, _1); ++ _47 = Rem(const 1_u64, copy _1); StorageDead(_48); _46 = opaque::(move _47) -> [return: bb21, unwind unreachable]; } @@ -321,7 +321,7 @@ StorageLive(_50); StorageLive(_51); StorageLive(_52); - _52 = _1; + _52 = copy _1; - _51 = BitAnd(move _52, const 0_u64); + _51 = const 0_u64; StorageDead(_52); @@ -335,12 +335,12 @@ StorageLive(_53); StorageLive(_54); StorageLive(_55); - _55 = _1; + _55 = copy _1; - _54 = BitAnd(move _55, const core::num::::MAX); -+ _54 = _1; ++ _54 = copy _1; StorageDead(_55); - _53 = opaque::(move _54) -> [return: bb23, unwind unreachable]; -+ _53 = opaque::(_1) -> [return: bb23, unwind unreachable]; ++ _53 = opaque::(copy _1) -> [return: bb23, unwind unreachable]; } bb23: { @@ -349,12 +349,12 @@ StorageLive(_56); StorageLive(_57); StorageLive(_58); - _58 = _1; + _58 = copy _1; - _57 = BitOr(move _58, const 0_u64); -+ _57 = _1; ++ _57 = copy _1; StorageDead(_58); - _56 = opaque::(move _57) -> [return: bb24, unwind unreachable]; -+ _56 = opaque::(_1) -> [return: bb24, unwind unreachable]; ++ _56 = opaque::(copy _1) -> [return: bb24, unwind unreachable]; } bb24: { @@ -363,7 +363,7 @@ StorageLive(_59); StorageLive(_60); StorageLive(_61); - _61 = _1; + _61 = copy _1; - _60 = BitOr(move _61, const core::num::::MAX); + _60 = const u64::MAX; StorageDead(_61); @@ -377,12 +377,12 @@ StorageLive(_62); StorageLive(_63); StorageLive(_64); - _64 = _1; + _64 = copy _1; - _63 = BitXor(move _64, const 0_u64); -+ _63 = _1; ++ _63 = copy _1; StorageDead(_64); - _62 = opaque::(move _63) -> [return: bb26, unwind unreachable]; -+ _62 = opaque::(_1) -> [return: bb26, unwind unreachable]; ++ _62 = opaque::(copy _1) -> [return: bb26, unwind unreachable]; } bb26: { @@ -391,9 +391,9 @@ StorageLive(_65); StorageLive(_66); StorageLive(_67); - _67 = _1; + _67 = copy _1; StorageLive(_68); - _68 = _1; + _68 = copy _1; - _66 = BitXor(move _67, move _68); + _66 = const 0_u64; StorageDead(_68); @@ -408,12 +408,12 @@ StorageLive(_69); StorageLive(_70); StorageLive(_71); - _71 = _1; + _71 = copy _1; - _70 = Shr(move _71, const 0_i32); -+ _70 = _1; ++ _70 = copy _1; StorageDead(_71); - _69 = opaque::(move _70) -> [return: bb28, unwind unreachable]; -+ _69 = opaque::(_1) -> [return: bb28, unwind unreachable]; ++ _69 = opaque::(copy _1) -> [return: bb28, unwind unreachable]; } bb28: { @@ -422,12 +422,12 @@ StorageLive(_72); StorageLive(_73); StorageLive(_74); - _74 = _1; + _74 = copy _1; - _73 = Shl(move _74, const 0_i32); -+ _73 = _1; ++ _73 = copy _1; StorageDead(_74); - _72 = opaque::(move _73) -> [return: bb29, unwind unreachable]; -+ _72 = opaque::(_1) -> [return: bb29, unwind unreachable]; ++ _72 = opaque::(copy _1) -> [return: bb29, unwind unreachable]; } bb29: { diff --git a/tests/mir-opt/gvn.arithmetic.GVN.panic-unwind.diff b/tests/mir-opt/gvn.arithmetic.GVN.panic-unwind.diff index fa7536efc8e6c..b8e4967fe8b18 100644 --- a/tests/mir-opt/gvn.arithmetic.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.arithmetic.GVN.panic-unwind.diff @@ -82,12 +82,12 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; - _3 = Add(move _4, const 0_u64); -+ _3 = _1; ++ _3 = copy _1; StorageDead(_4); - _2 = opaque::(move _3) -> [return: bb1, unwind continue]; -+ _2 = opaque::(_1) -> [return: bb1, unwind continue]; ++ _2 = opaque::(copy _1) -> [return: bb1, unwind continue]; } bb1: { @@ -96,12 +96,12 @@ StorageLive(_5); StorageLive(_6); StorageLive(_7); - _7 = _1; + _7 = copy _1; - _6 = Sub(move _7, const 0_u64); -+ _6 = _1; ++ _6 = copy _1; StorageDead(_7); - _5 = opaque::(move _6) -> [return: bb2, unwind continue]; -+ _5 = opaque::(_1) -> [return: bb2, unwind continue]; ++ _5 = opaque::(copy _1) -> [return: bb2, unwind continue]; } bb2: { @@ -111,9 +111,9 @@ - StorageLive(_9); + nop; StorageLive(_10); - _10 = _1; + _10 = copy _1; StorageLive(_11); - _11 = _1; + _11 = copy _1; - _9 = Sub(move _10, move _11); + _9 = const 0_u64; StorageDead(_11); @@ -129,7 +129,7 @@ StorageLive(_12); StorageLive(_13); StorageLive(_14); - _14 = _1; + _14 = copy _1; - _13 = Mul(move _14, const 0_u64); + _13 = const 0_u64; StorageDead(_14); @@ -143,12 +143,12 @@ StorageLive(_15); StorageLive(_16); StorageLive(_17); - _17 = _1; + _17 = copy _1; - _16 = Mul(move _17, const 1_u64); -+ _16 = _1; ++ _16 = copy _1; StorageDead(_17); - _15 = opaque::(move _16) -> [return: bb5, unwind continue]; -+ _15 = opaque::(_1) -> [return: bb5, unwind continue]; ++ _15 = opaque::(copy _1) -> [return: bb5, unwind continue]; } bb5: { @@ -157,16 +157,16 @@ StorageLive(_18); StorageLive(_19); StorageLive(_20); - _20 = _1; + _20 = copy _1; - _21 = Eq(const 0_u64, const 0_u64); -- assert(!move _21, "attempt to divide `{}` by zero", _20) -> [success: bb6, unwind continue]; +- assert(!move _21, "attempt to divide `{}` by zero", copy _20) -> [success: bb6, unwind continue]; + _21 = const true; -+ assert(!const true, "attempt to divide `{}` by zero", _1) -> [success: bb6, unwind continue]; ++ assert(!const true, "attempt to divide `{}` by zero", copy _1) -> [success: bb6, unwind continue]; } bb6: { - _19 = Div(move _20, const 0_u64); -+ _19 = Div(_1, const 0_u64); ++ _19 = Div(copy _1, const 0_u64); StorageDead(_20); _18 = opaque::(move _19) -> [return: bb7, unwind continue]; } @@ -177,19 +177,19 @@ StorageLive(_22); StorageLive(_23); StorageLive(_24); - _24 = _1; + _24 = copy _1; - _25 = Eq(const 1_u64, const 0_u64); -- assert(!move _25, "attempt to divide `{}` by zero", _24) -> [success: bb8, unwind continue]; +- assert(!move _25, "attempt to divide `{}` by zero", copy _24) -> [success: bb8, unwind continue]; + _25 = const false; -+ assert(!const false, "attempt to divide `{}` by zero", _1) -> [success: bb8, unwind continue]; ++ assert(!const false, "attempt to divide `{}` by zero", copy _1) -> [success: bb8, unwind continue]; } bb8: { - _23 = Div(move _24, const 1_u64); -+ _23 = _1; ++ _23 = copy _1; StorageDead(_24); - _22 = opaque::(move _23) -> [return: bb9, unwind continue]; -+ _22 = opaque::(_1) -> [return: bb9, unwind continue]; ++ _22 = opaque::(copy _1) -> [return: bb9, unwind continue]; } bb9: { @@ -198,11 +198,11 @@ StorageLive(_26); StorageLive(_27); StorageLive(_28); - _28 = _1; -- _29 = Eq(_28, const 0_u64); + _28 = copy _1; +- _29 = Eq(copy _28, const 0_u64); - assert(!move _29, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb10, unwind continue]; -+ _29 = Eq(_1, const 0_u64); -+ assert(!_29, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb10, unwind continue]; ++ _29 = Eq(copy _1, const 0_u64); ++ assert(!copy _29, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb10, unwind continue]; } bb10: { @@ -219,16 +219,16 @@ StorageLive(_30); StorageLive(_31); StorageLive(_32); - _32 = _1; -- _33 = Eq(_32, const 0_u64); + _32 = copy _1; +- _33 = Eq(copy _32, const 0_u64); - assert(!move _33, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb12, unwind continue]; -+ _33 = _29; -+ assert(!_29, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb12, unwind continue]; ++ _33 = copy _29; ++ assert(!copy _29, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb12, unwind continue]; } bb12: { - _31 = Div(const 1_u64, move _32); -+ _31 = Div(const 1_u64, _1); ++ _31 = Div(const 1_u64, copy _1); StorageDead(_32); _30 = opaque::(move _31) -> [return: bb13, unwind continue]; } @@ -239,16 +239,16 @@ StorageLive(_34); StorageLive(_35); StorageLive(_36); - _36 = _1; + _36 = copy _1; - _37 = Eq(const 0_u64, const 0_u64); -- assert(!move _37, "attempt to calculate the remainder of `{}` with a divisor of zero", _36) -> [success: bb14, unwind continue]; +- assert(!move _37, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _36) -> [success: bb14, unwind continue]; + _37 = const true; -+ assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb14, unwind continue]; ++ assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _1) -> [success: bb14, unwind continue]; } bb14: { - _35 = Rem(move _36, const 0_u64); -+ _35 = Rem(_1, const 0_u64); ++ _35 = Rem(copy _1, const 0_u64); StorageDead(_36); _34 = opaque::(move _35) -> [return: bb15, unwind continue]; } @@ -259,11 +259,11 @@ StorageLive(_38); StorageLive(_39); StorageLive(_40); - _40 = _1; + _40 = copy _1; - _41 = Eq(const 1_u64, const 0_u64); -- assert(!move _41, "attempt to calculate the remainder of `{}` with a divisor of zero", _40) -> [success: bb16, unwind continue]; +- assert(!move _41, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _40) -> [success: bb16, unwind continue]; + _41 = const false; -+ assert(!const false, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb16, unwind continue]; ++ assert(!const false, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _1) -> [success: bb16, unwind continue]; } bb16: { @@ -280,11 +280,11 @@ StorageLive(_42); StorageLive(_43); StorageLive(_44); - _44 = _1; -- _45 = Eq(_44, const 0_u64); + _44 = copy _1; +- _45 = Eq(copy _44, const 0_u64); - assert(!move _45, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb18, unwind continue]; -+ _45 = _29; -+ assert(!_29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb18, unwind continue]; ++ _45 = copy _29; ++ assert(!copy _29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb18, unwind continue]; } bb18: { @@ -301,16 +301,16 @@ StorageLive(_46); StorageLive(_47); StorageLive(_48); - _48 = _1; -- _49 = Eq(_48, const 0_u64); + _48 = copy _1; +- _49 = Eq(copy _48, const 0_u64); - assert(!move _49, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb20, unwind continue]; -+ _49 = _29; -+ assert(!_29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb20, unwind continue]; ++ _49 = copy _29; ++ assert(!copy _29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb20, unwind continue]; } bb20: { - _47 = Rem(const 1_u64, move _48); -+ _47 = Rem(const 1_u64, _1); ++ _47 = Rem(const 1_u64, copy _1); StorageDead(_48); _46 = opaque::(move _47) -> [return: bb21, unwind continue]; } @@ -321,7 +321,7 @@ StorageLive(_50); StorageLive(_51); StorageLive(_52); - _52 = _1; + _52 = copy _1; - _51 = BitAnd(move _52, const 0_u64); + _51 = const 0_u64; StorageDead(_52); @@ -335,12 +335,12 @@ StorageLive(_53); StorageLive(_54); StorageLive(_55); - _55 = _1; + _55 = copy _1; - _54 = BitAnd(move _55, const core::num::::MAX); -+ _54 = _1; ++ _54 = copy _1; StorageDead(_55); - _53 = opaque::(move _54) -> [return: bb23, unwind continue]; -+ _53 = opaque::(_1) -> [return: bb23, unwind continue]; ++ _53 = opaque::(copy _1) -> [return: bb23, unwind continue]; } bb23: { @@ -349,12 +349,12 @@ StorageLive(_56); StorageLive(_57); StorageLive(_58); - _58 = _1; + _58 = copy _1; - _57 = BitOr(move _58, const 0_u64); -+ _57 = _1; ++ _57 = copy _1; StorageDead(_58); - _56 = opaque::(move _57) -> [return: bb24, unwind continue]; -+ _56 = opaque::(_1) -> [return: bb24, unwind continue]; ++ _56 = opaque::(copy _1) -> [return: bb24, unwind continue]; } bb24: { @@ -363,7 +363,7 @@ StorageLive(_59); StorageLive(_60); StorageLive(_61); - _61 = _1; + _61 = copy _1; - _60 = BitOr(move _61, const core::num::::MAX); + _60 = const u64::MAX; StorageDead(_61); @@ -377,12 +377,12 @@ StorageLive(_62); StorageLive(_63); StorageLive(_64); - _64 = _1; + _64 = copy _1; - _63 = BitXor(move _64, const 0_u64); -+ _63 = _1; ++ _63 = copy _1; StorageDead(_64); - _62 = opaque::(move _63) -> [return: bb26, unwind continue]; -+ _62 = opaque::(_1) -> [return: bb26, unwind continue]; ++ _62 = opaque::(copy _1) -> [return: bb26, unwind continue]; } bb26: { @@ -391,9 +391,9 @@ StorageLive(_65); StorageLive(_66); StorageLive(_67); - _67 = _1; + _67 = copy _1; StorageLive(_68); - _68 = _1; + _68 = copy _1; - _66 = BitXor(move _67, move _68); + _66 = const 0_u64; StorageDead(_68); @@ -408,12 +408,12 @@ StorageLive(_69); StorageLive(_70); StorageLive(_71); - _71 = _1; + _71 = copy _1; - _70 = Shr(move _71, const 0_i32); -+ _70 = _1; ++ _70 = copy _1; StorageDead(_71); - _69 = opaque::(move _70) -> [return: bb28, unwind continue]; -+ _69 = opaque::(_1) -> [return: bb28, unwind continue]; ++ _69 = opaque::(copy _1) -> [return: bb28, unwind continue]; } bb28: { @@ -422,12 +422,12 @@ StorageLive(_72); StorageLive(_73); StorageLive(_74); - _74 = _1; + _74 = copy _1; - _73 = Shl(move _74, const 0_i32); -+ _73 = _1; ++ _73 = copy _1; StorageDead(_74); - _72 = opaque::(move _73) -> [return: bb29, unwind continue]; -+ _72 = opaque::(_1) -> [return: bb29, unwind continue]; ++ _72 = opaque::(copy _1) -> [return: bb29, unwind continue]; } bb29: { diff --git a/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-abort.diff b/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-abort.diff index 0e3f2459fae35..acf8bfc71beda 100644 --- a/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-abort.diff @@ -30,19 +30,19 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; -- _5 = AddWithOverflow(_4, const 0_u64); + _4 = copy _1; +- _5 = AddWithOverflow(copy _4, const 0_u64); - assert(!move (_5.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, const 0_u64) -> [success: bb1, unwind unreachable]; -+ _5 = AddWithOverflow(_1, const 0_u64); -+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", _1, const 0_u64) -> [success: bb1, unwind unreachable]; ++ _5 = AddWithOverflow(copy _1, const 0_u64); ++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", copy _1, const 0_u64) -> [success: bb1, unwind unreachable]; } bb1: { - _3 = move (_5.0: u64); -+ _3 = _1; ++ _3 = copy _1; StorageDead(_4); - _2 = opaque::(move _3) -> [return: bb2, unwind unreachable]; -+ _2 = opaque::(_1) -> [return: bb2, unwind unreachable]; ++ _2 = opaque::(copy _1) -> [return: bb2, unwind unreachable]; } bb2: { @@ -51,19 +51,19 @@ StorageLive(_6); StorageLive(_7); StorageLive(_8); - _8 = _1; -- _9 = SubWithOverflow(_8, const 0_u64); + _8 = copy _1; +- _9 = SubWithOverflow(copy _8, const 0_u64); - assert(!move (_9.1: bool), "attempt to compute `{} - {}`, which would overflow", move _8, const 0_u64) -> [success: bb3, unwind unreachable]; -+ _9 = _5; -+ assert(!const false, "attempt to compute `{} - {}`, which would overflow", _1, const 0_u64) -> [success: bb3, unwind unreachable]; ++ _9 = copy _5; ++ assert(!const false, "attempt to compute `{} - {}`, which would overflow", copy _1, const 0_u64) -> [success: bb3, unwind unreachable]; } bb3: { - _7 = move (_9.0: u64); -+ _7 = _1; ++ _7 = copy _1; StorageDead(_8); - _6 = opaque::(move _7) -> [return: bb4, unwind unreachable]; -+ _6 = opaque::(_1) -> [return: bb4, unwind unreachable]; ++ _6 = opaque::(copy _1) -> [return: bb4, unwind unreachable]; } bb4: { @@ -73,13 +73,13 @@ - StorageLive(_11); + nop; StorageLive(_12); - _12 = _1; + _12 = copy _1; StorageLive(_13); - _13 = _1; -- _14 = SubWithOverflow(_12, _13); + _13 = copy _1; +- _14 = SubWithOverflow(copy _12, copy _13); - assert(!move (_14.1: bool), "attempt to compute `{} - {}`, which would overflow", move _12, move _13) -> [success: bb5, unwind unreachable]; + _14 = const (0_u64, false); -+ assert(!const false, "attempt to compute `{} - {}`, which would overflow", _1, _1) -> [success: bb5, unwind unreachable]; ++ assert(!const false, "attempt to compute `{} - {}`, which would overflow", copy _1, copy _1) -> [success: bb5, unwind unreachable]; } bb5: { @@ -98,11 +98,11 @@ StorageLive(_15); StorageLive(_16); StorageLive(_17); - _17 = _1; -- _18 = MulWithOverflow(_17, const 0_u64); + _17 = copy _1; +- _18 = MulWithOverflow(copy _17, const 0_u64); - assert(!move (_18.1: bool), "attempt to compute `{} * {}`, which would overflow", move _17, const 0_u64) -> [success: bb7, unwind unreachable]; + _18 = const (0_u64, false); -+ assert(!const false, "attempt to compute `{} * {}`, which would overflow", _1, const 0_u64) -> [success: bb7, unwind unreachable]; ++ assert(!const false, "attempt to compute `{} * {}`, which would overflow", copy _1, const 0_u64) -> [success: bb7, unwind unreachable]; } bb7: { @@ -119,19 +119,19 @@ StorageLive(_19); StorageLive(_20); StorageLive(_21); - _21 = _1; -- _22 = MulWithOverflow(_21, const 1_u64); + _21 = copy _1; +- _22 = MulWithOverflow(copy _21, const 1_u64); - assert(!move (_22.1: bool), "attempt to compute `{} * {}`, which would overflow", move _21, const 1_u64) -> [success: bb9, unwind unreachable]; -+ _22 = _5; -+ assert(!const false, "attempt to compute `{} * {}`, which would overflow", _1, const 1_u64) -> [success: bb9, unwind unreachable]; ++ _22 = copy _5; ++ assert(!const false, "attempt to compute `{} * {}`, which would overflow", copy _1, const 1_u64) -> [success: bb9, unwind unreachable]; } bb9: { - _20 = move (_22.0: u64); -+ _20 = _1; ++ _20 = copy _1; StorageDead(_21); - _19 = opaque::(move _20) -> [return: bb10, unwind unreachable]; -+ _19 = opaque::(_1) -> [return: bb10, unwind unreachable]; ++ _19 = opaque::(copy _1) -> [return: bb10, unwind unreachable]; } bb10: { diff --git a/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-unwind.diff b/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-unwind.diff index 2873d7ef0ab13..f3f6b381a81ca 100644 --- a/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-unwind.diff @@ -30,19 +30,19 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; -- _5 = AddWithOverflow(_4, const 0_u64); + _4 = copy _1; +- _5 = AddWithOverflow(copy _4, const 0_u64); - assert(!move (_5.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, const 0_u64) -> [success: bb1, unwind continue]; -+ _5 = AddWithOverflow(_1, const 0_u64); -+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", _1, const 0_u64) -> [success: bb1, unwind continue]; ++ _5 = AddWithOverflow(copy _1, const 0_u64); ++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", copy _1, const 0_u64) -> [success: bb1, unwind continue]; } bb1: { - _3 = move (_5.0: u64); -+ _3 = _1; ++ _3 = copy _1; StorageDead(_4); - _2 = opaque::(move _3) -> [return: bb2, unwind continue]; -+ _2 = opaque::(_1) -> [return: bb2, unwind continue]; ++ _2 = opaque::(copy _1) -> [return: bb2, unwind continue]; } bb2: { @@ -51,19 +51,19 @@ StorageLive(_6); StorageLive(_7); StorageLive(_8); - _8 = _1; -- _9 = SubWithOverflow(_8, const 0_u64); + _8 = copy _1; +- _9 = SubWithOverflow(copy _8, const 0_u64); - assert(!move (_9.1: bool), "attempt to compute `{} - {}`, which would overflow", move _8, const 0_u64) -> [success: bb3, unwind continue]; -+ _9 = _5; -+ assert(!const false, "attempt to compute `{} - {}`, which would overflow", _1, const 0_u64) -> [success: bb3, unwind continue]; ++ _9 = copy _5; ++ assert(!const false, "attempt to compute `{} - {}`, which would overflow", copy _1, const 0_u64) -> [success: bb3, unwind continue]; } bb3: { - _7 = move (_9.0: u64); -+ _7 = _1; ++ _7 = copy _1; StorageDead(_8); - _6 = opaque::(move _7) -> [return: bb4, unwind continue]; -+ _6 = opaque::(_1) -> [return: bb4, unwind continue]; ++ _6 = opaque::(copy _1) -> [return: bb4, unwind continue]; } bb4: { @@ -73,13 +73,13 @@ - StorageLive(_11); + nop; StorageLive(_12); - _12 = _1; + _12 = copy _1; StorageLive(_13); - _13 = _1; -- _14 = SubWithOverflow(_12, _13); + _13 = copy _1; +- _14 = SubWithOverflow(copy _12, copy _13); - assert(!move (_14.1: bool), "attempt to compute `{} - {}`, which would overflow", move _12, move _13) -> [success: bb5, unwind continue]; + _14 = const (0_u64, false); -+ assert(!const false, "attempt to compute `{} - {}`, which would overflow", _1, _1) -> [success: bb5, unwind continue]; ++ assert(!const false, "attempt to compute `{} - {}`, which would overflow", copy _1, copy _1) -> [success: bb5, unwind continue]; } bb5: { @@ -98,11 +98,11 @@ StorageLive(_15); StorageLive(_16); StorageLive(_17); - _17 = _1; -- _18 = MulWithOverflow(_17, const 0_u64); + _17 = copy _1; +- _18 = MulWithOverflow(copy _17, const 0_u64); - assert(!move (_18.1: bool), "attempt to compute `{} * {}`, which would overflow", move _17, const 0_u64) -> [success: bb7, unwind continue]; + _18 = const (0_u64, false); -+ assert(!const false, "attempt to compute `{} * {}`, which would overflow", _1, const 0_u64) -> [success: bb7, unwind continue]; ++ assert(!const false, "attempt to compute `{} * {}`, which would overflow", copy _1, const 0_u64) -> [success: bb7, unwind continue]; } bb7: { @@ -119,19 +119,19 @@ StorageLive(_19); StorageLive(_20); StorageLive(_21); - _21 = _1; -- _22 = MulWithOverflow(_21, const 1_u64); + _21 = copy _1; +- _22 = MulWithOverflow(copy _21, const 1_u64); - assert(!move (_22.1: bool), "attempt to compute `{} * {}`, which would overflow", move _21, const 1_u64) -> [success: bb9, unwind continue]; -+ _22 = _5; -+ assert(!const false, "attempt to compute `{} * {}`, which would overflow", _1, const 1_u64) -> [success: bb9, unwind continue]; ++ _22 = copy _5; ++ assert(!const false, "attempt to compute `{} * {}`, which would overflow", copy _1, const 1_u64) -> [success: bb9, unwind continue]; } bb9: { - _20 = move (_22.0: u64); -+ _20 = _1; ++ _20 = copy _1; StorageDead(_21); - _19 = opaque::(move _20) -> [return: bb10, unwind continue]; -+ _19 = opaque::(_1) -> [return: bb10, unwind continue]; ++ _19 = opaque::(copy _1) -> [return: bb10, unwind continue]; } bb10: { diff --git a/tests/mir-opt/gvn.arithmetic_float.GVN.panic-abort.diff b/tests/mir-opt/gvn.arithmetic_float.GVN.panic-abort.diff index b332100eaf03c..31a8546812673 100644 --- a/tests/mir-opt/gvn.arithmetic_float.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.arithmetic_float.GVN.panic-abort.diff @@ -38,9 +38,9 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; - _3 = Add(move _4, const 0f64); -+ _3 = Add(_1, const 0f64); ++ _3 = Add(copy _1, const 0f64); StorageDead(_4); _2 = opaque::(move _3) -> [return: bb1, unwind unreachable]; } @@ -51,9 +51,9 @@ StorageLive(_5); StorageLive(_6); StorageLive(_7); - _7 = _1; + _7 = copy _1; - _6 = Sub(move _7, const 0f64); -+ _6 = Sub(_1, const 0f64); ++ _6 = Sub(copy _1, const 0f64); StorageDead(_7); _5 = opaque::(move _6) -> [return: bb2, unwind unreachable]; } @@ -64,9 +64,9 @@ StorageLive(_8); StorageLive(_9); StorageLive(_10); - _10 = _1; + _10 = copy _1; - _9 = Mul(move _10, const 0f64); -+ _9 = Mul(_1, const 0f64); ++ _9 = Mul(copy _1, const 0f64); StorageDead(_10); _8 = opaque::(move _9) -> [return: bb3, unwind unreachable]; } @@ -77,9 +77,9 @@ StorageLive(_11); StorageLive(_12); StorageLive(_13); - _13 = _1; + _13 = copy _1; - _12 = Div(move _13, const 0f64); -+ _12 = Div(_1, const 0f64); ++ _12 = Div(copy _1, const 0f64); StorageDead(_13); _11 = opaque::(move _12) -> [return: bb4, unwind unreachable]; } @@ -90,9 +90,9 @@ StorageLive(_14); StorageLive(_15); StorageLive(_16); - _16 = _1; + _16 = copy _1; - _15 = Div(const 0f64, move _16); -+ _15 = Div(const 0f64, _1); ++ _15 = Div(const 0f64, copy _1); StorageDead(_16); _14 = opaque::(move _15) -> [return: bb5, unwind unreachable]; } @@ -103,9 +103,9 @@ StorageLive(_17); StorageLive(_18); StorageLive(_19); - _19 = _1; + _19 = copy _1; - _18 = Rem(move _19, const 0f64); -+ _18 = Rem(_1, const 0f64); ++ _18 = Rem(copy _1, const 0f64); StorageDead(_19); _17 = opaque::(move _18) -> [return: bb6, unwind unreachable]; } @@ -116,9 +116,9 @@ StorageLive(_20); StorageLive(_21); StorageLive(_22); - _22 = _1; + _22 = copy _1; - _21 = Rem(const 0f64, move _22); -+ _21 = Rem(const 0f64, _1); ++ _21 = Rem(const 0f64, copy _1); StorageDead(_22); _20 = opaque::(move _21) -> [return: bb7, unwind unreachable]; } @@ -129,11 +129,11 @@ StorageLive(_23); StorageLive(_24); StorageLive(_25); - _25 = _1; + _25 = copy _1; StorageLive(_26); - _26 = _1; + _26 = copy _1; - _24 = Eq(move _25, move _26); -+ _24 = Eq(_1, _1); ++ _24 = Eq(copy _1, copy _1); StorageDead(_26); StorageDead(_25); _23 = opaque::(move _24) -> [return: bb8, unwind unreachable]; @@ -145,11 +145,11 @@ StorageLive(_27); StorageLive(_28); StorageLive(_29); - _29 = _1; + _29 = copy _1; StorageLive(_30); - _30 = _1; + _30 = copy _1; - _28 = Ne(move _29, move _30); -+ _28 = Ne(_1, _1); ++ _28 = Ne(copy _1, copy _1); StorageDead(_30); StorageDead(_29); _27 = opaque::(move _28) -> [return: bb9, unwind unreachable]; diff --git a/tests/mir-opt/gvn.arithmetic_float.GVN.panic-unwind.diff b/tests/mir-opt/gvn.arithmetic_float.GVN.panic-unwind.diff index 28664cb0ac8ca..4e42b1af4fc95 100644 --- a/tests/mir-opt/gvn.arithmetic_float.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.arithmetic_float.GVN.panic-unwind.diff @@ -38,9 +38,9 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; - _3 = Add(move _4, const 0f64); -+ _3 = Add(_1, const 0f64); ++ _3 = Add(copy _1, const 0f64); StorageDead(_4); _2 = opaque::(move _3) -> [return: bb1, unwind continue]; } @@ -51,9 +51,9 @@ StorageLive(_5); StorageLive(_6); StorageLive(_7); - _7 = _1; + _7 = copy _1; - _6 = Sub(move _7, const 0f64); -+ _6 = Sub(_1, const 0f64); ++ _6 = Sub(copy _1, const 0f64); StorageDead(_7); _5 = opaque::(move _6) -> [return: bb2, unwind continue]; } @@ -64,9 +64,9 @@ StorageLive(_8); StorageLive(_9); StorageLive(_10); - _10 = _1; + _10 = copy _1; - _9 = Mul(move _10, const 0f64); -+ _9 = Mul(_1, const 0f64); ++ _9 = Mul(copy _1, const 0f64); StorageDead(_10); _8 = opaque::(move _9) -> [return: bb3, unwind continue]; } @@ -77,9 +77,9 @@ StorageLive(_11); StorageLive(_12); StorageLive(_13); - _13 = _1; + _13 = copy _1; - _12 = Div(move _13, const 0f64); -+ _12 = Div(_1, const 0f64); ++ _12 = Div(copy _1, const 0f64); StorageDead(_13); _11 = opaque::(move _12) -> [return: bb4, unwind continue]; } @@ -90,9 +90,9 @@ StorageLive(_14); StorageLive(_15); StorageLive(_16); - _16 = _1; + _16 = copy _1; - _15 = Div(const 0f64, move _16); -+ _15 = Div(const 0f64, _1); ++ _15 = Div(const 0f64, copy _1); StorageDead(_16); _14 = opaque::(move _15) -> [return: bb5, unwind continue]; } @@ -103,9 +103,9 @@ StorageLive(_17); StorageLive(_18); StorageLive(_19); - _19 = _1; + _19 = copy _1; - _18 = Rem(move _19, const 0f64); -+ _18 = Rem(_1, const 0f64); ++ _18 = Rem(copy _1, const 0f64); StorageDead(_19); _17 = opaque::(move _18) -> [return: bb6, unwind continue]; } @@ -116,9 +116,9 @@ StorageLive(_20); StorageLive(_21); StorageLive(_22); - _22 = _1; + _22 = copy _1; - _21 = Rem(const 0f64, move _22); -+ _21 = Rem(const 0f64, _1); ++ _21 = Rem(const 0f64, copy _1); StorageDead(_22); _20 = opaque::(move _21) -> [return: bb7, unwind continue]; } @@ -129,11 +129,11 @@ StorageLive(_23); StorageLive(_24); StorageLive(_25); - _25 = _1; + _25 = copy _1; StorageLive(_26); - _26 = _1; + _26 = copy _1; - _24 = Eq(move _25, move _26); -+ _24 = Eq(_1, _1); ++ _24 = Eq(copy _1, copy _1); StorageDead(_26); StorageDead(_25); _23 = opaque::(move _24) -> [return: bb8, unwind continue]; @@ -145,11 +145,11 @@ StorageLive(_27); StorageLive(_28); StorageLive(_29); - _29 = _1; + _29 = copy _1; StorageLive(_30); - _30 = _1; + _30 = copy _1; - _28 = Ne(move _29, move _30); -+ _28 = Ne(_1, _1); ++ _28 = Ne(copy _1, copy _1); StorageDead(_30); StorageDead(_29); _27 = opaque::(move _28) -> [return: bb9, unwind continue]; diff --git a/tests/mir-opt/gvn.borrowed.GVN.panic-abort.diff b/tests/mir-opt/gvn.borrowed.GVN.panic-abort.diff index 9520bd382eebb..b0702696e1871 100644 --- a/tests/mir-opt/gvn.borrowed.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.borrowed.GVN.panic-abort.diff @@ -7,19 +7,19 @@ let mut _3: &T; bb0: { - _2 = _1; + _2 = copy _1; _3 = &_1; - _0 = opaque::<&T>(_3) -> [return: bb1, unwind unreachable]; + _0 = opaque::<&T>(copy _3) -> [return: bb1, unwind unreachable]; } bb1: { -- _0 = opaque::(_2) -> [return: bb2, unwind unreachable]; -+ _0 = opaque::(_1) -> [return: bb2, unwind unreachable]; +- _0 = opaque::(copy _2) -> [return: bb2, unwind unreachable]; ++ _0 = opaque::(copy _1) -> [return: bb2, unwind unreachable]; } bb2: { -- _0 = opaque::((*_3)) -> [return: bb3, unwind unreachable]; -+ _0 = opaque::(_1) -> [return: bb3, unwind unreachable]; +- _0 = opaque::(copy (*_3)) -> [return: bb3, unwind unreachable]; ++ _0 = opaque::(copy _1) -> [return: bb3, unwind unreachable]; } bb3: { diff --git a/tests/mir-opt/gvn.borrowed.GVN.panic-unwind.diff b/tests/mir-opt/gvn.borrowed.GVN.panic-unwind.diff index 4f5d76d564400..fe05d4deeede9 100644 --- a/tests/mir-opt/gvn.borrowed.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.borrowed.GVN.panic-unwind.diff @@ -7,19 +7,19 @@ let mut _3: &T; bb0: { - _2 = _1; + _2 = copy _1; _3 = &_1; - _0 = opaque::<&T>(_3) -> [return: bb1, unwind continue]; + _0 = opaque::<&T>(copy _3) -> [return: bb1, unwind continue]; } bb1: { -- _0 = opaque::(_2) -> [return: bb2, unwind continue]; -+ _0 = opaque::(_1) -> [return: bb2, unwind continue]; +- _0 = opaque::(copy _2) -> [return: bb2, unwind continue]; ++ _0 = opaque::(copy _1) -> [return: bb2, unwind continue]; } bb2: { -- _0 = opaque::((*_3)) -> [return: bb3, unwind continue]; -+ _0 = opaque::(_1) -> [return: bb3, unwind continue]; +- _0 = opaque::(copy (*_3)) -> [return: bb3, unwind continue]; ++ _0 = opaque::(copy _1) -> [return: bb3, unwind continue]; } bb3: { diff --git a/tests/mir-opt/gvn.cast.GVN.panic-abort.diff b/tests/mir-opt/gvn.cast.GVN.panic-abort.diff index d43198c99110d..1d523d22ca646 100644 --- a/tests/mir-opt/gvn.cast.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.cast.GVN.panic-abort.diff @@ -116,7 +116,7 @@ StorageLive(_4); StorageLive(_5); StorageLive(_6); -- _6 = _1; +- _6 = copy _1; - _5 = move _6 as u8 (IntToInt); + _6 = const 1_i64; + _5 = const 1_u8; @@ -131,7 +131,7 @@ StorageLive(_7); StorageLive(_8); StorageLive(_9); -- _9 = _1; +- _9 = copy _1; - _8 = move _9 as u16 (IntToInt); + _9 = const 1_i64; + _8 = const 1_u16; @@ -146,7 +146,7 @@ StorageLive(_10); StorageLive(_11); StorageLive(_12); -- _12 = _1; +- _12 = copy _1; - _11 = move _12 as u32 (IntToInt); + _12 = const 1_i64; + _11 = const 1_u32; @@ -161,7 +161,7 @@ StorageLive(_13); StorageLive(_14); StorageLive(_15); -- _15 = _1; +- _15 = copy _1; - _14 = move _15 as u64 (IntToInt); + _15 = const 1_i64; + _14 = const 1_u64; @@ -176,7 +176,7 @@ StorageLive(_16); StorageLive(_17); StorageLive(_18); -- _18 = _1; +- _18 = copy _1; - _17 = move _18 as i8 (IntToInt); + _18 = const 1_i64; + _17 = const 1_i8; @@ -191,7 +191,7 @@ StorageLive(_19); StorageLive(_20); StorageLive(_21); -- _21 = _1; +- _21 = copy _1; - _20 = move _21 as i16 (IntToInt); + _21 = const 1_i64; + _20 = const 1_i16; @@ -206,7 +206,7 @@ StorageLive(_22); StorageLive(_23); StorageLive(_24); -- _24 = _1; +- _24 = copy _1; - _23 = move _24 as i32 (IntToInt); + _24 = const 1_i64; + _23 = const 1_i32; @@ -220,7 +220,7 @@ StorageDead(_22); StorageLive(_25); StorageLive(_26); -- _26 = _1; +- _26 = copy _1; - _25 = opaque::(move _26) -> [return: bb8, unwind unreachable]; + _26 = const 1_i64; + _25 = opaque::(const 1_i64) -> [return: bb8, unwind unreachable]; @@ -232,7 +232,7 @@ StorageLive(_27); StorageLive(_28); StorageLive(_29); -- _29 = _1; +- _29 = copy _1; - _28 = move _29 as f32 (IntToFloat); + _29 = const 1_i64; + _28 = const 1f32; @@ -247,7 +247,7 @@ StorageLive(_30); StorageLive(_31); StorageLive(_32); -- _32 = _1; +- _32 = copy _1; - _31 = move _32 as f64 (IntToFloat); + _32 = const 1_i64; + _31 = const 1f64; @@ -262,7 +262,7 @@ StorageLive(_33); StorageLive(_34); StorageLive(_35); -- _35 = _2; +- _35 = copy _2; - _34 = move _35 as u8 (IntToInt); + _35 = const 1_u64; + _34 = const 1_u8; @@ -277,7 +277,7 @@ StorageLive(_36); StorageLive(_37); StorageLive(_38); -- _38 = _2; +- _38 = copy _2; - _37 = move _38 as u16 (IntToInt); + _38 = const 1_u64; + _37 = const 1_u16; @@ -292,7 +292,7 @@ StorageLive(_39); StorageLive(_40); StorageLive(_41); -- _41 = _2; +- _41 = copy _2; - _40 = move _41 as u32 (IntToInt); + _41 = const 1_u64; + _40 = const 1_u32; @@ -306,7 +306,7 @@ StorageDead(_39); StorageLive(_42); StorageLive(_43); -- _43 = _2; +- _43 = copy _2; - _42 = opaque::(move _43) -> [return: bb14, unwind unreachable]; + _43 = const 1_u64; + _42 = opaque::(const 1_u64) -> [return: bb14, unwind unreachable]; @@ -318,7 +318,7 @@ StorageLive(_44); StorageLive(_45); StorageLive(_46); -- _46 = _2; +- _46 = copy _2; - _45 = move _46 as i8 (IntToInt); + _46 = const 1_u64; + _45 = const 1_i8; @@ -333,7 +333,7 @@ StorageLive(_47); StorageLive(_48); StorageLive(_49); -- _49 = _2; +- _49 = copy _2; - _48 = move _49 as i16 (IntToInt); + _49 = const 1_u64; + _48 = const 1_i16; @@ -348,7 +348,7 @@ StorageLive(_50); StorageLive(_51); StorageLive(_52); -- _52 = _2; +- _52 = copy _2; - _51 = move _52 as i32 (IntToInt); + _52 = const 1_u64; + _51 = const 1_i32; @@ -363,7 +363,7 @@ StorageLive(_53); StorageLive(_54); StorageLive(_55); -- _55 = _2; +- _55 = copy _2; - _54 = move _55 as i64 (IntToInt); + _55 = const 1_u64; + _54 = const 1_i64; @@ -378,7 +378,7 @@ StorageLive(_56); StorageLive(_57); StorageLive(_58); -- _58 = _2; +- _58 = copy _2; - _57 = move _58 as f32 (IntToFloat); + _58 = const 1_u64; + _57 = const 1f32; @@ -393,7 +393,7 @@ StorageLive(_59); StorageLive(_60); StorageLive(_61); -- _61 = _2; +- _61 = copy _2; - _60 = move _61 as f64 (IntToFloat); + _61 = const 1_u64; + _60 = const 1f64; @@ -408,7 +408,7 @@ StorageLive(_62); StorageLive(_63); StorageLive(_64); -- _64 = _3; +- _64 = copy _3; - _63 = move _64 as u8 (FloatToInt); + _64 = const 1f64; + _63 = const 1_u8; @@ -423,7 +423,7 @@ StorageLive(_65); StorageLive(_66); StorageLive(_67); -- _67 = _3; +- _67 = copy _3; - _66 = move _67 as u16 (FloatToInt); + _67 = const 1f64; + _66 = const 1_u16; @@ -438,7 +438,7 @@ StorageLive(_68); StorageLive(_69); StorageLive(_70); -- _70 = _3; +- _70 = copy _3; - _69 = move _70 as u32 (FloatToInt); + _70 = const 1f64; + _69 = const 1_u32; @@ -453,7 +453,7 @@ StorageLive(_71); StorageLive(_72); StorageLive(_73); -- _73 = _3; +- _73 = copy _3; - _72 = move _73 as u64 (FloatToInt); + _73 = const 1f64; + _72 = const 1_u64; @@ -468,7 +468,7 @@ StorageLive(_74); StorageLive(_75); StorageLive(_76); -- _76 = _3; +- _76 = copy _3; - _75 = move _76 as i8 (FloatToInt); + _76 = const 1f64; + _75 = const 1_i8; @@ -483,7 +483,7 @@ StorageLive(_77); StorageLive(_78); StorageLive(_79); -- _79 = _3; +- _79 = copy _3; - _78 = move _79 as i16 (FloatToInt); + _79 = const 1f64; + _78 = const 1_i16; @@ -498,7 +498,7 @@ StorageLive(_80); StorageLive(_81); StorageLive(_82); -- _82 = _3; +- _82 = copy _3; - _81 = move _82 as i32 (FloatToInt); + _82 = const 1f64; + _81 = const 1_i32; @@ -513,7 +513,7 @@ StorageLive(_83); StorageLive(_84); StorageLive(_85); -- _85 = _3; +- _85 = copy _3; - _84 = move _85 as i64 (FloatToInt); + _85 = const 1f64; + _84 = const 1_i64; @@ -528,7 +528,7 @@ StorageLive(_86); StorageLive(_87); StorageLive(_88); -- _88 = _3; +- _88 = copy _3; - _87 = move _88 as f32 (FloatToFloat); + _88 = const 1f64; + _87 = const 1f32; @@ -542,7 +542,7 @@ StorageDead(_86); StorageLive(_89); StorageLive(_90); -- _90 = _3; +- _90 = copy _3; - _89 = opaque::(move _90) -> [return: bb30, unwind unreachable]; + _90 = const 1f64; + _89 = opaque::(const 1f64) -> [return: bb30, unwind unreachable]; diff --git a/tests/mir-opt/gvn.cast.GVN.panic-unwind.diff b/tests/mir-opt/gvn.cast.GVN.panic-unwind.diff index 08b97e13aa0ba..3541c10da6437 100644 --- a/tests/mir-opt/gvn.cast.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.cast.GVN.panic-unwind.diff @@ -116,7 +116,7 @@ StorageLive(_4); StorageLive(_5); StorageLive(_6); -- _6 = _1; +- _6 = copy _1; - _5 = move _6 as u8 (IntToInt); + _6 = const 1_i64; + _5 = const 1_u8; @@ -131,7 +131,7 @@ StorageLive(_7); StorageLive(_8); StorageLive(_9); -- _9 = _1; +- _9 = copy _1; - _8 = move _9 as u16 (IntToInt); + _9 = const 1_i64; + _8 = const 1_u16; @@ -146,7 +146,7 @@ StorageLive(_10); StorageLive(_11); StorageLive(_12); -- _12 = _1; +- _12 = copy _1; - _11 = move _12 as u32 (IntToInt); + _12 = const 1_i64; + _11 = const 1_u32; @@ -161,7 +161,7 @@ StorageLive(_13); StorageLive(_14); StorageLive(_15); -- _15 = _1; +- _15 = copy _1; - _14 = move _15 as u64 (IntToInt); + _15 = const 1_i64; + _14 = const 1_u64; @@ -176,7 +176,7 @@ StorageLive(_16); StorageLive(_17); StorageLive(_18); -- _18 = _1; +- _18 = copy _1; - _17 = move _18 as i8 (IntToInt); + _18 = const 1_i64; + _17 = const 1_i8; @@ -191,7 +191,7 @@ StorageLive(_19); StorageLive(_20); StorageLive(_21); -- _21 = _1; +- _21 = copy _1; - _20 = move _21 as i16 (IntToInt); + _21 = const 1_i64; + _20 = const 1_i16; @@ -206,7 +206,7 @@ StorageLive(_22); StorageLive(_23); StorageLive(_24); -- _24 = _1; +- _24 = copy _1; - _23 = move _24 as i32 (IntToInt); + _24 = const 1_i64; + _23 = const 1_i32; @@ -220,7 +220,7 @@ StorageDead(_22); StorageLive(_25); StorageLive(_26); -- _26 = _1; +- _26 = copy _1; - _25 = opaque::(move _26) -> [return: bb8, unwind continue]; + _26 = const 1_i64; + _25 = opaque::(const 1_i64) -> [return: bb8, unwind continue]; @@ -232,7 +232,7 @@ StorageLive(_27); StorageLive(_28); StorageLive(_29); -- _29 = _1; +- _29 = copy _1; - _28 = move _29 as f32 (IntToFloat); + _29 = const 1_i64; + _28 = const 1f32; @@ -247,7 +247,7 @@ StorageLive(_30); StorageLive(_31); StorageLive(_32); -- _32 = _1; +- _32 = copy _1; - _31 = move _32 as f64 (IntToFloat); + _32 = const 1_i64; + _31 = const 1f64; @@ -262,7 +262,7 @@ StorageLive(_33); StorageLive(_34); StorageLive(_35); -- _35 = _2; +- _35 = copy _2; - _34 = move _35 as u8 (IntToInt); + _35 = const 1_u64; + _34 = const 1_u8; @@ -277,7 +277,7 @@ StorageLive(_36); StorageLive(_37); StorageLive(_38); -- _38 = _2; +- _38 = copy _2; - _37 = move _38 as u16 (IntToInt); + _38 = const 1_u64; + _37 = const 1_u16; @@ -292,7 +292,7 @@ StorageLive(_39); StorageLive(_40); StorageLive(_41); -- _41 = _2; +- _41 = copy _2; - _40 = move _41 as u32 (IntToInt); + _41 = const 1_u64; + _40 = const 1_u32; @@ -306,7 +306,7 @@ StorageDead(_39); StorageLive(_42); StorageLive(_43); -- _43 = _2; +- _43 = copy _2; - _42 = opaque::(move _43) -> [return: bb14, unwind continue]; + _43 = const 1_u64; + _42 = opaque::(const 1_u64) -> [return: bb14, unwind continue]; @@ -318,7 +318,7 @@ StorageLive(_44); StorageLive(_45); StorageLive(_46); -- _46 = _2; +- _46 = copy _2; - _45 = move _46 as i8 (IntToInt); + _46 = const 1_u64; + _45 = const 1_i8; @@ -333,7 +333,7 @@ StorageLive(_47); StorageLive(_48); StorageLive(_49); -- _49 = _2; +- _49 = copy _2; - _48 = move _49 as i16 (IntToInt); + _49 = const 1_u64; + _48 = const 1_i16; @@ -348,7 +348,7 @@ StorageLive(_50); StorageLive(_51); StorageLive(_52); -- _52 = _2; +- _52 = copy _2; - _51 = move _52 as i32 (IntToInt); + _52 = const 1_u64; + _51 = const 1_i32; @@ -363,7 +363,7 @@ StorageLive(_53); StorageLive(_54); StorageLive(_55); -- _55 = _2; +- _55 = copy _2; - _54 = move _55 as i64 (IntToInt); + _55 = const 1_u64; + _54 = const 1_i64; @@ -378,7 +378,7 @@ StorageLive(_56); StorageLive(_57); StorageLive(_58); -- _58 = _2; +- _58 = copy _2; - _57 = move _58 as f32 (IntToFloat); + _58 = const 1_u64; + _57 = const 1f32; @@ -393,7 +393,7 @@ StorageLive(_59); StorageLive(_60); StorageLive(_61); -- _61 = _2; +- _61 = copy _2; - _60 = move _61 as f64 (IntToFloat); + _61 = const 1_u64; + _60 = const 1f64; @@ -408,7 +408,7 @@ StorageLive(_62); StorageLive(_63); StorageLive(_64); -- _64 = _3; +- _64 = copy _3; - _63 = move _64 as u8 (FloatToInt); + _64 = const 1f64; + _63 = const 1_u8; @@ -423,7 +423,7 @@ StorageLive(_65); StorageLive(_66); StorageLive(_67); -- _67 = _3; +- _67 = copy _3; - _66 = move _67 as u16 (FloatToInt); + _67 = const 1f64; + _66 = const 1_u16; @@ -438,7 +438,7 @@ StorageLive(_68); StorageLive(_69); StorageLive(_70); -- _70 = _3; +- _70 = copy _3; - _69 = move _70 as u32 (FloatToInt); + _70 = const 1f64; + _69 = const 1_u32; @@ -453,7 +453,7 @@ StorageLive(_71); StorageLive(_72); StorageLive(_73); -- _73 = _3; +- _73 = copy _3; - _72 = move _73 as u64 (FloatToInt); + _73 = const 1f64; + _72 = const 1_u64; @@ -468,7 +468,7 @@ StorageLive(_74); StorageLive(_75); StorageLive(_76); -- _76 = _3; +- _76 = copy _3; - _75 = move _76 as i8 (FloatToInt); + _76 = const 1f64; + _75 = const 1_i8; @@ -483,7 +483,7 @@ StorageLive(_77); StorageLive(_78); StorageLive(_79); -- _79 = _3; +- _79 = copy _3; - _78 = move _79 as i16 (FloatToInt); + _79 = const 1f64; + _78 = const 1_i16; @@ -498,7 +498,7 @@ StorageLive(_80); StorageLive(_81); StorageLive(_82); -- _82 = _3; +- _82 = copy _3; - _81 = move _82 as i32 (FloatToInt); + _82 = const 1f64; + _81 = const 1_i32; @@ -513,7 +513,7 @@ StorageLive(_83); StorageLive(_84); StorageLive(_85); -- _85 = _3; +- _85 = copy _3; - _84 = move _85 as i64 (FloatToInt); + _85 = const 1f64; + _84 = const 1_i64; @@ -528,7 +528,7 @@ StorageLive(_86); StorageLive(_87); StorageLive(_88); -- _88 = _3; +- _88 = copy _3; - _87 = move _88 as f32 (FloatToFloat); + _88 = const 1f64; + _87 = const 1f32; @@ -542,7 +542,7 @@ StorageDead(_86); StorageLive(_89); StorageLive(_90); -- _90 = _3; +- _90 = copy _3; - _89 = opaque::(move _90) -> [return: bb30, unwind continue]; + _90 = const 1f64; + _89 = opaque::(const 1f64) -> [return: bb30, unwind continue]; diff --git a/tests/mir-opt/gvn.cast_pointer_eq.GVN.panic-abort.diff b/tests/mir-opt/gvn.cast_pointer_eq.GVN.panic-abort.diff index 757ab959813a4..f66aed0f44150 100644 --- a/tests/mir-opt/gvn.cast_pointer_eq.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.cast_pointer_eq.GVN.panic-abort.diff @@ -52,70 +52,70 @@ - StorageLive(_5); + nop; StorageLive(_6); - _6 = _1; + _6 = copy _1; - _5 = move _6 as *const u32 (PtrToPtr); -+ _5 = _1 as *const u32 (PtrToPtr); ++ _5 = copy _1 as *const u32 (PtrToPtr); StorageDead(_6); StorageLive(_7); - StorageLive(_8); + nop; StorageLive(_9); - _9 = _2; + _9 = copy _2; - _8 = move _9 as *const u32 (PtrToPtr); -+ _8 = _2 as *const u32 (PtrToPtr); ++ _8 = copy _2 as *const u32 (PtrToPtr); StorageDead(_9); - _7 = move _8 as *const u32 (PtrToPtr); - StorageDead(_8); -+ _7 = _8; ++ _7 = copy _8; + nop; StorageLive(_10); - StorageLive(_11); + nop; StorageLive(_12); - _12 = _3; + _12 = copy _3; - _11 = move _12 as *const u32 (PtrToPtr); -+ _11 = _3 as *const u32 (PtrToPtr); ++ _11 = copy _3 as *const u32 (PtrToPtr); StorageDead(_12); - _10 = move _11 as *const u32 (PtrToPtr); - StorageDead(_11); - StorageLive(_13); -+ _10 = _11; ++ _10 = copy _11; + nop; + nop; StorageLive(_14); - _14 = _4; + _14 = copy _4; - _13 = move _14 as *const u32 (PtrToPtr); -+ _13 = _4 as *const u32 (PtrToPtr); ++ _13 = copy _4 as *const u32 (PtrToPtr); StorageDead(_14); StorageLive(_15); StorageLive(_16); - _16 = _5; + _16 = copy _5; StorageLive(_17); -- _17 = _7; +- _17 = copy _7; - _15 = Eq(move _16, move _17); -+ _17 = _8; -+ _15 = Eq(_5, _8); ++ _17 = copy _8; ++ _15 = Eq(copy _5, copy _8); StorageDead(_17); StorageDead(_16); StorageLive(_18); StorageLive(_19); -- _19 = _7; -+ _19 = _8; +- _19 = copy _7; ++ _19 = copy _8; StorageLive(_20); -- _20 = _10; +- _20 = copy _10; - _18 = Eq(move _19, move _20); -+ _20 = _11; -+ _18 = Eq(_2, _3); ++ _20 = copy _11; ++ _18 = Eq(copy _2, copy _3); StorageDead(_20); StorageDead(_19); StorageLive(_21); StorageLive(_22); -- _22 = _10; -+ _22 = _11; +- _22 = copy _10; ++ _22 = copy _11; StorageLive(_23); - _23 = _13; + _23 = copy _13; - _21 = Eq(move _22, move _23); -+ _21 = Eq(_11, _13); ++ _21 = Eq(copy _11, copy _13); StorageDead(_23); StorageDead(_22); _0 = const (); diff --git a/tests/mir-opt/gvn.cast_pointer_eq.GVN.panic-unwind.diff b/tests/mir-opt/gvn.cast_pointer_eq.GVN.panic-unwind.diff index 757ab959813a4..f66aed0f44150 100644 --- a/tests/mir-opt/gvn.cast_pointer_eq.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.cast_pointer_eq.GVN.panic-unwind.diff @@ -52,70 +52,70 @@ - StorageLive(_5); + nop; StorageLive(_6); - _6 = _1; + _6 = copy _1; - _5 = move _6 as *const u32 (PtrToPtr); -+ _5 = _1 as *const u32 (PtrToPtr); ++ _5 = copy _1 as *const u32 (PtrToPtr); StorageDead(_6); StorageLive(_7); - StorageLive(_8); + nop; StorageLive(_9); - _9 = _2; + _9 = copy _2; - _8 = move _9 as *const u32 (PtrToPtr); -+ _8 = _2 as *const u32 (PtrToPtr); ++ _8 = copy _2 as *const u32 (PtrToPtr); StorageDead(_9); - _7 = move _8 as *const u32 (PtrToPtr); - StorageDead(_8); -+ _7 = _8; ++ _7 = copy _8; + nop; StorageLive(_10); - StorageLive(_11); + nop; StorageLive(_12); - _12 = _3; + _12 = copy _3; - _11 = move _12 as *const u32 (PtrToPtr); -+ _11 = _3 as *const u32 (PtrToPtr); ++ _11 = copy _3 as *const u32 (PtrToPtr); StorageDead(_12); - _10 = move _11 as *const u32 (PtrToPtr); - StorageDead(_11); - StorageLive(_13); -+ _10 = _11; ++ _10 = copy _11; + nop; + nop; StorageLive(_14); - _14 = _4; + _14 = copy _4; - _13 = move _14 as *const u32 (PtrToPtr); -+ _13 = _4 as *const u32 (PtrToPtr); ++ _13 = copy _4 as *const u32 (PtrToPtr); StorageDead(_14); StorageLive(_15); StorageLive(_16); - _16 = _5; + _16 = copy _5; StorageLive(_17); -- _17 = _7; +- _17 = copy _7; - _15 = Eq(move _16, move _17); -+ _17 = _8; -+ _15 = Eq(_5, _8); ++ _17 = copy _8; ++ _15 = Eq(copy _5, copy _8); StorageDead(_17); StorageDead(_16); StorageLive(_18); StorageLive(_19); -- _19 = _7; -+ _19 = _8; +- _19 = copy _7; ++ _19 = copy _8; StorageLive(_20); -- _20 = _10; +- _20 = copy _10; - _18 = Eq(move _19, move _20); -+ _20 = _11; -+ _18 = Eq(_2, _3); ++ _20 = copy _11; ++ _18 = Eq(copy _2, copy _3); StorageDead(_20); StorageDead(_19); StorageLive(_21); StorageLive(_22); -- _22 = _10; -+ _22 = _11; +- _22 = copy _10; ++ _22 = copy _11; StorageLive(_23); - _23 = _13; + _23 = copy _13; - _21 = Eq(move _22, move _23); -+ _21 = Eq(_11, _13); ++ _21 = Eq(copy _11, copy _13); StorageDead(_23); StorageDead(_22); _0 = const (); diff --git a/tests/mir-opt/gvn.cast_pointer_then_transmute.GVN.panic-abort.diff b/tests/mir-opt/gvn.cast_pointer_then_transmute.GVN.panic-abort.diff index 8133f6e0b0078..d9f945d2c41e8 100644 --- a/tests/mir-opt/gvn.cast_pointer_then_transmute.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.cast_pointer_then_transmute.GVN.panic-abort.diff @@ -22,19 +22,19 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = move _5 as *const () (PtrToPtr); -+ _4 = _1 as *const () (PtrToPtr); ++ _4 = copy _1 as *const () (PtrToPtr); StorageDead(_5); - _3 = move _4 as usize (Transmute); -+ _3 = _1 as usize (Transmute); ++ _3 = copy _1 as usize (Transmute); StorageDead(_4); StorageLive(_6); StorageLive(_7); StorageLive(_8); - _8 = _2; + _8 = copy _2; - _7 = move _8 as *const () (PtrToPtr); -+ _7 = _2 as *const () (PtrToPtr); ++ _7 = copy _2 as *const () (PtrToPtr); StorageDead(_8); _6 = move _7 as usize (Transmute); StorageDead(_7); diff --git a/tests/mir-opt/gvn.cast_pointer_then_transmute.GVN.panic-unwind.diff b/tests/mir-opt/gvn.cast_pointer_then_transmute.GVN.panic-unwind.diff index 8133f6e0b0078..d9f945d2c41e8 100644 --- a/tests/mir-opt/gvn.cast_pointer_then_transmute.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.cast_pointer_then_transmute.GVN.panic-unwind.diff @@ -22,19 +22,19 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = move _5 as *const () (PtrToPtr); -+ _4 = _1 as *const () (PtrToPtr); ++ _4 = copy _1 as *const () (PtrToPtr); StorageDead(_5); - _3 = move _4 as usize (Transmute); -+ _3 = _1 as usize (Transmute); ++ _3 = copy _1 as usize (Transmute); StorageDead(_4); StorageLive(_6); StorageLive(_7); StorageLive(_8); - _8 = _2; + _8 = copy _2; - _7 = move _8 as *const () (PtrToPtr); -+ _7 = _2 as *const () (PtrToPtr); ++ _7 = copy _2 as *const () (PtrToPtr); StorageDead(_8); _6 = move _7 as usize (Transmute); StorageDead(_7); diff --git a/tests/mir-opt/gvn.casts_before_aggregate_raw_ptr.GVN.panic-abort.diff b/tests/mir-opt/gvn.casts_before_aggregate_raw_ptr.GVN.panic-abort.diff index 6e5bdb16595be..fd09310fabdeb 100644 --- a/tests/mir-opt/gvn.casts_before_aggregate_raw_ptr.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.casts_before_aggregate_raw_ptr.GVN.panic-abort.diff @@ -25,28 +25,28 @@ - StorageLive(_2); + nop; StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = move _3 as *const [u8; 4] (PtrToPtr); -+ _2 = _1 as *const [u8; 4] (PtrToPtr); ++ _2 = copy _1 as *const [u8; 4] (PtrToPtr); StorageDead(_3); - StorageLive(_4); + nop; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _4 = move _5 as *const u8 (PtrToPtr); -+ _4 = _1 as *const u8 (PtrToPtr); ++ _4 = copy _1 as *const u8 (PtrToPtr); StorageDead(_5); - StorageLive(_6); + nop; StorageLive(_7); - _7 = _4; + _7 = copy _4; - _6 = move _7 as *const () (PtrToPtr); -+ _6 = _1 as *const () (PtrToPtr); ++ _6 = copy _1 as *const () (PtrToPtr); StorageDead(_7); StorageLive(_8); - _8 = _6; + _8 = copy _6; - _0 = *const [u8] from (move _8, const 4_usize); -+ _0 = *const [u8] from (_1, const 4_usize); ++ _0 = *const [u8] from (copy _1, const 4_usize); StorageDead(_8); - StorageDead(_6); - StorageDead(_4); diff --git a/tests/mir-opt/gvn.casts_before_aggregate_raw_ptr.GVN.panic-unwind.diff b/tests/mir-opt/gvn.casts_before_aggregate_raw_ptr.GVN.panic-unwind.diff index 6e5bdb16595be..fd09310fabdeb 100644 --- a/tests/mir-opt/gvn.casts_before_aggregate_raw_ptr.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.casts_before_aggregate_raw_ptr.GVN.panic-unwind.diff @@ -25,28 +25,28 @@ - StorageLive(_2); + nop; StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = move _3 as *const [u8; 4] (PtrToPtr); -+ _2 = _1 as *const [u8; 4] (PtrToPtr); ++ _2 = copy _1 as *const [u8; 4] (PtrToPtr); StorageDead(_3); - StorageLive(_4); + nop; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _4 = move _5 as *const u8 (PtrToPtr); -+ _4 = _1 as *const u8 (PtrToPtr); ++ _4 = copy _1 as *const u8 (PtrToPtr); StorageDead(_5); - StorageLive(_6); + nop; StorageLive(_7); - _7 = _4; + _7 = copy _4; - _6 = move _7 as *const () (PtrToPtr); -+ _6 = _1 as *const () (PtrToPtr); ++ _6 = copy _1 as *const () (PtrToPtr); StorageDead(_7); StorageLive(_8); - _8 = _6; + _8 = copy _6; - _0 = *const [u8] from (move _8, const 4_usize); -+ _0 = *const [u8] from (_1, const 4_usize); ++ _0 = *const [u8] from (copy _1, const 4_usize); StorageDead(_8); - StorageDead(_6); - StorageDead(_4); diff --git a/tests/mir-opt/gvn.comparison.GVN.panic-abort.diff b/tests/mir-opt/gvn.comparison.GVN.panic-abort.diff index fefdf14bddcd0..7b25dedbb887c 100644 --- a/tests/mir-opt/gvn.comparison.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.comparison.GVN.panic-abort.diff @@ -26,9 +26,9 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; StorageLive(_6); - _6 = _1; + _6 = copy _1; - _4 = Eq(move _5, move _6); + _4 = const true; StorageDead(_6); @@ -43,9 +43,9 @@ StorageLive(_7); StorageLive(_8); StorageLive(_9); - _9 = _1; + _9 = copy _1; StorageLive(_10); - _10 = _1; + _10 = copy _1; - _8 = Ne(move _9, move _10); + _8 = const false; StorageDead(_10); @@ -60,11 +60,11 @@ StorageLive(_11); StorageLive(_12); StorageLive(_13); - _13 = _1; + _13 = copy _1; StorageLive(_14); - _14 = _2; + _14 = copy _2; - _12 = Eq(move _13, move _14); -+ _12 = Eq(_1, _2); ++ _12 = Eq(copy _1, copy _2); StorageDead(_14); StorageDead(_13); _11 = opaque::(move _12) -> [return: bb3, unwind unreachable]; @@ -76,11 +76,11 @@ StorageLive(_15); StorageLive(_16); StorageLive(_17); - _17 = _1; + _17 = copy _1; StorageLive(_18); - _18 = _2; + _18 = copy _2; - _16 = Ne(move _17, move _18); -+ _16 = Ne(_1, _2); ++ _16 = Ne(copy _1, copy _2); StorageDead(_18); StorageDead(_17); _15 = opaque::(move _16) -> [return: bb4, unwind unreachable]; diff --git a/tests/mir-opt/gvn.comparison.GVN.panic-unwind.diff b/tests/mir-opt/gvn.comparison.GVN.panic-unwind.diff index 9f19b2b59fa54..416ae1ee5595d 100644 --- a/tests/mir-opt/gvn.comparison.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.comparison.GVN.panic-unwind.diff @@ -26,9 +26,9 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; StorageLive(_6); - _6 = _1; + _6 = copy _1; - _4 = Eq(move _5, move _6); + _4 = const true; StorageDead(_6); @@ -43,9 +43,9 @@ StorageLive(_7); StorageLive(_8); StorageLive(_9); - _9 = _1; + _9 = copy _1; StorageLive(_10); - _10 = _1; + _10 = copy _1; - _8 = Ne(move _9, move _10); + _8 = const false; StorageDead(_10); @@ -60,11 +60,11 @@ StorageLive(_11); StorageLive(_12); StorageLive(_13); - _13 = _1; + _13 = copy _1; StorageLive(_14); - _14 = _2; + _14 = copy _2; - _12 = Eq(move _13, move _14); -+ _12 = Eq(_1, _2); ++ _12 = Eq(copy _1, copy _2); StorageDead(_14); StorageDead(_13); _11 = opaque::(move _12) -> [return: bb3, unwind continue]; @@ -76,11 +76,11 @@ StorageLive(_15); StorageLive(_16); StorageLive(_17); - _17 = _1; + _17 = copy _1; StorageLive(_18); - _18 = _2; + _18 = copy _2; - _16 = Ne(move _17, move _18); -+ _16 = Ne(_1, _2); ++ _16 = Ne(copy _1, copy _2); StorageDead(_18); StorageDead(_17); _15 = opaque::(move _16) -> [return: bb4, unwind continue]; diff --git a/tests/mir-opt/gvn.constant_index_overflow.GVN.panic-abort.diff b/tests/mir-opt/gvn.constant_index_overflow.GVN.panic-abort.diff index c417c51f9b7de..3f052ee19fdfe 100644 --- a/tests/mir-opt/gvn.constant_index_overflow.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.constant_index_overflow.GVN.panic-abort.diff @@ -32,7 +32,7 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); -- _5 = _2; +- _5 = copy _2; + _5 = const usize::MAX; StorageLive(_6); StorageLive(_7); @@ -51,18 +51,18 @@ StorageDead(_6); StorageDead(_5); StorageLive(_8); -- _8 = _2; +- _8 = copy _2; + _8 = const usize::MAX; _9 = Len((*_1)); -- _10 = Lt(_8, _9); -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb3, unwind unreachable]; -+ _10 = Lt(const usize::MAX, _9); +- _10 = Lt(copy _8, copy _9); +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, copy _8) -> [success: bb3, unwind unreachable]; ++ _10 = Lt(const usize::MAX, copy _9); + assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, const usize::MAX) -> [success: bb3, unwind unreachable]; } bb3: { -- _3 = (*_1)[_8]; -+ _3 = (*_1)[_2]; +- _3 = copy (*_1)[_8]; ++ _3 = copy (*_1)[_2]; StorageDead(_8); goto -> bb6; } @@ -73,15 +73,15 @@ StorageLive(_11); _11 = const 0_usize; _12 = Len((*_1)); -- _13 = Lt(_11, _12); -- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> [success: bb5, unwind unreachable]; -+ _13 = Lt(const 0_usize, _12); +- _13 = Lt(copy _11, copy _12); +- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb5, unwind unreachable]; ++ _13 = Lt(const 0_usize, copy _12); + assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, const 0_usize) -> [success: bb5, unwind unreachable]; } bb5: { -- _3 = (*_1)[_11]; -+ _3 = (*_1)[0 of 1]; +- _3 = copy (*_1)[_11]; ++ _3 = copy (*_1)[0 of 1]; StorageDead(_11); goto -> bb6; } @@ -89,7 +89,7 @@ bb6: { StorageDead(_4); StorageLive(_14); - _14 = _3; + _14 = copy _3; _0 = opaque::(move _14) -> [return: bb7, unwind unreachable]; } diff --git a/tests/mir-opt/gvn.constant_index_overflow.GVN.panic-unwind.diff b/tests/mir-opt/gvn.constant_index_overflow.GVN.panic-unwind.diff index 7a23fbe7cc00e..84b738c7804e0 100644 --- a/tests/mir-opt/gvn.constant_index_overflow.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.constant_index_overflow.GVN.panic-unwind.diff @@ -32,7 +32,7 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); -- _5 = _2; +- _5 = copy _2; + _5 = const usize::MAX; StorageLive(_6); StorageLive(_7); @@ -51,18 +51,18 @@ StorageDead(_6); StorageDead(_5); StorageLive(_8); -- _8 = _2; +- _8 = copy _2; + _8 = const usize::MAX; _9 = Len((*_1)); -- _10 = Lt(_8, _9); -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb3, unwind continue]; -+ _10 = Lt(const usize::MAX, _9); +- _10 = Lt(copy _8, copy _9); +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, copy _8) -> [success: bb3, unwind continue]; ++ _10 = Lt(const usize::MAX, copy _9); + assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, const usize::MAX) -> [success: bb3, unwind continue]; } bb3: { -- _3 = (*_1)[_8]; -+ _3 = (*_1)[_2]; +- _3 = copy (*_1)[_8]; ++ _3 = copy (*_1)[_2]; StorageDead(_8); goto -> bb6; } @@ -73,15 +73,15 @@ StorageLive(_11); _11 = const 0_usize; _12 = Len((*_1)); -- _13 = Lt(_11, _12); -- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> [success: bb5, unwind continue]; -+ _13 = Lt(const 0_usize, _12); +- _13 = Lt(copy _11, copy _12); +- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb5, unwind continue]; ++ _13 = Lt(const 0_usize, copy _12); + assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, const 0_usize) -> [success: bb5, unwind continue]; } bb5: { -- _3 = (*_1)[_11]; -+ _3 = (*_1)[0 of 1]; +- _3 = copy (*_1)[_11]; ++ _3 = copy (*_1)[0 of 1]; StorageDead(_11); goto -> bb6; } @@ -89,7 +89,7 @@ bb6: { StorageDead(_4); StorageLive(_14); - _14 = _3; + _14 = copy _3; _0 = opaque::(move _14) -> [return: bb7, unwind continue]; } diff --git a/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff b/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff index 906835530d863..a763614dc644b 100644 --- a/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff @@ -48,7 +48,7 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = (*_1); + _5 = copy (*_1); _4 = opaque::(move _5) -> [return: bb1, unwind unreachable]; } @@ -57,7 +57,7 @@ StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = (*_1); + _7 = copy (*_1); _6 = opaque::(move _7) -> [return: bb2, unwind unreachable]; } @@ -68,7 +68,7 @@ _8 = &raw const (*_1); StorageLive(_9); StorageLive(_10); - _10 = (*_8); + _10 = copy (*_8); _9 = opaque::(move _10) -> [return: bb3, unwind unreachable]; } @@ -77,7 +77,7 @@ StorageDead(_9); StorageLive(_11); StorageLive(_12); - _12 = (*_8); + _12 = copy (*_8); _11 = opaque::(move _12) -> [return: bb4, unwind unreachable]; } @@ -88,7 +88,7 @@ _13 = &raw mut (*_1); StorageLive(_14); StorageLive(_15); - _15 = (*_13); + _15 = copy (*_13); _14 = opaque::(move _15) -> [return: bb5, unwind unreachable]; } @@ -97,7 +97,7 @@ StorageDead(_14); StorageLive(_16); StorageLive(_17); - _17 = (*_13); + _17 = copy (*_13); _16 = opaque::(move _17) -> [return: bb6, unwind unreachable]; } @@ -109,9 +109,9 @@ StorageLive(_19); - StorageLive(_20); + nop; - _20 = (*_18); + _20 = copy (*_18); - _19 = opaque::(move _20) -> [return: bb7, unwind unreachable]; -+ _19 = opaque::(_20) -> [return: bb7, unwind unreachable]; ++ _19 = opaque::(copy _20) -> [return: bb7, unwind unreachable]; } bb7: { @@ -120,10 +120,10 @@ StorageDead(_19); StorageLive(_21); StorageLive(_22); -- _22 = (*_18); +- _22 = copy (*_18); - _21 = opaque::(move _22) -> [return: bb8, unwind unreachable]; -+ _22 = _20; -+ _21 = opaque::(_20) -> [return: bb8, unwind unreachable]; ++ _22 = copy _20; ++ _21 = opaque::(copy _20) -> [return: bb8, unwind unreachable]; } bb8: { @@ -140,7 +140,7 @@ StorageDead(_23); StorageLive(_25); StorageLive(_26); - _26 = (*_2); + _26 = copy (*_2); _25 = opaque::(move _26) -> [return: bb10, unwind unreachable]; } @@ -149,7 +149,7 @@ StorageDead(_25); StorageLive(_27); StorageLive(_28); - _28 = (*_2); + _28 = copy (*_2); _27 = opaque::(move _28) -> [return: bb11, unwind unreachable]; } @@ -159,9 +159,9 @@ StorageLive(_29); - StorageLive(_30); + nop; - _30 = ((*_3).0: u32); + _30 = copy ((*_3).0: u32); - _29 = opaque::(move _30) -> [return: bb12, unwind unreachable]; -+ _29 = opaque::(_30) -> [return: bb12, unwind unreachable]; ++ _29 = opaque::(copy _30) -> [return: bb12, unwind unreachable]; } bb12: { @@ -170,10 +170,10 @@ StorageDead(_29); StorageLive(_31); StorageLive(_32); -- _32 = ((*_3).0: u32); +- _32 = copy ((*_3).0: u32); - _31 = opaque::(move _32) -> [return: bb13, unwind unreachable]; -+ _32 = _30; -+ _31 = opaque::(_30) -> [return: bb13, unwind unreachable]; ++ _32 = copy _30; ++ _31 = opaque::(copy _30) -> [return: bb13, unwind unreachable]; } bb13: { diff --git a/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff b/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff index 006b5da646c1c..ca6fda483642c 100644 --- a/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff @@ -48,7 +48,7 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = (*_1); + _5 = copy (*_1); _4 = opaque::(move _5) -> [return: bb1, unwind continue]; } @@ -57,7 +57,7 @@ StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = (*_1); + _7 = copy (*_1); _6 = opaque::(move _7) -> [return: bb2, unwind continue]; } @@ -68,7 +68,7 @@ _8 = &raw const (*_1); StorageLive(_9); StorageLive(_10); - _10 = (*_8); + _10 = copy (*_8); _9 = opaque::(move _10) -> [return: bb3, unwind continue]; } @@ -77,7 +77,7 @@ StorageDead(_9); StorageLive(_11); StorageLive(_12); - _12 = (*_8); + _12 = copy (*_8); _11 = opaque::(move _12) -> [return: bb4, unwind continue]; } @@ -88,7 +88,7 @@ _13 = &raw mut (*_1); StorageLive(_14); StorageLive(_15); - _15 = (*_13); + _15 = copy (*_13); _14 = opaque::(move _15) -> [return: bb5, unwind continue]; } @@ -97,7 +97,7 @@ StorageDead(_14); StorageLive(_16); StorageLive(_17); - _17 = (*_13); + _17 = copy (*_13); _16 = opaque::(move _17) -> [return: bb6, unwind continue]; } @@ -109,9 +109,9 @@ StorageLive(_19); - StorageLive(_20); + nop; - _20 = (*_18); + _20 = copy (*_18); - _19 = opaque::(move _20) -> [return: bb7, unwind continue]; -+ _19 = opaque::(_20) -> [return: bb7, unwind continue]; ++ _19 = opaque::(copy _20) -> [return: bb7, unwind continue]; } bb7: { @@ -120,10 +120,10 @@ StorageDead(_19); StorageLive(_21); StorageLive(_22); -- _22 = (*_18); +- _22 = copy (*_18); - _21 = opaque::(move _22) -> [return: bb8, unwind continue]; -+ _22 = _20; -+ _21 = opaque::(_20) -> [return: bb8, unwind continue]; ++ _22 = copy _20; ++ _21 = opaque::(copy _20) -> [return: bb8, unwind continue]; } bb8: { @@ -140,7 +140,7 @@ StorageDead(_23); StorageLive(_25); StorageLive(_26); - _26 = (*_2); + _26 = copy (*_2); _25 = opaque::(move _26) -> [return: bb10, unwind continue]; } @@ -149,7 +149,7 @@ StorageDead(_25); StorageLive(_27); StorageLive(_28); - _28 = (*_2); + _28 = copy (*_2); _27 = opaque::(move _28) -> [return: bb11, unwind continue]; } @@ -159,9 +159,9 @@ StorageLive(_29); - StorageLive(_30); + nop; - _30 = ((*_3).0: u32); + _30 = copy ((*_3).0: u32); - _29 = opaque::(move _30) -> [return: bb12, unwind continue]; -+ _29 = opaque::(_30) -> [return: bb12, unwind continue]; ++ _29 = opaque::(copy _30) -> [return: bb12, unwind continue]; } bb12: { @@ -170,10 +170,10 @@ StorageDead(_29); StorageLive(_31); StorageLive(_32); -- _32 = ((*_3).0: u32); +- _32 = copy ((*_3).0: u32); - _31 = opaque::(move _32) -> [return: bb13, unwind continue]; -+ _32 = _30; -+ _31 = opaque::(_30) -> [return: bb13, unwind continue]; ++ _32 = copy _30; ++ _31 = opaque::(copy _30) -> [return: bb13, unwind continue]; } bb13: { diff --git a/tests/mir-opt/gvn.duplicate_slice.GVN.panic-abort.diff b/tests/mir-opt/gvn.duplicate_slice.GVN.panic-abort.diff index 7ae1fae68e887..18c2897d52870 100644 --- a/tests/mir-opt/gvn.duplicate_slice.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.duplicate_slice.GVN.panic-abort.diff @@ -16,22 +16,22 @@ bb0: { _7 = (const "a",); - _1 = (_7.0: &str) as u128 (Transmute); - _5 = identity::<&str>((_7.0: &str)) -> [return: bb1, unwind unreachable]; + _1 = copy (_7.0: &str) as u128 (Transmute); + _5 = identity::<&str>(copy (_7.0: &str)) -> [return: bb1, unwind unreachable]; } bb1: { - _3 = _5 as u128 (Transmute); + _3 = copy _5 as u128 (Transmute); _8 = const "a"; - _2 = _8 as u128 (Transmute); - _6 = identity::<&str>(_8) -> [return: bb2, unwind unreachable]; + _2 = copy _8 as u128 (Transmute); + _6 = identity::<&str>(copy _8) -> [return: bb2, unwind unreachable]; } bb2: { - _4 = _6 as u128 (Transmute); - _9 = Eq(_1, _2); - _10 = Eq(_3, _4); - _0 = (_9, _10); + _4 = copy _6 as u128 (Transmute); + _9 = Eq(copy _1, copy _2); + _10 = Eq(copy _3, copy _4); + _0 = (copy _9, copy _10); return; } } diff --git a/tests/mir-opt/gvn.duplicate_slice.GVN.panic-unwind.diff b/tests/mir-opt/gvn.duplicate_slice.GVN.panic-unwind.diff index 8c96edaa280ea..55f382e926e7a 100644 --- a/tests/mir-opt/gvn.duplicate_slice.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.duplicate_slice.GVN.panic-unwind.diff @@ -16,22 +16,22 @@ bb0: { _7 = (const "a",); - _1 = (_7.0: &str) as u128 (Transmute); - _5 = identity::<&str>((_7.0: &str)) -> [return: bb1, unwind continue]; + _1 = copy (_7.0: &str) as u128 (Transmute); + _5 = identity::<&str>(copy (_7.0: &str)) -> [return: bb1, unwind continue]; } bb1: { - _3 = _5 as u128 (Transmute); + _3 = copy _5 as u128 (Transmute); _8 = const "a"; - _2 = _8 as u128 (Transmute); - _6 = identity::<&str>(_8) -> [return: bb2, unwind continue]; + _2 = copy _8 as u128 (Transmute); + _6 = identity::<&str>(copy _8) -> [return: bb2, unwind continue]; } bb2: { - _4 = _6 as u128 (Transmute); - _9 = Eq(_1, _2); - _10 = Eq(_3, _4); - _0 = (_9, _10); + _4 = copy _6 as u128 (Transmute); + _9 = Eq(copy _1, copy _2); + _10 = Eq(copy _3, copy _4); + _0 = (copy _9, copy _10); return; } } diff --git a/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff b/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff index b5c0cee784688..42075d11b6cd6 100644 --- a/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff @@ -40,9 +40,9 @@ _1 = identity:: as fn(u8) -> u8 (PointerCoercion(ReifyFnPointer)); StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = opaque:: u8>(move _3) -> [return: bb1, unwind unreachable]; -+ _2 = opaque:: u8>(_1) -> [return: bb1, unwind unreachable]; ++ _2 = opaque:: u8>(copy _1) -> [return: bb1, unwind unreachable]; } bb1: { @@ -53,9 +53,9 @@ _4 = identity:: as fn(u8) -> u8 (PointerCoercion(ReifyFnPointer)); StorageLive(_5); StorageLive(_6); - _6 = _4; + _6 = copy _4; - _5 = opaque:: u8>(move _6) -> [return: bb2, unwind unreachable]; -+ _5 = opaque:: u8>(_4) -> [return: bb2, unwind unreachable]; ++ _5 = opaque:: u8>(copy _4) -> [return: bb2, unwind unreachable]; } bb2: { @@ -68,16 +68,16 @@ + _7 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; + nop; StorageLive(_9); -- _9 = _7; +- _9 = copy _7; - _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe))); + _9 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; + _8 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); StorageDead(_9); StorageLive(_10); StorageLive(_11); - _11 = _8; + _11 = copy _8; - _10 = opaque::(move _11) -> [return: bb3, unwind unreachable]; -+ _10 = opaque::(_8) -> [return: bb3, unwind unreachable]; ++ _10 = opaque::(copy _8) -> [return: bb3, unwind unreachable]; } bb3: { @@ -86,16 +86,16 @@ - StorageLive(_12); + nop; StorageLive(_13); -- _13 = _7; +- _13 = copy _7; - _12 = move _13 as fn() (PointerCoercion(ClosureFnPointer(Safe))); + _13 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; + _12 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); StorageDead(_13); StorageLive(_14); StorageLive(_15); - _15 = _12; + _15 = copy _12; - _14 = opaque::(move _15) -> [return: bb4, unwind unreachable]; -+ _14 = opaque::(_12) -> [return: bb4, unwind unreachable]; ++ _14 = opaque::(copy _12) -> [return: bb4, unwind unreachable]; } bb4: { diff --git a/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff b/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff index 7bc6573c13d4d..f6ad045bbfa05 100644 --- a/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff @@ -40,9 +40,9 @@ _1 = identity:: as fn(u8) -> u8 (PointerCoercion(ReifyFnPointer)); StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = opaque:: u8>(move _3) -> [return: bb1, unwind continue]; -+ _2 = opaque:: u8>(_1) -> [return: bb1, unwind continue]; ++ _2 = opaque:: u8>(copy _1) -> [return: bb1, unwind continue]; } bb1: { @@ -53,9 +53,9 @@ _4 = identity:: as fn(u8) -> u8 (PointerCoercion(ReifyFnPointer)); StorageLive(_5); StorageLive(_6); - _6 = _4; + _6 = copy _4; - _5 = opaque:: u8>(move _6) -> [return: bb2, unwind continue]; -+ _5 = opaque:: u8>(_4) -> [return: bb2, unwind continue]; ++ _5 = opaque:: u8>(copy _4) -> [return: bb2, unwind continue]; } bb2: { @@ -68,16 +68,16 @@ + _7 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; + nop; StorageLive(_9); -- _9 = _7; +- _9 = copy _7; - _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe))); + _9 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; + _8 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); StorageDead(_9); StorageLive(_10); StorageLive(_11); - _11 = _8; + _11 = copy _8; - _10 = opaque::(move _11) -> [return: bb3, unwind continue]; -+ _10 = opaque::(_8) -> [return: bb3, unwind continue]; ++ _10 = opaque::(copy _8) -> [return: bb3, unwind continue]; } bb3: { @@ -86,16 +86,16 @@ - StorageLive(_12); + nop; StorageLive(_13); -- _13 = _7; +- _13 = copy _7; - _12 = move _13 as fn() (PointerCoercion(ClosureFnPointer(Safe))); + _13 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; + _12 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); StorageDead(_13); StorageLive(_14); StorageLive(_15); - _15 = _12; + _15 = copy _12; - _14 = opaque::(move _15) -> [return: bb4, unwind continue]; -+ _14 = opaque::(_12) -> [return: bb4, unwind continue]; ++ _14 = opaque::(copy _12) -> [return: bb4, unwind continue]; } bb4: { diff --git a/tests/mir-opt/gvn.generic_cast_metadata.GVN.panic-abort.diff b/tests/mir-opt/gvn.generic_cast_metadata.GVN.panic-abort.diff index 1d462a8a23c2e..770c673077533 100644 --- a/tests/mir-opt/gvn.generic_cast_metadata.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.generic_cast_metadata.GVN.panic-abort.diff @@ -17,21 +17,21 @@ let mut _15: ::Metadata; bb0: { - _4 = _1 as *const T (PtrToPtr); - _5 = PtrMetadata(_4); - _6 = _1 as *const (&A, [T]) (PtrToPtr); -- _7 = PtrMetadata(_6); -+ _7 = PtrMetadata(_1); - _8 = _2 as *const (T, B) (PtrToPtr); - _9 = PtrMetadata(_8); - _10 = _2 as *const (T, A) (PtrToPtr); -- _11 = PtrMetadata(_10); -+ _11 = PtrMetadata(_2); - _12 = _3 as *mut A (PtrToPtr); - _13 = PtrMetadata(_12); - _14 = _3 as *mut B (PtrToPtr); -- _15 = PtrMetadata(_14); -+ _15 = PtrMetadata(_3); + _4 = copy _1 as *const T (PtrToPtr); + _5 = PtrMetadata(copy _4); + _6 = copy _1 as *const (&A, [T]) (PtrToPtr); +- _7 = PtrMetadata(copy _6); ++ _7 = PtrMetadata(copy _1); + _8 = copy _2 as *const (T, B) (PtrToPtr); + _9 = PtrMetadata(copy _8); + _10 = copy _2 as *const (T, A) (PtrToPtr); +- _11 = PtrMetadata(copy _10); ++ _11 = PtrMetadata(copy _2); + _12 = copy _3 as *mut A (PtrToPtr); + _13 = PtrMetadata(copy _12); + _14 = copy _3 as *mut B (PtrToPtr); +- _15 = PtrMetadata(copy _14); ++ _15 = PtrMetadata(copy _3); return; } } diff --git a/tests/mir-opt/gvn.generic_cast_metadata.GVN.panic-unwind.diff b/tests/mir-opt/gvn.generic_cast_metadata.GVN.panic-unwind.diff index 1d462a8a23c2e..770c673077533 100644 --- a/tests/mir-opt/gvn.generic_cast_metadata.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.generic_cast_metadata.GVN.panic-unwind.diff @@ -17,21 +17,21 @@ let mut _15: ::Metadata; bb0: { - _4 = _1 as *const T (PtrToPtr); - _5 = PtrMetadata(_4); - _6 = _1 as *const (&A, [T]) (PtrToPtr); -- _7 = PtrMetadata(_6); -+ _7 = PtrMetadata(_1); - _8 = _2 as *const (T, B) (PtrToPtr); - _9 = PtrMetadata(_8); - _10 = _2 as *const (T, A) (PtrToPtr); -- _11 = PtrMetadata(_10); -+ _11 = PtrMetadata(_2); - _12 = _3 as *mut A (PtrToPtr); - _13 = PtrMetadata(_12); - _14 = _3 as *mut B (PtrToPtr); -- _15 = PtrMetadata(_14); -+ _15 = PtrMetadata(_3); + _4 = copy _1 as *const T (PtrToPtr); + _5 = PtrMetadata(copy _4); + _6 = copy _1 as *const (&A, [T]) (PtrToPtr); +- _7 = PtrMetadata(copy _6); ++ _7 = PtrMetadata(copy _1); + _8 = copy _2 as *const (T, B) (PtrToPtr); + _9 = PtrMetadata(copy _8); + _10 = copy _2 as *const (T, A) (PtrToPtr); +- _11 = PtrMetadata(copy _10); ++ _11 = PtrMetadata(copy _2); + _12 = copy _3 as *mut A (PtrToPtr); + _13 = PtrMetadata(copy _12); + _14 = copy _3 as *mut B (PtrToPtr); +- _15 = PtrMetadata(copy _14); ++ _15 = PtrMetadata(copy _3); return; } } diff --git a/tests/mir-opt/gvn.indirect_static.GVN.panic-abort.diff b/tests/mir-opt/gvn.indirect_static.GVN.panic-abort.diff index e84f91e495d9c..97f41f89fb243 100644 --- a/tests/mir-opt/gvn.indirect_static.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.indirect_static.GVN.panic-abort.diff @@ -8,7 +8,7 @@ bb0: { _1 = const {ALLOC0: &Option}; - _2 = (((*_1) as variant#1).0: u8); + _2 = copy (((*_1) as variant#1).0: u8); return; } } diff --git a/tests/mir-opt/gvn.indirect_static.GVN.panic-unwind.diff b/tests/mir-opt/gvn.indirect_static.GVN.panic-unwind.diff index e84f91e495d9c..97f41f89fb243 100644 --- a/tests/mir-opt/gvn.indirect_static.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.indirect_static.GVN.panic-unwind.diff @@ -8,7 +8,7 @@ bb0: { _1 = const {ALLOC0: &Option}; - _2 = (((*_1) as variant#1).0: u8); + _2 = copy (((*_1) as variant#1).0: u8); return; } } diff --git a/tests/mir-opt/gvn.manual_slice_mut_len.GVN.panic-abort.diff b/tests/mir-opt/gvn.manual_slice_mut_len.GVN.panic-abort.diff index c877d8a3c0e54..936fa3db82a73 100644 --- a/tests/mir-opt/gvn.manual_slice_mut_len.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.manual_slice_mut_len.GVN.panic-abort.diff @@ -22,14 +22,14 @@ - StorageLive(_3); + nop; StorageLive(_4); - _4 = _2; + _4 = copy _2; - _3 = move _4 as *const [i32] (PtrToPtr); -+ _3 = _2 as *const [i32] (PtrToPtr); ++ _3 = copy _2 as *const [i32] (PtrToPtr); StorageDead(_4); StorageLive(_5); - _5 = _3; + _5 = copy _3; - _0 = PtrMetadata(move _5); -+ _0 = PtrMetadata(_1); ++ _0 = PtrMetadata(copy _1); StorageDead(_5); - StorageDead(_3); - StorageDead(_2); diff --git a/tests/mir-opt/gvn.manual_slice_mut_len.GVN.panic-unwind.diff b/tests/mir-opt/gvn.manual_slice_mut_len.GVN.panic-unwind.diff index c877d8a3c0e54..936fa3db82a73 100644 --- a/tests/mir-opt/gvn.manual_slice_mut_len.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.manual_slice_mut_len.GVN.panic-unwind.diff @@ -22,14 +22,14 @@ - StorageLive(_3); + nop; StorageLive(_4); - _4 = _2; + _4 = copy _2; - _3 = move _4 as *const [i32] (PtrToPtr); -+ _3 = _2 as *const [i32] (PtrToPtr); ++ _3 = copy _2 as *const [i32] (PtrToPtr); StorageDead(_4); StorageLive(_5); - _5 = _3; + _5 = copy _3; - _0 = PtrMetadata(move _5); -+ _0 = PtrMetadata(_1); ++ _0 = PtrMetadata(copy _1); StorageDead(_5); - StorageDead(_3); - StorageDead(_2); diff --git a/tests/mir-opt/gvn.meta_of_ref_to_slice.GVN.panic-abort.diff b/tests/mir-opt/gvn.meta_of_ref_to_slice.GVN.panic-abort.diff index 73dbabb56b353..3ed6c2b5308fb 100644 --- a/tests/mir-opt/gvn.meta_of_ref_to_slice.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.meta_of_ref_to_slice.GVN.panic-abort.diff @@ -15,12 +15,12 @@ - StorageLive(_2); + nop; StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = *const [i32] from (move _3, const 1_usize); -+ _2 = *const [i32] from (_1, const 1_usize); ++ _2 = *const [i32] from (copy _1, const 1_usize); StorageDead(_3); StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = PtrMetadata(move _4); + _0 = const 1_usize; StorageDead(_4); diff --git a/tests/mir-opt/gvn.meta_of_ref_to_slice.GVN.panic-unwind.diff b/tests/mir-opt/gvn.meta_of_ref_to_slice.GVN.panic-unwind.diff index 73dbabb56b353..3ed6c2b5308fb 100644 --- a/tests/mir-opt/gvn.meta_of_ref_to_slice.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.meta_of_ref_to_slice.GVN.panic-unwind.diff @@ -15,12 +15,12 @@ - StorageLive(_2); + nop; StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = *const [i32] from (move _3, const 1_usize); -+ _2 = *const [i32] from (_1, const 1_usize); ++ _2 = *const [i32] from (copy _1, const 1_usize); StorageDead(_3); StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = PtrMetadata(move _4); + _0 = const 1_usize; StorageDead(_4); diff --git a/tests/mir-opt/gvn.multiple_branches.GVN.panic-abort.diff b/tests/mir-opt/gvn.multiple_branches.GVN.panic-abort.diff index 29ca1ba5902e1..f300ce7e8846f 100644 --- a/tests/mir-opt/gvn.multiple_branches.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.multiple_branches.GVN.panic-abort.diff @@ -41,9 +41,9 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - switchInt(move _5) -> [0: bb4, otherwise: bb1]; -+ switchInt(_1) -> [0: bb4, otherwise: bb1]; ++ switchInt(copy _1) -> [0: bb4, otherwise: bb1]; } bb1: { @@ -51,15 +51,15 @@ - StorageLive(_7); + nop; StorageLive(_8); - _8 = _2; + _8 = copy _2; StorageLive(_9); - _9 = _3; + _9 = copy _3; - _7 = Add(move _8, move _9); -+ _7 = Add(_2, _3); ++ _7 = Add(copy _2, copy _3); StorageDead(_9); StorageDead(_8); - _6 = opaque::(move _7) -> [return: bb2, unwind unreachable]; -+ _6 = opaque::(_7) -> [return: bb2, unwind unreachable]; ++ _6 = opaque::(copy _7) -> [return: bb2, unwind unreachable]; } bb2: { @@ -69,15 +69,15 @@ StorageLive(_10); StorageLive(_11); StorageLive(_12); - _12 = _2; + _12 = copy _2; StorageLive(_13); - _13 = _3; + _13 = copy _3; - _11 = Add(move _12, move _13); -+ _11 = _7; ++ _11 = copy _7; StorageDead(_13); StorageDead(_12); - _10 = opaque::(move _11) -> [return: bb3, unwind unreachable]; -+ _10 = opaque::(_7) -> [return: bb3, unwind unreachable]; ++ _10 = opaque::(copy _7) -> [return: bb3, unwind unreachable]; } bb3: { @@ -92,15 +92,15 @@ - StorageLive(_15); + nop; StorageLive(_16); - _16 = _2; + _16 = copy _2; StorageLive(_17); - _17 = _3; + _17 = copy _3; - _15 = Add(move _16, move _17); -+ _15 = Add(_2, _3); ++ _15 = Add(copy _2, copy _3); StorageDead(_17); StorageDead(_16); - _14 = opaque::(move _15) -> [return: bb5, unwind unreachable]; -+ _14 = opaque::(_15) -> [return: bb5, unwind unreachable]; ++ _14 = opaque::(copy _15) -> [return: bb5, unwind unreachable]; } bb5: { @@ -110,15 +110,15 @@ StorageLive(_18); StorageLive(_19); StorageLive(_20); - _20 = _2; + _20 = copy _2; StorageLive(_21); - _21 = _3; + _21 = copy _3; - _19 = Add(move _20, move _21); -+ _19 = _15; ++ _19 = copy _15; StorageDead(_21); StorageDead(_20); - _18 = opaque::(move _19) -> [return: bb6, unwind unreachable]; -+ _18 = opaque::(_15) -> [return: bb6, unwind unreachable]; ++ _18 = opaque::(copy _15) -> [return: bb6, unwind unreachable]; } bb6: { @@ -135,15 +135,15 @@ - StorageLive(_23); + nop; StorageLive(_24); - _24 = _2; + _24 = copy _2; StorageLive(_25); - _25 = _3; + _25 = copy _3; - _23 = Add(move _24, move _25); -+ _23 = Add(_2, _3); ++ _23 = Add(copy _2, copy _3); StorageDead(_25); StorageDead(_24); - _22 = opaque::(move _23) -> [return: bb8, unwind unreachable]; -+ _22 = opaque::(_23) -> [return: bb8, unwind unreachable]; ++ _22 = opaque::(copy _23) -> [return: bb8, unwind unreachable]; } bb8: { @@ -151,24 +151,24 @@ + nop; StorageDead(_22); StorageLive(_26); - _26 = _1; + _26 = copy _1; - switchInt(move _26) -> [0: bb11, otherwise: bb9]; -+ switchInt(_1) -> [0: bb11, otherwise: bb9]; ++ switchInt(copy _1) -> [0: bb11, otherwise: bb9]; } bb9: { StorageLive(_27); StorageLive(_28); StorageLive(_29); - _29 = _2; + _29 = copy _2; StorageLive(_30); - _30 = _3; + _30 = copy _3; - _28 = Add(move _29, move _30); -+ _28 = _23; ++ _28 = copy _23; StorageDead(_30); StorageDead(_29); - _27 = opaque::(move _28) -> [return: bb10, unwind unreachable]; -+ _27 = opaque::(_23) -> [return: bb10, unwind unreachable]; ++ _27 = opaque::(copy _23) -> [return: bb10, unwind unreachable]; } bb10: { @@ -182,15 +182,15 @@ StorageLive(_31); StorageLive(_32); StorageLive(_33); - _33 = _2; + _33 = copy _2; StorageLive(_34); - _34 = _3; + _34 = copy _3; - _32 = Add(move _33, move _34); -+ _32 = _23; ++ _32 = copy _23; StorageDead(_34); StorageDead(_33); - _31 = opaque::(move _32) -> [return: bb12, unwind unreachable]; -+ _31 = opaque::(_23) -> [return: bb12, unwind unreachable]; ++ _31 = opaque::(copy _23) -> [return: bb12, unwind unreachable]; } bb12: { diff --git a/tests/mir-opt/gvn.multiple_branches.GVN.panic-unwind.diff b/tests/mir-opt/gvn.multiple_branches.GVN.panic-unwind.diff index 5394dc8be8a04..f34765534cc8c 100644 --- a/tests/mir-opt/gvn.multiple_branches.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.multiple_branches.GVN.panic-unwind.diff @@ -41,9 +41,9 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - switchInt(move _5) -> [0: bb4, otherwise: bb1]; -+ switchInt(_1) -> [0: bb4, otherwise: bb1]; ++ switchInt(copy _1) -> [0: bb4, otherwise: bb1]; } bb1: { @@ -51,15 +51,15 @@ - StorageLive(_7); + nop; StorageLive(_8); - _8 = _2; + _8 = copy _2; StorageLive(_9); - _9 = _3; + _9 = copy _3; - _7 = Add(move _8, move _9); -+ _7 = Add(_2, _3); ++ _7 = Add(copy _2, copy _3); StorageDead(_9); StorageDead(_8); - _6 = opaque::(move _7) -> [return: bb2, unwind continue]; -+ _6 = opaque::(_7) -> [return: bb2, unwind continue]; ++ _6 = opaque::(copy _7) -> [return: bb2, unwind continue]; } bb2: { @@ -69,15 +69,15 @@ StorageLive(_10); StorageLive(_11); StorageLive(_12); - _12 = _2; + _12 = copy _2; StorageLive(_13); - _13 = _3; + _13 = copy _3; - _11 = Add(move _12, move _13); -+ _11 = _7; ++ _11 = copy _7; StorageDead(_13); StorageDead(_12); - _10 = opaque::(move _11) -> [return: bb3, unwind continue]; -+ _10 = opaque::(_7) -> [return: bb3, unwind continue]; ++ _10 = opaque::(copy _7) -> [return: bb3, unwind continue]; } bb3: { @@ -92,15 +92,15 @@ - StorageLive(_15); + nop; StorageLive(_16); - _16 = _2; + _16 = copy _2; StorageLive(_17); - _17 = _3; + _17 = copy _3; - _15 = Add(move _16, move _17); -+ _15 = Add(_2, _3); ++ _15 = Add(copy _2, copy _3); StorageDead(_17); StorageDead(_16); - _14 = opaque::(move _15) -> [return: bb5, unwind continue]; -+ _14 = opaque::(_15) -> [return: bb5, unwind continue]; ++ _14 = opaque::(copy _15) -> [return: bb5, unwind continue]; } bb5: { @@ -110,15 +110,15 @@ StorageLive(_18); StorageLive(_19); StorageLive(_20); - _20 = _2; + _20 = copy _2; StorageLive(_21); - _21 = _3; + _21 = copy _3; - _19 = Add(move _20, move _21); -+ _19 = _15; ++ _19 = copy _15; StorageDead(_21); StorageDead(_20); - _18 = opaque::(move _19) -> [return: bb6, unwind continue]; -+ _18 = opaque::(_15) -> [return: bb6, unwind continue]; ++ _18 = opaque::(copy _15) -> [return: bb6, unwind continue]; } bb6: { @@ -135,15 +135,15 @@ - StorageLive(_23); + nop; StorageLive(_24); - _24 = _2; + _24 = copy _2; StorageLive(_25); - _25 = _3; + _25 = copy _3; - _23 = Add(move _24, move _25); -+ _23 = Add(_2, _3); ++ _23 = Add(copy _2, copy _3); StorageDead(_25); StorageDead(_24); - _22 = opaque::(move _23) -> [return: bb8, unwind continue]; -+ _22 = opaque::(_23) -> [return: bb8, unwind continue]; ++ _22 = opaque::(copy _23) -> [return: bb8, unwind continue]; } bb8: { @@ -151,24 +151,24 @@ + nop; StorageDead(_22); StorageLive(_26); - _26 = _1; + _26 = copy _1; - switchInt(move _26) -> [0: bb11, otherwise: bb9]; -+ switchInt(_1) -> [0: bb11, otherwise: bb9]; ++ switchInt(copy _1) -> [0: bb11, otherwise: bb9]; } bb9: { StorageLive(_27); StorageLive(_28); StorageLive(_29); - _29 = _2; + _29 = copy _2; StorageLive(_30); - _30 = _3; + _30 = copy _3; - _28 = Add(move _29, move _30); -+ _28 = _23; ++ _28 = copy _23; StorageDead(_30); StorageDead(_29); - _27 = opaque::(move _28) -> [return: bb10, unwind continue]; -+ _27 = opaque::(_23) -> [return: bb10, unwind continue]; ++ _27 = opaque::(copy _23) -> [return: bb10, unwind continue]; } bb10: { @@ -182,15 +182,15 @@ StorageLive(_31); StorageLive(_32); StorageLive(_33); - _33 = _2; + _33 = copy _2; StorageLive(_34); - _34 = _3; + _34 = copy _3; - _32 = Add(move _33, move _34); -+ _32 = _23; ++ _32 = copy _23; StorageDead(_34); StorageDead(_33); - _31 = opaque::(move _32) -> [return: bb12, unwind continue]; -+ _31 = opaque::(_23) -> [return: bb12, unwind continue]; ++ _31 = opaque::(copy _23) -> [return: bb12, unwind continue]; } bb12: { diff --git a/tests/mir-opt/gvn.non_freeze.GVN.panic-abort.diff b/tests/mir-opt/gvn.non_freeze.GVN.panic-abort.diff index 7b6ed09611846..377b4d7670cdf 100644 --- a/tests/mir-opt/gvn.non_freeze.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.non_freeze.GVN.panic-abort.diff @@ -7,17 +7,17 @@ let mut _3: &T; bb0: { - _2 = _1; + _2 = copy _1; _3 = &_1; - _0 = opaque::<&T>(_3) -> [return: bb1, unwind unreachable]; + _0 = opaque::<&T>(copy _3) -> [return: bb1, unwind unreachable]; } bb1: { - _0 = opaque::(_2) -> [return: bb2, unwind unreachable]; + _0 = opaque::(copy _2) -> [return: bb2, unwind unreachable]; } bb2: { - _0 = opaque::((*_3)) -> [return: bb3, unwind unreachable]; + _0 = opaque::(copy (*_3)) -> [return: bb3, unwind unreachable]; } bb3: { diff --git a/tests/mir-opt/gvn.non_freeze.GVN.panic-unwind.diff b/tests/mir-opt/gvn.non_freeze.GVN.panic-unwind.diff index 641a2f4609acf..988eee07cc98f 100644 --- a/tests/mir-opt/gvn.non_freeze.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.non_freeze.GVN.panic-unwind.diff @@ -7,17 +7,17 @@ let mut _3: &T; bb0: { - _2 = _1; + _2 = copy _1; _3 = &_1; - _0 = opaque::<&T>(_3) -> [return: bb1, unwind continue]; + _0 = opaque::<&T>(copy _3) -> [return: bb1, unwind continue]; } bb1: { - _0 = opaque::(_2) -> [return: bb2, unwind continue]; + _0 = opaque::(copy _2) -> [return: bb2, unwind continue]; } bb2: { - _0 = opaque::((*_3)) -> [return: bb3, unwind continue]; + _0 = opaque::(copy (*_3)) -> [return: bb3, unwind continue]; } bb3: { diff --git a/tests/mir-opt/gvn.references.GVN.panic-abort.diff b/tests/mir-opt/gvn.references.GVN.panic-abort.diff index 7799c61144526..62a487dee8215 100644 --- a/tests/mir-opt/gvn.references.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.references.GVN.panic-abort.diff @@ -120,11 +120,11 @@ StorageLive(_21); - _21 = move _18; - _20 = S::<&mut impl Sized>(move _21); -+ _21 = _18; -+ _20 = S::<&mut impl Sized>(_18); ++ _21 = copy _18; ++ _20 = S::<&mut impl Sized>(copy _18); StorageDead(_21); - _19 = move (_20.0: &mut impl Sized); -+ _19 = _18; ++ _19 = copy _18; StorageDead(_20); StorageLive(_22); StorageLive(_23); diff --git a/tests/mir-opt/gvn.references.GVN.panic-unwind.diff b/tests/mir-opt/gvn.references.GVN.panic-unwind.diff index 880e7913fa94c..6dd986907fcc6 100644 --- a/tests/mir-opt/gvn.references.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.references.GVN.panic-unwind.diff @@ -120,11 +120,11 @@ StorageLive(_21); - _21 = move _18; - _20 = S::<&mut impl Sized>(move _21); -+ _21 = _18; -+ _20 = S::<&mut impl Sized>(_18); ++ _21 = copy _18; ++ _20 = S::<&mut impl Sized>(copy _18); StorageDead(_21); - _19 = move (_20.0: &mut impl Sized); -+ _19 = _18; ++ _19 = copy _18; StorageDead(_20); StorageLive(_22); StorageLive(_23); diff --git a/tests/mir-opt/gvn.remove_casts_must_change_both_sides.GVN.panic-abort.diff b/tests/mir-opt/gvn.remove_casts_must_change_both_sides.GVN.panic-abort.diff index 8b4bfb70401b3..98cb34810bc0c 100644 --- a/tests/mir-opt/gvn.remove_casts_must_change_both_sides.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.remove_casts_must_change_both_sides.GVN.panic-abort.diff @@ -7,9 +7,9 @@ let mut _4: *const u8; bb0: { - _3 = (*_1) as *const u8 (PtrToPtr); - _4 = _2 as *const u8 (PtrToPtr); - _0 = Eq(_3, _4); + _3 = copy (*_1) as *const u8 (PtrToPtr); + _4 = copy _2 as *const u8 (PtrToPtr); + _0 = Eq(copy _3, copy _4); return; } } diff --git a/tests/mir-opt/gvn.remove_casts_must_change_both_sides.GVN.panic-unwind.diff b/tests/mir-opt/gvn.remove_casts_must_change_both_sides.GVN.panic-unwind.diff index 8b4bfb70401b3..98cb34810bc0c 100644 --- a/tests/mir-opt/gvn.remove_casts_must_change_both_sides.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.remove_casts_must_change_both_sides.GVN.panic-unwind.diff @@ -7,9 +7,9 @@ let mut _4: *const u8; bb0: { - _3 = (*_1) as *const u8 (PtrToPtr); - _4 = _2 as *const u8 (PtrToPtr); - _0 = Eq(_3, _4); + _3 = copy (*_1) as *const u8 (PtrToPtr); + _4 = copy _2 as *const u8 (PtrToPtr); + _0 = Eq(copy _3, copy _4); return; } } diff --git a/tests/mir-opt/gvn.repeat.GVN.panic-abort.diff b/tests/mir-opt/gvn.repeat.GVN.panic-abort.diff index 37915f8578d21..ef2eb1a66779d 100644 --- a/tests/mir-opt/gvn.repeat.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.repeat.GVN.panic-abort.diff @@ -28,34 +28,34 @@ _1 = const 5_i32; StorageLive(_2); StorageLive(_3); -- _3 = _1; +- _3 = copy _1; + _3 = const 5_i32; StorageLive(_4); -- _4 = _1; +- _4 = copy _1; + _4 = const 5_i32; StorageLive(_5); -- _5 = _1; +- _5 = copy _1; + _5 = const 5_i32; StorageLive(_6); -- _6 = _1; +- _6 = copy _1; + _6 = const 5_i32; StorageLive(_7); -- _7 = _1; +- _7 = copy _1; + _7 = const 5_i32; StorageLive(_8); -- _8 = _1; +- _8 = copy _1; + _8 = const 5_i32; StorageLive(_9); -- _9 = _1; +- _9 = copy _1; + _9 = const 5_i32; StorageLive(_10); -- _10 = _1; +- _10 = copy _1; + _10 = const 5_i32; StorageLive(_11); -- _11 = _1; +- _11 = copy _1; + _11 = const 5_i32; StorageLive(_12); -- _12 = _1; +- _12 = copy _1; - _2 = [move _3, move _4, move _5, move _6, move _7, move _8, move _9, move _10, move _11, move _12]; + _12 = const 5_i32; + _2 = [const 5_i32; 10]; diff --git a/tests/mir-opt/gvn.repeat.GVN.panic-unwind.diff b/tests/mir-opt/gvn.repeat.GVN.panic-unwind.diff index 37915f8578d21..ef2eb1a66779d 100644 --- a/tests/mir-opt/gvn.repeat.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.repeat.GVN.panic-unwind.diff @@ -28,34 +28,34 @@ _1 = const 5_i32; StorageLive(_2); StorageLive(_3); -- _3 = _1; +- _3 = copy _1; + _3 = const 5_i32; StorageLive(_4); -- _4 = _1; +- _4 = copy _1; + _4 = const 5_i32; StorageLive(_5); -- _5 = _1; +- _5 = copy _1; + _5 = const 5_i32; StorageLive(_6); -- _6 = _1; +- _6 = copy _1; + _6 = const 5_i32; StorageLive(_7); -- _7 = _1; +- _7 = copy _1; + _7 = const 5_i32; StorageLive(_8); -- _8 = _1; +- _8 = copy _1; + _8 = const 5_i32; StorageLive(_9); -- _9 = _1; +- _9 = copy _1; + _9 = const 5_i32; StorageLive(_10); -- _10 = _1; +- _10 = copy _1; + _10 = const 5_i32; StorageLive(_11); -- _11 = _1; +- _11 = copy _1; + _11 = const 5_i32; StorageLive(_12); -- _12 = _1; +- _12 = copy _1; - _2 = [move _3, move _4, move _5, move _6, move _7, move _8, move _9, move _10, move _11, move _12]; + _12 = const 5_i32; + _2 = [const 5_i32; 10]; diff --git a/tests/mir-opt/gvn.repeated_index.GVN.panic-abort.diff b/tests/mir-opt/gvn.repeated_index.GVN.panic-abort.diff index 8ce05c9b340fe..d4b22d05f6c78 100644 --- a/tests/mir-opt/gvn.repeated_index.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.repeated_index.GVN.panic-abort.diff @@ -24,27 +24,27 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; - _3 = [move _4; N]; -+ _3 = [_1; N]; ++ _3 = [copy _1; N]; StorageDead(_4); StorageLive(_5); StorageLive(_6); StorageLive(_7); _7 = const 0_usize; - _8 = Len(_3); -- _9 = Lt(_7, _8); -- assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb1, unwind unreachable]; +- _9 = Lt(copy _7, copy _8); +- assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb1, unwind unreachable]; + _8 = const N; + _9 = Lt(const 0_usize, const N); + assert(move _9, "index out of bounds: the length is {} but the index is {}", const N, const 0_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _6 = _3[_7]; +- _6 = copy _3[_7]; - _5 = opaque::(move _6) -> [return: bb2, unwind unreachable]; -+ _6 = _1; -+ _5 = opaque::(_1) -> [return: bb2, unwind unreachable]; ++ _6 = copy _1; ++ _5 = opaque::(copy _1) -> [return: bb2, unwind unreachable]; } bb2: { @@ -54,20 +54,20 @@ StorageLive(_10); StorageLive(_11); StorageLive(_12); - _12 = _2; + _12 = copy _2; - _13 = Len(_3); -- _14 = Lt(_12, _13); -- assert(move _14, "index out of bounds: the length is {} but the index is {}", move _13, _12) -> [success: bb3, unwind unreachable]; +- _14 = Lt(copy _12, copy _13); +- assert(move _14, "index out of bounds: the length is {} but the index is {}", move _13, copy _12) -> [success: bb3, unwind unreachable]; + _13 = const N; -+ _14 = Lt(_2, const N); -+ assert(move _14, "index out of bounds: the length is {} but the index is {}", const N, _2) -> [success: bb3, unwind unreachable]; ++ _14 = Lt(copy _2, const N); ++ assert(move _14, "index out of bounds: the length is {} but the index is {}", const N, copy _2) -> [success: bb3, unwind unreachable]; } bb3: { -- _11 = _3[_12]; +- _11 = copy _3[_12]; - _10 = opaque::(move _11) -> [return: bb4, unwind unreachable]; -+ _11 = _1; -+ _10 = opaque::(_1) -> [return: bb4, unwind unreachable]; ++ _11 = copy _1; ++ _10 = opaque::(copy _1) -> [return: bb4, unwind unreachable]; } bb4: { diff --git a/tests/mir-opt/gvn.repeated_index.GVN.panic-unwind.diff b/tests/mir-opt/gvn.repeated_index.GVN.panic-unwind.diff index 7ed547eeb4ade..708c0f92e542e 100644 --- a/tests/mir-opt/gvn.repeated_index.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.repeated_index.GVN.panic-unwind.diff @@ -24,27 +24,27 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; - _3 = [move _4; N]; -+ _3 = [_1; N]; ++ _3 = [copy _1; N]; StorageDead(_4); StorageLive(_5); StorageLive(_6); StorageLive(_7); _7 = const 0_usize; - _8 = Len(_3); -- _9 = Lt(_7, _8); -- assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb1, unwind continue]; +- _9 = Lt(copy _7, copy _8); +- assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb1, unwind continue]; + _8 = const N; + _9 = Lt(const 0_usize, const N); + assert(move _9, "index out of bounds: the length is {} but the index is {}", const N, const 0_usize) -> [success: bb1, unwind continue]; } bb1: { -- _6 = _3[_7]; +- _6 = copy _3[_7]; - _5 = opaque::(move _6) -> [return: bb2, unwind continue]; -+ _6 = _1; -+ _5 = opaque::(_1) -> [return: bb2, unwind continue]; ++ _6 = copy _1; ++ _5 = opaque::(copy _1) -> [return: bb2, unwind continue]; } bb2: { @@ -54,20 +54,20 @@ StorageLive(_10); StorageLive(_11); StorageLive(_12); - _12 = _2; + _12 = copy _2; - _13 = Len(_3); -- _14 = Lt(_12, _13); -- assert(move _14, "index out of bounds: the length is {} but the index is {}", move _13, _12) -> [success: bb3, unwind continue]; +- _14 = Lt(copy _12, copy _13); +- assert(move _14, "index out of bounds: the length is {} but the index is {}", move _13, copy _12) -> [success: bb3, unwind continue]; + _13 = const N; -+ _14 = Lt(_2, const N); -+ assert(move _14, "index out of bounds: the length is {} but the index is {}", const N, _2) -> [success: bb3, unwind continue]; ++ _14 = Lt(copy _2, const N); ++ assert(move _14, "index out of bounds: the length is {} but the index is {}", const N, copy _2) -> [success: bb3, unwind continue]; } bb3: { -- _11 = _3[_12]; +- _11 = copy _3[_12]; - _10 = opaque::(move _11) -> [return: bb4, unwind continue]; -+ _11 = _1; -+ _10 = opaque::(_1) -> [return: bb4, unwind continue]; ++ _11 = copy _1; ++ _10 = opaque::(copy _1) -> [return: bb4, unwind continue]; } bb4: { diff --git a/tests/mir-opt/gvn.slice_const_length.GVN.panic-abort.diff b/tests/mir-opt/gvn.slice_const_length.GVN.panic-abort.diff index fd5fa035d816c..1a6204e4ac8ae 100644 --- a/tests/mir-opt/gvn.slice_const_length.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.slice_const_length.GVN.panic-abort.diff @@ -30,12 +30,12 @@ + nop; _4 = const 123_usize; StorageLive(_5); - _5 = _2; + _5 = copy _2; StorageLive(_6); -- _6 = _4; +- _6 = copy _4; - _0 = *const [i32] from (move _5, move _6); + _6 = const 123_usize; -+ _0 = *const [i32] from (_2, const 123_usize); ++ _0 = *const [i32] from (copy _2, const 123_usize); StorageDead(_6); StorageDead(_5); - StorageDead(_4); diff --git a/tests/mir-opt/gvn.slice_const_length.GVN.panic-unwind.diff b/tests/mir-opt/gvn.slice_const_length.GVN.panic-unwind.diff index 98945cf9724db..62d57b0fe2831 100644 --- a/tests/mir-opt/gvn.slice_const_length.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.slice_const_length.GVN.panic-unwind.diff @@ -30,12 +30,12 @@ + nop; _4 = const 123_usize; StorageLive(_5); - _5 = _2; + _5 = copy _2; StorageLive(_6); -- _6 = _4; +- _6 = copy _4; - _0 = *const [i32] from (move _5, move _6); + _6 = const 123_usize; -+ _0 = *const [i32] from (_2, const 123_usize); ++ _0 = *const [i32] from (copy _2, const 123_usize); StorageDead(_6); StorageDead(_5); - StorageDead(_4); diff --git a/tests/mir-opt/gvn.slice_from_raw_parts_as_ptr.GVN.panic-abort.diff b/tests/mir-opt/gvn.slice_from_raw_parts_as_ptr.GVN.panic-abort.diff index 75bcd2a8d72cf..4a2cc25189191 100644 --- a/tests/mir-opt/gvn.slice_from_raw_parts_as_ptr.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.slice_from_raw_parts_as_ptr.GVN.panic-abort.diff @@ -20,27 +20,27 @@ - StorageLive(_3); + nop; StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = *const [u16] from (move _4, move _5); -+ _3 = *const [u16] from (_1, _2); ++ _3 = *const [u16] from (copy _1, copy _2); StorageDead(_5); StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = _3; + _7 = copy _3; - _6 = move _7 as *const u16 (PtrToPtr); -+ _6 = _1; ++ _6 = copy _1; StorageDead(_7); StorageLive(_8); StorageLive(_9); - _9 = _3; + _9 = copy _3; - _8 = move _9 as *const f32 (PtrToPtr); -+ _8 = _1 as *const f32 (PtrToPtr); ++ _8 = copy _1 as *const f32 (PtrToPtr); StorageDead(_9); - _0 = (move _6, move _8); -+ _0 = (_1, move _8); ++ _0 = (copy _1, move _8); StorageDead(_8); StorageDead(_6); - StorageDead(_3); diff --git a/tests/mir-opt/gvn.slice_from_raw_parts_as_ptr.GVN.panic-unwind.diff b/tests/mir-opt/gvn.slice_from_raw_parts_as_ptr.GVN.panic-unwind.diff index 75bcd2a8d72cf..4a2cc25189191 100644 --- a/tests/mir-opt/gvn.slice_from_raw_parts_as_ptr.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.slice_from_raw_parts_as_ptr.GVN.panic-unwind.diff @@ -20,27 +20,27 @@ - StorageLive(_3); + nop; StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = *const [u16] from (move _4, move _5); -+ _3 = *const [u16] from (_1, _2); ++ _3 = *const [u16] from (copy _1, copy _2); StorageDead(_5); StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = _3; + _7 = copy _3; - _6 = move _7 as *const u16 (PtrToPtr); -+ _6 = _1; ++ _6 = copy _1; StorageDead(_7); StorageLive(_8); StorageLive(_9); - _9 = _3; + _9 = copy _3; - _8 = move _9 as *const f32 (PtrToPtr); -+ _8 = _1 as *const f32 (PtrToPtr); ++ _8 = copy _1 as *const f32 (PtrToPtr); StorageDead(_9); - _0 = (move _6, move _8); -+ _0 = (_1, move _8); ++ _0 = (copy _1, move _8); StorageDead(_8); StorageDead(_6); - StorageDead(_3); diff --git a/tests/mir-opt/gvn.slices.GVN.panic-abort.diff b/tests/mir-opt/gvn.slices.GVN.panic-abort.diff index fb67e3d599404..e8e99b44e721b 100644 --- a/tests/mir-opt/gvn.slices.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.slices.GVN.panic-abort.diff @@ -87,22 +87,22 @@ _1 = const "my favourite slice"; StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = opaque::<&str>(move _3) -> [return: bb1, unwind unreachable]; -+ _2 = opaque::<&str>(_1) -> [return: bb1, unwind unreachable]; ++ _2 = opaque::<&str>(copy _1) -> [return: bb1, unwind unreachable]; } bb1: { StorageDead(_3); StorageDead(_2); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); StorageLive(_6); -- _6 = _4; +- _6 = copy _4; - _5 = opaque::<&str>(move _6) -> [return: bb2, unwind unreachable]; -+ _6 = _1; -+ _5 = opaque::<&str>(_1) -> [return: bb2, unwind unreachable]; ++ _6 = copy _1; ++ _5 = opaque::<&str>(copy _1) -> [return: bb2, unwind unreachable]; } bb2: { @@ -138,24 +138,24 @@ - _8 = (move _9, move _12); - StorageDead(_12); - StorageDead(_9); -+ _8 = (_9, _12); ++ _8 = (copy _9, copy _12); + nop; + nop; StorageLive(_15); -- _15 = (_8.0: &*const u8); -+ _15 = _9; +- _15 = copy (_8.0: &*const u8); ++ _15 = copy _9; StorageLive(_16); -- _16 = (_8.1: &*const u8); -+ _16 = _12; +- _16 = copy (_8.1: &*const u8); ++ _16 = copy _12; StorageLive(_17); StorageLive(_18); -- _18 = (*_15); -+ _18 = _10; +- _18 = copy (*_15); ++ _18 = copy _10; StorageLive(_19); -- _19 = (*_16); +- _19 = copy (*_16); - _17 = Eq(move _18, move _19); -+ _19 = _13; -+ _17 = Eq(_10, _13); ++ _19 = copy _13; ++ _17 = Eq(copy _10, copy _13); switchInt(move _17) -> [0: bb6, otherwise: bb5]; } @@ -180,9 +180,9 @@ StorageDead(_30); StorageLive(_31); StorageLive(_32); - _32 = _29; + _32 = copy _29; - _31 = opaque::<&[u8]>(move _32) -> [return: bb7, unwind unreachable]; -+ _31 = opaque::<&[u8]>(_29) -> [return: bb7, unwind unreachable]; ++ _31 = opaque::<&[u8]>(copy _29) -> [return: bb7, unwind unreachable]; } bb6: { @@ -244,24 +244,24 @@ - _34 = (move _35, move _38); - StorageDead(_38); - StorageDead(_35); -+ _34 = (_35, _38); ++ _34 = (copy _35, copy _38); + nop; + nop; StorageLive(_41); -- _41 = (_34.0: &*const u8); -+ _41 = _35; +- _41 = copy (_34.0: &*const u8); ++ _41 = copy _35; StorageLive(_42); -- _42 = (_34.1: &*const u8); -+ _42 = _38; +- _42 = copy (_34.1: &*const u8); ++ _42 = copy _38; StorageLive(_43); StorageLive(_44); -- _44 = (*_41); -+ _44 = _36; +- _44 = copy (*_41); ++ _44 = copy _36; StorageLive(_45); -- _45 = (*_42); +- _45 = copy (*_42); - _43 = Eq(move _44, move _45); -+ _45 = _39; -+ _43 = Eq(_36, _39); ++ _45 = copy _39; ++ _43 = Eq(copy _36, copy _39); switchInt(move _43) -> [0: bb11, otherwise: bb10]; } diff --git a/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff b/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff index ae3013b011e9a..4296d4d4a5945 100644 --- a/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff @@ -87,22 +87,22 @@ _1 = const "my favourite slice"; StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = opaque::<&str>(move _3) -> [return: bb1, unwind continue]; -+ _2 = opaque::<&str>(_1) -> [return: bb1, unwind continue]; ++ _2 = opaque::<&str>(copy _1) -> [return: bb1, unwind continue]; } bb1: { StorageDead(_3); StorageDead(_2); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); StorageLive(_6); -- _6 = _4; +- _6 = copy _4; - _5 = opaque::<&str>(move _6) -> [return: bb2, unwind continue]; -+ _6 = _1; -+ _5 = opaque::<&str>(_1) -> [return: bb2, unwind continue]; ++ _6 = copy _1; ++ _5 = opaque::<&str>(copy _1) -> [return: bb2, unwind continue]; } bb2: { @@ -138,24 +138,24 @@ - _8 = (move _9, move _12); - StorageDead(_12); - StorageDead(_9); -+ _8 = (_9, _12); ++ _8 = (copy _9, copy _12); + nop; + nop; StorageLive(_15); -- _15 = (_8.0: &*const u8); -+ _15 = _9; +- _15 = copy (_8.0: &*const u8); ++ _15 = copy _9; StorageLive(_16); -- _16 = (_8.1: &*const u8); -+ _16 = _12; +- _16 = copy (_8.1: &*const u8); ++ _16 = copy _12; StorageLive(_17); StorageLive(_18); -- _18 = (*_15); -+ _18 = _10; +- _18 = copy (*_15); ++ _18 = copy _10; StorageLive(_19); -- _19 = (*_16); +- _19 = copy (*_16); - _17 = Eq(move _18, move _19); -+ _19 = _13; -+ _17 = Eq(_10, _13); ++ _19 = copy _13; ++ _17 = Eq(copy _10, copy _13); switchInt(move _17) -> [0: bb6, otherwise: bb5]; } @@ -180,9 +180,9 @@ StorageDead(_30); StorageLive(_31); StorageLive(_32); - _32 = _29; + _32 = copy _29; - _31 = opaque::<&[u8]>(move _32) -> [return: bb7, unwind continue]; -+ _31 = opaque::<&[u8]>(_29) -> [return: bb7, unwind continue]; ++ _31 = opaque::<&[u8]>(copy _29) -> [return: bb7, unwind continue]; } bb6: { @@ -244,24 +244,24 @@ - _34 = (move _35, move _38); - StorageDead(_38); - StorageDead(_35); -+ _34 = (_35, _38); ++ _34 = (copy _35, copy _38); + nop; + nop; StorageLive(_41); -- _41 = (_34.0: &*const u8); -+ _41 = _35; +- _41 = copy (_34.0: &*const u8); ++ _41 = copy _35; StorageLive(_42); -- _42 = (_34.1: &*const u8); -+ _42 = _38; +- _42 = copy (_34.1: &*const u8); ++ _42 = copy _38; StorageLive(_43); StorageLive(_44); -- _44 = (*_41); -+ _44 = _36; +- _44 = copy (*_41); ++ _44 = copy _36; StorageLive(_45); -- _45 = (*_42); +- _45 = copy (*_42); - _43 = Eq(move _44, move _45); -+ _45 = _39; -+ _43 = Eq(_36, _39); ++ _45 = copy _39; ++ _43 = Eq(copy _36, copy _39); switchInt(move _43) -> [0: bb11, otherwise: bb10]; } diff --git a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff index ba9e507560d67..7a479bc55da75 100644 --- a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff @@ -195,15 +195,15 @@ - StorageLive(_5); + nop; StorageLive(_6); - _6 = _1; + _6 = copy _1; StorageLive(_7); - _7 = _2; + _7 = copy _2; - _5 = Add(move _6, move _7); -+ _5 = Add(_1, _2); ++ _5 = Add(copy _1, copy _2); StorageDead(_7); StorageDead(_6); - _4 = opaque::(move _5) -> [return: bb1, unwind unreachable]; -+ _4 = opaque::(_5) -> [return: bb1, unwind unreachable]; ++ _4 = opaque::(copy _5) -> [return: bb1, unwind unreachable]; } bb1: { @@ -214,15 +214,15 @@ - StorageLive(_9); + nop; StorageLive(_10); - _10 = _1; + _10 = copy _1; StorageLive(_11); - _11 = _2; + _11 = copy _2; - _9 = Mul(move _10, move _11); -+ _9 = Mul(_1, _2); ++ _9 = Mul(copy _1, copy _2); StorageDead(_11); StorageDead(_10); - _8 = opaque::(move _9) -> [return: bb2, unwind unreachable]; -+ _8 = opaque::(_9) -> [return: bb2, unwind unreachable]; ++ _8 = opaque::(copy _9) -> [return: bb2, unwind unreachable]; } bb2: { @@ -233,15 +233,15 @@ - StorageLive(_13); + nop; StorageLive(_14); - _14 = _1; + _14 = copy _1; StorageLive(_15); - _15 = _2; + _15 = copy _2; - _13 = Sub(move _14, move _15); -+ _13 = Sub(_1, _2); ++ _13 = Sub(copy _1, copy _2); StorageDead(_15); StorageDead(_14); - _12 = opaque::(move _13) -> [return: bb3, unwind unreachable]; -+ _12 = opaque::(_13) -> [return: bb3, unwind unreachable]; ++ _12 = opaque::(copy _13) -> [return: bb3, unwind unreachable]; } bb3: { @@ -252,22 +252,22 @@ - StorageLive(_17); + nop; StorageLive(_18); - _18 = _1; + _18 = copy _1; StorageLive(_19); - _19 = _2; -- _20 = Eq(_19, const 0_u64); -- assert(!move _20, "attempt to divide `{}` by zero", _18) -> [success: bb4, unwind unreachable]; -+ _20 = Eq(_2, const 0_u64); -+ assert(!_20, "attempt to divide `{}` by zero", _1) -> [success: bb4, unwind unreachable]; + _19 = copy _2; +- _20 = Eq(copy _19, const 0_u64); +- assert(!move _20, "attempt to divide `{}` by zero", copy _18) -> [success: bb4, unwind unreachable]; ++ _20 = Eq(copy _2, const 0_u64); ++ assert(!copy _20, "attempt to divide `{}` by zero", copy _1) -> [success: bb4, unwind unreachable]; } bb4: { - _17 = Div(move _18, move _19); -+ _17 = Div(_1, _2); ++ _17 = Div(copy _1, copy _2); StorageDead(_19); StorageDead(_18); - _16 = opaque::(move _17) -> [return: bb5, unwind unreachable]; -+ _16 = opaque::(_17) -> [return: bb5, unwind unreachable]; ++ _16 = opaque::(copy _17) -> [return: bb5, unwind unreachable]; } bb5: { @@ -278,22 +278,22 @@ - StorageLive(_22); + nop; StorageLive(_23); - _23 = _1; + _23 = copy _1; StorageLive(_24); - _24 = _2; -- _25 = Eq(_24, const 0_u64); -- assert(!move _25, "attempt to calculate the remainder of `{}` with a divisor of zero", _23) -> [success: bb6, unwind unreachable]; -+ _25 = _20; -+ assert(!_20, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb6, unwind unreachable]; + _24 = copy _2; +- _25 = Eq(copy _24, const 0_u64); +- assert(!move _25, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _23) -> [success: bb6, unwind unreachable]; ++ _25 = copy _20; ++ assert(!copy _20, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _1) -> [success: bb6, unwind unreachable]; } bb6: { - _22 = Rem(move _23, move _24); -+ _22 = Rem(_1, _2); ++ _22 = Rem(copy _1, copy _2); StorageDead(_24); StorageDead(_23); - _21 = opaque::(move _22) -> [return: bb7, unwind unreachable]; -+ _21 = opaque::(_22) -> [return: bb7, unwind unreachable]; ++ _21 = opaque::(copy _22) -> [return: bb7, unwind unreachable]; } bb7: { @@ -304,15 +304,15 @@ - StorageLive(_27); + nop; StorageLive(_28); - _28 = _1; + _28 = copy _1; StorageLive(_29); - _29 = _2; + _29 = copy _2; - _27 = BitAnd(move _28, move _29); -+ _27 = BitAnd(_1, _2); ++ _27 = BitAnd(copy _1, copy _2); StorageDead(_29); StorageDead(_28); - _26 = opaque::(move _27) -> [return: bb8, unwind unreachable]; -+ _26 = opaque::(_27) -> [return: bb8, unwind unreachable]; ++ _26 = opaque::(copy _27) -> [return: bb8, unwind unreachable]; } bb8: { @@ -323,15 +323,15 @@ - StorageLive(_31); + nop; StorageLive(_32); - _32 = _1; + _32 = copy _1; StorageLive(_33); - _33 = _2; + _33 = copy _2; - _31 = BitOr(move _32, move _33); -+ _31 = BitOr(_1, _2); ++ _31 = BitOr(copy _1, copy _2); StorageDead(_33); StorageDead(_32); - _30 = opaque::(move _31) -> [return: bb9, unwind unreachable]; -+ _30 = opaque::(_31) -> [return: bb9, unwind unreachable]; ++ _30 = opaque::(copy _31) -> [return: bb9, unwind unreachable]; } bb9: { @@ -342,15 +342,15 @@ - StorageLive(_35); + nop; StorageLive(_36); - _36 = _1; + _36 = copy _1; StorageLive(_37); - _37 = _2; + _37 = copy _2; - _35 = BitXor(move _36, move _37); -+ _35 = BitXor(_1, _2); ++ _35 = BitXor(copy _1, copy _2); StorageDead(_37); StorageDead(_36); - _34 = opaque::(move _35) -> [return: bb10, unwind unreachable]; -+ _34 = opaque::(_35) -> [return: bb10, unwind unreachable]; ++ _34 = opaque::(copy _35) -> [return: bb10, unwind unreachable]; } bb10: { @@ -361,15 +361,15 @@ - StorageLive(_39); + nop; StorageLive(_40); - _40 = _1; + _40 = copy _1; StorageLive(_41); - _41 = _2; + _41 = copy _2; - _39 = Shl(move _40, move _41); -+ _39 = Shl(_1, _2); ++ _39 = Shl(copy _1, copy _2); StorageDead(_41); StorageDead(_40); - _38 = opaque::(move _39) -> [return: bb11, unwind unreachable]; -+ _38 = opaque::(_39) -> [return: bb11, unwind unreachable]; ++ _38 = opaque::(copy _39) -> [return: bb11, unwind unreachable]; } bb11: { @@ -380,15 +380,15 @@ - StorageLive(_43); + nop; StorageLive(_44); - _44 = _1; + _44 = copy _1; StorageLive(_45); - _45 = _2; + _45 = copy _2; - _43 = Shr(move _44, move _45); -+ _43 = Shr(_1, _2); ++ _43 = Shr(copy _1, copy _2); StorageDead(_45); StorageDead(_44); - _42 = opaque::(move _43) -> [return: bb12, unwind unreachable]; -+ _42 = opaque::(_43) -> [return: bb12, unwind unreachable]; ++ _42 = opaque::(copy _43) -> [return: bb12, unwind unreachable]; } bb12: { @@ -399,12 +399,12 @@ - StorageLive(_47); + nop; StorageLive(_48); - _48 = _1; + _48 = copy _1; - _47 = move _48 as u32 (IntToInt); -+ _47 = _1 as u32 (IntToInt); ++ _47 = copy _1 as u32 (IntToInt); StorageDead(_48); - _46 = opaque::(move _47) -> [return: bb13, unwind unreachable]; -+ _46 = opaque::(_47) -> [return: bb13, unwind unreachable]; ++ _46 = opaque::(copy _47) -> [return: bb13, unwind unreachable]; } bb13: { @@ -415,12 +415,12 @@ - StorageLive(_50); + nop; StorageLive(_51); - _51 = _1; + _51 = copy _1; - _50 = move _51 as f32 (IntToFloat); -+ _50 = _1 as f32 (IntToFloat); ++ _50 = copy _1 as f32 (IntToFloat); StorageDead(_51); - _49 = opaque::(move _50) -> [return: bb14, unwind unreachable]; -+ _49 = opaque::(_50) -> [return: bb14, unwind unreachable]; ++ _49 = opaque::(copy _50) -> [return: bb14, unwind unreachable]; } bb14: { @@ -431,12 +431,12 @@ - StorageLive(_53); + nop; StorageLive(_54); - _54 = _1; + _54 = copy _1; - _53 = S::(move _54); -+ _53 = S::(_1); ++ _53 = S::(copy _1); StorageDead(_54); - _52 = opaque::>(move _53) -> [return: bb15, unwind unreachable]; -+ _52 = opaque::>(_53) -> [return: bb15, unwind unreachable]; ++ _52 = opaque::>(copy _53) -> [return: bb15, unwind unreachable]; } bb15: { @@ -447,14 +447,14 @@ StorageLive(_56); StorageLive(_57); StorageLive(_58); - _58 = _1; + _58 = copy _1; - _57 = S::(move _58); -+ _57 = _53; ++ _57 = copy _53; StorageDead(_58); -- _56 = (_57.0: u64); +- _56 = copy (_57.0: u64); - _55 = opaque::(move _56) -> [return: bb16, unwind unreachable]; -+ _56 = _1; -+ _55 = opaque::(_1) -> [return: bb16, unwind unreachable]; ++ _56 = copy _1; ++ _55 = opaque::(copy _1) -> [return: bb16, unwind unreachable]; } bb16: { @@ -464,15 +464,15 @@ StorageLive(_59); StorageLive(_60); StorageLive(_61); - _61 = _1; + _61 = copy _1; StorageLive(_62); - _62 = _2; + _62 = copy _2; - _60 = Add(move _61, move _62); -+ _60 = _5; ++ _60 = copy _5; StorageDead(_62); StorageDead(_61); - _59 = opaque::(move _60) -> [return: bb17, unwind unreachable]; -+ _59 = opaque::(_5) -> [return: bb17, unwind unreachable]; ++ _59 = opaque::(copy _5) -> [return: bb17, unwind unreachable]; } bb17: { @@ -481,15 +481,15 @@ StorageLive(_63); StorageLive(_64); StorageLive(_65); - _65 = _1; + _65 = copy _1; StorageLive(_66); - _66 = _2; + _66 = copy _2; - _64 = Mul(move _65, move _66); -+ _64 = _9; ++ _64 = copy _9; StorageDead(_66); StorageDead(_65); - _63 = opaque::(move _64) -> [return: bb18, unwind unreachable]; -+ _63 = opaque::(_9) -> [return: bb18, unwind unreachable]; ++ _63 = opaque::(copy _9) -> [return: bb18, unwind unreachable]; } bb18: { @@ -498,15 +498,15 @@ StorageLive(_67); StorageLive(_68); StorageLive(_69); - _69 = _1; + _69 = copy _1; StorageLive(_70); - _70 = _2; + _70 = copy _2; - _68 = Sub(move _69, move _70); -+ _68 = _13; ++ _68 = copy _13; StorageDead(_70); StorageDead(_69); - _67 = opaque::(move _68) -> [return: bb19, unwind unreachable]; -+ _67 = opaque::(_13) -> [return: bb19, unwind unreachable]; ++ _67 = opaque::(copy _13) -> [return: bb19, unwind unreachable]; } bb19: { @@ -515,22 +515,22 @@ StorageLive(_71); StorageLive(_72); StorageLive(_73); - _73 = _1; + _73 = copy _1; StorageLive(_74); - _74 = _2; -- _75 = Eq(_74, const 0_u64); -- assert(!move _75, "attempt to divide `{}` by zero", _73) -> [success: bb20, unwind unreachable]; -+ _75 = _20; -+ assert(!_20, "attempt to divide `{}` by zero", _1) -> [success: bb20, unwind unreachable]; + _74 = copy _2; +- _75 = Eq(copy _74, const 0_u64); +- assert(!move _75, "attempt to divide `{}` by zero", copy _73) -> [success: bb20, unwind unreachable]; ++ _75 = copy _20; ++ assert(!copy _20, "attempt to divide `{}` by zero", copy _1) -> [success: bb20, unwind unreachable]; } bb20: { - _72 = Div(move _73, move _74); -+ _72 = _17; ++ _72 = copy _17; StorageDead(_74); StorageDead(_73); - _71 = opaque::(move _72) -> [return: bb21, unwind unreachable]; -+ _71 = opaque::(_17) -> [return: bb21, unwind unreachable]; ++ _71 = opaque::(copy _17) -> [return: bb21, unwind unreachable]; } bb21: { @@ -539,22 +539,22 @@ StorageLive(_76); StorageLive(_77); StorageLive(_78); - _78 = _1; + _78 = copy _1; StorageLive(_79); - _79 = _2; -- _80 = Eq(_79, const 0_u64); -- assert(!move _80, "attempt to calculate the remainder of `{}` with a divisor of zero", _78) -> [success: bb22, unwind unreachable]; -+ _80 = _20; -+ assert(!_20, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb22, unwind unreachable]; + _79 = copy _2; +- _80 = Eq(copy _79, const 0_u64); +- assert(!move _80, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _78) -> [success: bb22, unwind unreachable]; ++ _80 = copy _20; ++ assert(!copy _20, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _1) -> [success: bb22, unwind unreachable]; } bb22: { - _77 = Rem(move _78, move _79); -+ _77 = _22; ++ _77 = copy _22; StorageDead(_79); StorageDead(_78); - _76 = opaque::(move _77) -> [return: bb23, unwind unreachable]; -+ _76 = opaque::(_22) -> [return: bb23, unwind unreachable]; ++ _76 = opaque::(copy _22) -> [return: bb23, unwind unreachable]; } bb23: { @@ -563,15 +563,15 @@ StorageLive(_81); StorageLive(_82); StorageLive(_83); - _83 = _1; + _83 = copy _1; StorageLive(_84); - _84 = _2; + _84 = copy _2; - _82 = BitAnd(move _83, move _84); -+ _82 = _27; ++ _82 = copy _27; StorageDead(_84); StorageDead(_83); - _81 = opaque::(move _82) -> [return: bb24, unwind unreachable]; -+ _81 = opaque::(_27) -> [return: bb24, unwind unreachable]; ++ _81 = opaque::(copy _27) -> [return: bb24, unwind unreachable]; } bb24: { @@ -580,15 +580,15 @@ StorageLive(_85); StorageLive(_86); StorageLive(_87); - _87 = _1; + _87 = copy _1; StorageLive(_88); - _88 = _2; + _88 = copy _2; - _86 = BitOr(move _87, move _88); -+ _86 = _31; ++ _86 = copy _31; StorageDead(_88); StorageDead(_87); - _85 = opaque::(move _86) -> [return: bb25, unwind unreachable]; -+ _85 = opaque::(_31) -> [return: bb25, unwind unreachable]; ++ _85 = opaque::(copy _31) -> [return: bb25, unwind unreachable]; } bb25: { @@ -597,15 +597,15 @@ StorageLive(_89); StorageLive(_90); StorageLive(_91); - _91 = _1; + _91 = copy _1; StorageLive(_92); - _92 = _2; + _92 = copy _2; - _90 = BitXor(move _91, move _92); -+ _90 = _35; ++ _90 = copy _35; StorageDead(_92); StorageDead(_91); - _89 = opaque::(move _90) -> [return: bb26, unwind unreachable]; -+ _89 = opaque::(_35) -> [return: bb26, unwind unreachable]; ++ _89 = opaque::(copy _35) -> [return: bb26, unwind unreachable]; } bb26: { @@ -614,15 +614,15 @@ StorageLive(_93); StorageLive(_94); StorageLive(_95); - _95 = _1; + _95 = copy _1; StorageLive(_96); - _96 = _2; + _96 = copy _2; - _94 = Shl(move _95, move _96); -+ _94 = _39; ++ _94 = copy _39; StorageDead(_96); StorageDead(_95); - _93 = opaque::(move _94) -> [return: bb27, unwind unreachable]; -+ _93 = opaque::(_39) -> [return: bb27, unwind unreachable]; ++ _93 = opaque::(copy _39) -> [return: bb27, unwind unreachable]; } bb27: { @@ -631,15 +631,15 @@ StorageLive(_97); StorageLive(_98); StorageLive(_99); - _99 = _1; + _99 = copy _1; StorageLive(_100); - _100 = _2; + _100 = copy _2; - _98 = Shr(move _99, move _100); -+ _98 = _43; ++ _98 = copy _43; StorageDead(_100); StorageDead(_99); - _97 = opaque::(move _98) -> [return: bb28, unwind unreachable]; -+ _97 = opaque::(_43) -> [return: bb28, unwind unreachable]; ++ _97 = opaque::(copy _43) -> [return: bb28, unwind unreachable]; } bb28: { @@ -648,12 +648,12 @@ StorageLive(_101); StorageLive(_102); StorageLive(_103); - _103 = _1; + _103 = copy _1; - _102 = move _103 as u32 (IntToInt); -+ _102 = _47; ++ _102 = copy _47; StorageDead(_103); - _101 = opaque::(move _102) -> [return: bb29, unwind unreachable]; -+ _101 = opaque::(_47) -> [return: bb29, unwind unreachable]; ++ _101 = opaque::(copy _47) -> [return: bb29, unwind unreachable]; } bb29: { @@ -662,12 +662,12 @@ StorageLive(_104); StorageLive(_105); StorageLive(_106); - _106 = _1; + _106 = copy _1; - _105 = move _106 as f32 (IntToFloat); -+ _105 = _50; ++ _105 = copy _50; StorageDead(_106); - _104 = opaque::(move _105) -> [return: bb30, unwind unreachable]; -+ _104 = opaque::(_50) -> [return: bb30, unwind unreachable]; ++ _104 = opaque::(copy _50) -> [return: bb30, unwind unreachable]; } bb30: { @@ -676,12 +676,12 @@ StorageLive(_107); StorageLive(_108); StorageLive(_109); - _109 = _1; + _109 = copy _1; - _108 = S::(move _109); -+ _108 = _53; ++ _108 = copy _53; StorageDead(_109); - _107 = opaque::>(move _108) -> [return: bb31, unwind unreachable]; -+ _107 = opaque::>(_53) -> [return: bb31, unwind unreachable]; ++ _107 = opaque::>(copy _53) -> [return: bb31, unwind unreachable]; } bb31: { @@ -691,14 +691,14 @@ StorageLive(_111); StorageLive(_112); StorageLive(_113); - _113 = _1; + _113 = copy _1; - _112 = S::(move _113); -+ _112 = _53; ++ _112 = copy _53; StorageDead(_113); -- _111 = (_112.0: u64); +- _111 = copy (_112.0: u64); - _110 = opaque::(move _111) -> [return: bb32, unwind unreachable]; -+ _111 = _1; -+ _110 = opaque::(_1) -> [return: bb32, unwind unreachable]; ++ _111 = copy _1; ++ _110 = opaque::(copy _1) -> [return: bb32, unwind unreachable]; } bb32: { @@ -710,21 +710,21 @@ + nop; StorageLive(_116); StorageLive(_117); - _117 = _1; + _117 = copy _1; StorageLive(_118); - _118 = _2; + _118 = copy _2; - _116 = Mul(move _117, move _118); -+ _116 = _9; ++ _116 = copy _9; StorageDead(_118); StorageDead(_117); StorageLive(_119); - _119 = _2; + _119 = copy _2; - _115 = Sub(move _116, move _119); -+ _115 = Sub(_9, _2); ++ _115 = Sub(copy _9, copy _2); StorageDead(_119); StorageDead(_116); - _114 = opaque::(move _115) -> [return: bb33, unwind unreachable]; -+ _114 = opaque::(_115) -> [return: bb33, unwind unreachable]; ++ _114 = opaque::(copy _115) -> [return: bb33, unwind unreachable]; } bb33: { @@ -735,21 +735,21 @@ StorageLive(_121); StorageLive(_122); StorageLive(_123); - _123 = _1; + _123 = copy _1; StorageLive(_124); - _124 = _2; + _124 = copy _2; - _122 = Mul(move _123, move _124); -+ _122 = _9; ++ _122 = copy _9; StorageDead(_124); StorageDead(_123); StorageLive(_125); - _125 = _2; + _125 = copy _2; - _121 = Sub(move _122, move _125); -+ _121 = _115; ++ _121 = copy _115; StorageDead(_125); StorageDead(_122); - _120 = opaque::(move _121) -> [return: bb34, unwind unreachable]; -+ _120 = opaque::(_115) -> [return: bb34, unwind unreachable]; ++ _120 = opaque::(copy _115) -> [return: bb34, unwind unreachable]; } bb34: { @@ -762,16 +762,16 @@ - StorageLive(_129); + nop; + nop; - _129 = (*_126); + _129 = copy (*_126); StorageLive(_130); - _130 = _1; + _130 = copy _1; - _128 = Add(move _129, move _130); -+ _128 = Add(_129, _1); ++ _128 = Add(copy _129, copy _1); StorageDead(_130); - StorageDead(_129); - _127 = opaque::(move _128) -> [return: bb35, unwind unreachable]; + nop; -+ _127 = opaque::(_128) -> [return: bb35, unwind unreachable]; ++ _127 = opaque::(copy _128) -> [return: bb35, unwind unreachable]; } bb35: { @@ -781,16 +781,16 @@ StorageLive(_131); StorageLive(_132); StorageLive(_133); -- _133 = (*_126); -+ _133 = _129; +- _133 = copy (*_126); ++ _133 = copy _129; StorageLive(_134); - _134 = _1; + _134 = copy _1; - _132 = Add(move _133, move _134); -+ _132 = _128; ++ _132 = copy _128; StorageDead(_134); StorageDead(_133); - _131 = opaque::(move _132) -> [return: bb36, unwind unreachable]; -+ _131 = opaque::(_128) -> [return: bb36, unwind unreachable]; ++ _131 = opaque::(copy _128) -> [return: bb36, unwind unreachable]; } bb36: { @@ -801,11 +801,11 @@ StorageLive(_136); StorageLive(_137); StorageLive(_138); - _138 = (*_135); + _138 = copy (*_135); StorageLive(_139); - _139 = _1; + _139 = copy _1; - _137 = Add(move _138, move _139); -+ _137 = Add(move _138, _1); ++ _137 = Add(move _138, copy _1); StorageDead(_139); StorageDead(_138); _136 = opaque::(move _137) -> [return: bb37, unwind unreachable]; @@ -817,11 +817,11 @@ StorageLive(_140); StorageLive(_141); StorageLive(_142); - _142 = (*_135); + _142 = copy (*_135); StorageLive(_143); - _143 = _1; + _143 = copy _1; - _141 = Add(move _142, move _143); -+ _141 = Add(move _142, _1); ++ _141 = Add(move _142, copy _1); StorageDead(_143); StorageDead(_142); _140 = opaque::(move _141) -> [return: bb38, unwind unreachable]; @@ -836,11 +836,11 @@ StorageLive(_146); StorageLive(_147); StorageLive(_148); - _148 = (*_145); + _148 = copy (*_145); StorageLive(_149); - _149 = _1; + _149 = copy _1; - _147 = Add(move _148, move _149); -+ _147 = Add(move _148, _1); ++ _147 = Add(move _148, copy _1); StorageDead(_149); StorageDead(_148); _146 = opaque::(move _147) -> [return: bb39, unwind unreachable]; @@ -852,11 +852,11 @@ StorageLive(_150); StorageLive(_151); StorageLive(_152); - _152 = (*_145); + _152 = copy (*_145); StorageLive(_153); - _153 = _1; + _153 = copy _1; - _151 = Add(move _152, move _153); -+ _151 = Add(move _152, _1); ++ _151 = Add(move _152, copy _1); StorageDead(_153); StorageDead(_152); _150 = opaque::(move _151) -> [return: bb40, unwind unreachable]; @@ -870,11 +870,11 @@ StorageLive(_155); StorageLive(_156); StorageLive(_157); - _157 = (*_154); + _157 = copy (*_154); StorageLive(_158); - _158 = _1; + _158 = copy _1; - _156 = Add(move _157, move _158); -+ _156 = Add(move _157, _1); ++ _156 = Add(move _157, copy _1); StorageDead(_158); StorageDead(_157); _155 = opaque::(move _156) -> [return: bb41, unwind unreachable]; @@ -886,11 +886,11 @@ StorageLive(_159); StorageLive(_160); StorageLive(_161); - _161 = (*_154); + _161 = copy (*_154); StorageLive(_162); - _162 = _1; + _162 = copy _1; - _160 = Add(move _161, move _162); -+ _160 = Add(move _161, _1); ++ _160 = Add(move _161, copy _1); StorageDead(_162); StorageDead(_161); _159 = opaque::(move _160) -> [return: bb42, unwind unreachable]; @@ -910,16 +910,16 @@ - StorageLive(_166); + nop; + nop; - _166 = (*_163); + _166 = copy (*_163); StorageLive(_167); - _167 = _1; + _167 = copy _1; - _165 = Add(move _166, move _167); -+ _165 = Add(_166, _1); ++ _165 = Add(copy _166, copy _1); StorageDead(_167); - StorageDead(_166); - _164 = opaque::(move _165) -> [return: bb43, unwind unreachable]; + nop; -+ _164 = opaque::(_165) -> [return: bb43, unwind unreachable]; ++ _164 = opaque::(copy _165) -> [return: bb43, unwind unreachable]; } bb43: { @@ -929,16 +929,16 @@ StorageLive(_168); StorageLive(_169); StorageLive(_170); -- _170 = (*_163); -+ _170 = _166; +- _170 = copy (*_163); ++ _170 = copy _166; StorageLive(_171); - _171 = _1; + _171 = copy _1; - _169 = Add(move _170, move _171); -+ _169 = _165; ++ _169 = copy _165; StorageDead(_171); StorageDead(_170); - _168 = opaque::(move _169) -> [return: bb44, unwind unreachable]; -+ _168 = opaque::(_165) -> [return: bb44, unwind unreachable]; ++ _168 = opaque::(copy _165) -> [return: bb44, unwind unreachable]; } bb44: { diff --git a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff index 41c0153613010..3ca5238663c28 100644 --- a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff @@ -195,15 +195,15 @@ - StorageLive(_5); + nop; StorageLive(_6); - _6 = _1; + _6 = copy _1; StorageLive(_7); - _7 = _2; + _7 = copy _2; - _5 = Add(move _6, move _7); -+ _5 = Add(_1, _2); ++ _5 = Add(copy _1, copy _2); StorageDead(_7); StorageDead(_6); - _4 = opaque::(move _5) -> [return: bb1, unwind continue]; -+ _4 = opaque::(_5) -> [return: bb1, unwind continue]; ++ _4 = opaque::(copy _5) -> [return: bb1, unwind continue]; } bb1: { @@ -214,15 +214,15 @@ - StorageLive(_9); + nop; StorageLive(_10); - _10 = _1; + _10 = copy _1; StorageLive(_11); - _11 = _2; + _11 = copy _2; - _9 = Mul(move _10, move _11); -+ _9 = Mul(_1, _2); ++ _9 = Mul(copy _1, copy _2); StorageDead(_11); StorageDead(_10); - _8 = opaque::(move _9) -> [return: bb2, unwind continue]; -+ _8 = opaque::(_9) -> [return: bb2, unwind continue]; ++ _8 = opaque::(copy _9) -> [return: bb2, unwind continue]; } bb2: { @@ -233,15 +233,15 @@ - StorageLive(_13); + nop; StorageLive(_14); - _14 = _1; + _14 = copy _1; StorageLive(_15); - _15 = _2; + _15 = copy _2; - _13 = Sub(move _14, move _15); -+ _13 = Sub(_1, _2); ++ _13 = Sub(copy _1, copy _2); StorageDead(_15); StorageDead(_14); - _12 = opaque::(move _13) -> [return: bb3, unwind continue]; -+ _12 = opaque::(_13) -> [return: bb3, unwind continue]; ++ _12 = opaque::(copy _13) -> [return: bb3, unwind continue]; } bb3: { @@ -252,22 +252,22 @@ - StorageLive(_17); + nop; StorageLive(_18); - _18 = _1; + _18 = copy _1; StorageLive(_19); - _19 = _2; -- _20 = Eq(_19, const 0_u64); -- assert(!move _20, "attempt to divide `{}` by zero", _18) -> [success: bb4, unwind continue]; -+ _20 = Eq(_2, const 0_u64); -+ assert(!_20, "attempt to divide `{}` by zero", _1) -> [success: bb4, unwind continue]; + _19 = copy _2; +- _20 = Eq(copy _19, const 0_u64); +- assert(!move _20, "attempt to divide `{}` by zero", copy _18) -> [success: bb4, unwind continue]; ++ _20 = Eq(copy _2, const 0_u64); ++ assert(!copy _20, "attempt to divide `{}` by zero", copy _1) -> [success: bb4, unwind continue]; } bb4: { - _17 = Div(move _18, move _19); -+ _17 = Div(_1, _2); ++ _17 = Div(copy _1, copy _2); StorageDead(_19); StorageDead(_18); - _16 = opaque::(move _17) -> [return: bb5, unwind continue]; -+ _16 = opaque::(_17) -> [return: bb5, unwind continue]; ++ _16 = opaque::(copy _17) -> [return: bb5, unwind continue]; } bb5: { @@ -278,22 +278,22 @@ - StorageLive(_22); + nop; StorageLive(_23); - _23 = _1; + _23 = copy _1; StorageLive(_24); - _24 = _2; -- _25 = Eq(_24, const 0_u64); -- assert(!move _25, "attempt to calculate the remainder of `{}` with a divisor of zero", _23) -> [success: bb6, unwind continue]; -+ _25 = _20; -+ assert(!_20, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb6, unwind continue]; + _24 = copy _2; +- _25 = Eq(copy _24, const 0_u64); +- assert(!move _25, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _23) -> [success: bb6, unwind continue]; ++ _25 = copy _20; ++ assert(!copy _20, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _1) -> [success: bb6, unwind continue]; } bb6: { - _22 = Rem(move _23, move _24); -+ _22 = Rem(_1, _2); ++ _22 = Rem(copy _1, copy _2); StorageDead(_24); StorageDead(_23); - _21 = opaque::(move _22) -> [return: bb7, unwind continue]; -+ _21 = opaque::(_22) -> [return: bb7, unwind continue]; ++ _21 = opaque::(copy _22) -> [return: bb7, unwind continue]; } bb7: { @@ -304,15 +304,15 @@ - StorageLive(_27); + nop; StorageLive(_28); - _28 = _1; + _28 = copy _1; StorageLive(_29); - _29 = _2; + _29 = copy _2; - _27 = BitAnd(move _28, move _29); -+ _27 = BitAnd(_1, _2); ++ _27 = BitAnd(copy _1, copy _2); StorageDead(_29); StorageDead(_28); - _26 = opaque::(move _27) -> [return: bb8, unwind continue]; -+ _26 = opaque::(_27) -> [return: bb8, unwind continue]; ++ _26 = opaque::(copy _27) -> [return: bb8, unwind continue]; } bb8: { @@ -323,15 +323,15 @@ - StorageLive(_31); + nop; StorageLive(_32); - _32 = _1; + _32 = copy _1; StorageLive(_33); - _33 = _2; + _33 = copy _2; - _31 = BitOr(move _32, move _33); -+ _31 = BitOr(_1, _2); ++ _31 = BitOr(copy _1, copy _2); StorageDead(_33); StorageDead(_32); - _30 = opaque::(move _31) -> [return: bb9, unwind continue]; -+ _30 = opaque::(_31) -> [return: bb9, unwind continue]; ++ _30 = opaque::(copy _31) -> [return: bb9, unwind continue]; } bb9: { @@ -342,15 +342,15 @@ - StorageLive(_35); + nop; StorageLive(_36); - _36 = _1; + _36 = copy _1; StorageLive(_37); - _37 = _2; + _37 = copy _2; - _35 = BitXor(move _36, move _37); -+ _35 = BitXor(_1, _2); ++ _35 = BitXor(copy _1, copy _2); StorageDead(_37); StorageDead(_36); - _34 = opaque::(move _35) -> [return: bb10, unwind continue]; -+ _34 = opaque::(_35) -> [return: bb10, unwind continue]; ++ _34 = opaque::(copy _35) -> [return: bb10, unwind continue]; } bb10: { @@ -361,15 +361,15 @@ - StorageLive(_39); + nop; StorageLive(_40); - _40 = _1; + _40 = copy _1; StorageLive(_41); - _41 = _2; + _41 = copy _2; - _39 = Shl(move _40, move _41); -+ _39 = Shl(_1, _2); ++ _39 = Shl(copy _1, copy _2); StorageDead(_41); StorageDead(_40); - _38 = opaque::(move _39) -> [return: bb11, unwind continue]; -+ _38 = opaque::(_39) -> [return: bb11, unwind continue]; ++ _38 = opaque::(copy _39) -> [return: bb11, unwind continue]; } bb11: { @@ -380,15 +380,15 @@ - StorageLive(_43); + nop; StorageLive(_44); - _44 = _1; + _44 = copy _1; StorageLive(_45); - _45 = _2; + _45 = copy _2; - _43 = Shr(move _44, move _45); -+ _43 = Shr(_1, _2); ++ _43 = Shr(copy _1, copy _2); StorageDead(_45); StorageDead(_44); - _42 = opaque::(move _43) -> [return: bb12, unwind continue]; -+ _42 = opaque::(_43) -> [return: bb12, unwind continue]; ++ _42 = opaque::(copy _43) -> [return: bb12, unwind continue]; } bb12: { @@ -399,12 +399,12 @@ - StorageLive(_47); + nop; StorageLive(_48); - _48 = _1; + _48 = copy _1; - _47 = move _48 as u32 (IntToInt); -+ _47 = _1 as u32 (IntToInt); ++ _47 = copy _1 as u32 (IntToInt); StorageDead(_48); - _46 = opaque::(move _47) -> [return: bb13, unwind continue]; -+ _46 = opaque::(_47) -> [return: bb13, unwind continue]; ++ _46 = opaque::(copy _47) -> [return: bb13, unwind continue]; } bb13: { @@ -415,12 +415,12 @@ - StorageLive(_50); + nop; StorageLive(_51); - _51 = _1; + _51 = copy _1; - _50 = move _51 as f32 (IntToFloat); -+ _50 = _1 as f32 (IntToFloat); ++ _50 = copy _1 as f32 (IntToFloat); StorageDead(_51); - _49 = opaque::(move _50) -> [return: bb14, unwind continue]; -+ _49 = opaque::(_50) -> [return: bb14, unwind continue]; ++ _49 = opaque::(copy _50) -> [return: bb14, unwind continue]; } bb14: { @@ -431,12 +431,12 @@ - StorageLive(_53); + nop; StorageLive(_54); - _54 = _1; + _54 = copy _1; - _53 = S::(move _54); -+ _53 = S::(_1); ++ _53 = S::(copy _1); StorageDead(_54); - _52 = opaque::>(move _53) -> [return: bb15, unwind continue]; -+ _52 = opaque::>(_53) -> [return: bb15, unwind continue]; ++ _52 = opaque::>(copy _53) -> [return: bb15, unwind continue]; } bb15: { @@ -447,14 +447,14 @@ StorageLive(_56); StorageLive(_57); StorageLive(_58); - _58 = _1; + _58 = copy _1; - _57 = S::(move _58); -+ _57 = _53; ++ _57 = copy _53; StorageDead(_58); -- _56 = (_57.0: u64); +- _56 = copy (_57.0: u64); - _55 = opaque::(move _56) -> [return: bb16, unwind continue]; -+ _56 = _1; -+ _55 = opaque::(_1) -> [return: bb16, unwind continue]; ++ _56 = copy _1; ++ _55 = opaque::(copy _1) -> [return: bb16, unwind continue]; } bb16: { @@ -464,15 +464,15 @@ StorageLive(_59); StorageLive(_60); StorageLive(_61); - _61 = _1; + _61 = copy _1; StorageLive(_62); - _62 = _2; + _62 = copy _2; - _60 = Add(move _61, move _62); -+ _60 = _5; ++ _60 = copy _5; StorageDead(_62); StorageDead(_61); - _59 = opaque::(move _60) -> [return: bb17, unwind continue]; -+ _59 = opaque::(_5) -> [return: bb17, unwind continue]; ++ _59 = opaque::(copy _5) -> [return: bb17, unwind continue]; } bb17: { @@ -481,15 +481,15 @@ StorageLive(_63); StorageLive(_64); StorageLive(_65); - _65 = _1; + _65 = copy _1; StorageLive(_66); - _66 = _2; + _66 = copy _2; - _64 = Mul(move _65, move _66); -+ _64 = _9; ++ _64 = copy _9; StorageDead(_66); StorageDead(_65); - _63 = opaque::(move _64) -> [return: bb18, unwind continue]; -+ _63 = opaque::(_9) -> [return: bb18, unwind continue]; ++ _63 = opaque::(copy _9) -> [return: bb18, unwind continue]; } bb18: { @@ -498,15 +498,15 @@ StorageLive(_67); StorageLive(_68); StorageLive(_69); - _69 = _1; + _69 = copy _1; StorageLive(_70); - _70 = _2; + _70 = copy _2; - _68 = Sub(move _69, move _70); -+ _68 = _13; ++ _68 = copy _13; StorageDead(_70); StorageDead(_69); - _67 = opaque::(move _68) -> [return: bb19, unwind continue]; -+ _67 = opaque::(_13) -> [return: bb19, unwind continue]; ++ _67 = opaque::(copy _13) -> [return: bb19, unwind continue]; } bb19: { @@ -515,22 +515,22 @@ StorageLive(_71); StorageLive(_72); StorageLive(_73); - _73 = _1; + _73 = copy _1; StorageLive(_74); - _74 = _2; -- _75 = Eq(_74, const 0_u64); -- assert(!move _75, "attempt to divide `{}` by zero", _73) -> [success: bb20, unwind continue]; -+ _75 = _20; -+ assert(!_20, "attempt to divide `{}` by zero", _1) -> [success: bb20, unwind continue]; + _74 = copy _2; +- _75 = Eq(copy _74, const 0_u64); +- assert(!move _75, "attempt to divide `{}` by zero", copy _73) -> [success: bb20, unwind continue]; ++ _75 = copy _20; ++ assert(!copy _20, "attempt to divide `{}` by zero", copy _1) -> [success: bb20, unwind continue]; } bb20: { - _72 = Div(move _73, move _74); -+ _72 = _17; ++ _72 = copy _17; StorageDead(_74); StorageDead(_73); - _71 = opaque::(move _72) -> [return: bb21, unwind continue]; -+ _71 = opaque::(_17) -> [return: bb21, unwind continue]; ++ _71 = opaque::(copy _17) -> [return: bb21, unwind continue]; } bb21: { @@ -539,22 +539,22 @@ StorageLive(_76); StorageLive(_77); StorageLive(_78); - _78 = _1; + _78 = copy _1; StorageLive(_79); - _79 = _2; -- _80 = Eq(_79, const 0_u64); -- assert(!move _80, "attempt to calculate the remainder of `{}` with a divisor of zero", _78) -> [success: bb22, unwind continue]; -+ _80 = _20; -+ assert(!_20, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb22, unwind continue]; + _79 = copy _2; +- _80 = Eq(copy _79, const 0_u64); +- assert(!move _80, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _78) -> [success: bb22, unwind continue]; ++ _80 = copy _20; ++ assert(!copy _20, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _1) -> [success: bb22, unwind continue]; } bb22: { - _77 = Rem(move _78, move _79); -+ _77 = _22; ++ _77 = copy _22; StorageDead(_79); StorageDead(_78); - _76 = opaque::(move _77) -> [return: bb23, unwind continue]; -+ _76 = opaque::(_22) -> [return: bb23, unwind continue]; ++ _76 = opaque::(copy _22) -> [return: bb23, unwind continue]; } bb23: { @@ -563,15 +563,15 @@ StorageLive(_81); StorageLive(_82); StorageLive(_83); - _83 = _1; + _83 = copy _1; StorageLive(_84); - _84 = _2; + _84 = copy _2; - _82 = BitAnd(move _83, move _84); -+ _82 = _27; ++ _82 = copy _27; StorageDead(_84); StorageDead(_83); - _81 = opaque::(move _82) -> [return: bb24, unwind continue]; -+ _81 = opaque::(_27) -> [return: bb24, unwind continue]; ++ _81 = opaque::(copy _27) -> [return: bb24, unwind continue]; } bb24: { @@ -580,15 +580,15 @@ StorageLive(_85); StorageLive(_86); StorageLive(_87); - _87 = _1; + _87 = copy _1; StorageLive(_88); - _88 = _2; + _88 = copy _2; - _86 = BitOr(move _87, move _88); -+ _86 = _31; ++ _86 = copy _31; StorageDead(_88); StorageDead(_87); - _85 = opaque::(move _86) -> [return: bb25, unwind continue]; -+ _85 = opaque::(_31) -> [return: bb25, unwind continue]; ++ _85 = opaque::(copy _31) -> [return: bb25, unwind continue]; } bb25: { @@ -597,15 +597,15 @@ StorageLive(_89); StorageLive(_90); StorageLive(_91); - _91 = _1; + _91 = copy _1; StorageLive(_92); - _92 = _2; + _92 = copy _2; - _90 = BitXor(move _91, move _92); -+ _90 = _35; ++ _90 = copy _35; StorageDead(_92); StorageDead(_91); - _89 = opaque::(move _90) -> [return: bb26, unwind continue]; -+ _89 = opaque::(_35) -> [return: bb26, unwind continue]; ++ _89 = opaque::(copy _35) -> [return: bb26, unwind continue]; } bb26: { @@ -614,15 +614,15 @@ StorageLive(_93); StorageLive(_94); StorageLive(_95); - _95 = _1; + _95 = copy _1; StorageLive(_96); - _96 = _2; + _96 = copy _2; - _94 = Shl(move _95, move _96); -+ _94 = _39; ++ _94 = copy _39; StorageDead(_96); StorageDead(_95); - _93 = opaque::(move _94) -> [return: bb27, unwind continue]; -+ _93 = opaque::(_39) -> [return: bb27, unwind continue]; ++ _93 = opaque::(copy _39) -> [return: bb27, unwind continue]; } bb27: { @@ -631,15 +631,15 @@ StorageLive(_97); StorageLive(_98); StorageLive(_99); - _99 = _1; + _99 = copy _1; StorageLive(_100); - _100 = _2; + _100 = copy _2; - _98 = Shr(move _99, move _100); -+ _98 = _43; ++ _98 = copy _43; StorageDead(_100); StorageDead(_99); - _97 = opaque::(move _98) -> [return: bb28, unwind continue]; -+ _97 = opaque::(_43) -> [return: bb28, unwind continue]; ++ _97 = opaque::(copy _43) -> [return: bb28, unwind continue]; } bb28: { @@ -648,12 +648,12 @@ StorageLive(_101); StorageLive(_102); StorageLive(_103); - _103 = _1; + _103 = copy _1; - _102 = move _103 as u32 (IntToInt); -+ _102 = _47; ++ _102 = copy _47; StorageDead(_103); - _101 = opaque::(move _102) -> [return: bb29, unwind continue]; -+ _101 = opaque::(_47) -> [return: bb29, unwind continue]; ++ _101 = opaque::(copy _47) -> [return: bb29, unwind continue]; } bb29: { @@ -662,12 +662,12 @@ StorageLive(_104); StorageLive(_105); StorageLive(_106); - _106 = _1; + _106 = copy _1; - _105 = move _106 as f32 (IntToFloat); -+ _105 = _50; ++ _105 = copy _50; StorageDead(_106); - _104 = opaque::(move _105) -> [return: bb30, unwind continue]; -+ _104 = opaque::(_50) -> [return: bb30, unwind continue]; ++ _104 = opaque::(copy _50) -> [return: bb30, unwind continue]; } bb30: { @@ -676,12 +676,12 @@ StorageLive(_107); StorageLive(_108); StorageLive(_109); - _109 = _1; + _109 = copy _1; - _108 = S::(move _109); -+ _108 = _53; ++ _108 = copy _53; StorageDead(_109); - _107 = opaque::>(move _108) -> [return: bb31, unwind continue]; -+ _107 = opaque::>(_53) -> [return: bb31, unwind continue]; ++ _107 = opaque::>(copy _53) -> [return: bb31, unwind continue]; } bb31: { @@ -691,14 +691,14 @@ StorageLive(_111); StorageLive(_112); StorageLive(_113); - _113 = _1; + _113 = copy _1; - _112 = S::(move _113); -+ _112 = _53; ++ _112 = copy _53; StorageDead(_113); -- _111 = (_112.0: u64); +- _111 = copy (_112.0: u64); - _110 = opaque::(move _111) -> [return: bb32, unwind continue]; -+ _111 = _1; -+ _110 = opaque::(_1) -> [return: bb32, unwind continue]; ++ _111 = copy _1; ++ _110 = opaque::(copy _1) -> [return: bb32, unwind continue]; } bb32: { @@ -710,21 +710,21 @@ + nop; StorageLive(_116); StorageLive(_117); - _117 = _1; + _117 = copy _1; StorageLive(_118); - _118 = _2; + _118 = copy _2; - _116 = Mul(move _117, move _118); -+ _116 = _9; ++ _116 = copy _9; StorageDead(_118); StorageDead(_117); StorageLive(_119); - _119 = _2; + _119 = copy _2; - _115 = Sub(move _116, move _119); -+ _115 = Sub(_9, _2); ++ _115 = Sub(copy _9, copy _2); StorageDead(_119); StorageDead(_116); - _114 = opaque::(move _115) -> [return: bb33, unwind continue]; -+ _114 = opaque::(_115) -> [return: bb33, unwind continue]; ++ _114 = opaque::(copy _115) -> [return: bb33, unwind continue]; } bb33: { @@ -735,21 +735,21 @@ StorageLive(_121); StorageLive(_122); StorageLive(_123); - _123 = _1; + _123 = copy _1; StorageLive(_124); - _124 = _2; + _124 = copy _2; - _122 = Mul(move _123, move _124); -+ _122 = _9; ++ _122 = copy _9; StorageDead(_124); StorageDead(_123); StorageLive(_125); - _125 = _2; + _125 = copy _2; - _121 = Sub(move _122, move _125); -+ _121 = _115; ++ _121 = copy _115; StorageDead(_125); StorageDead(_122); - _120 = opaque::(move _121) -> [return: bb34, unwind continue]; -+ _120 = opaque::(_115) -> [return: bb34, unwind continue]; ++ _120 = opaque::(copy _115) -> [return: bb34, unwind continue]; } bb34: { @@ -762,16 +762,16 @@ - StorageLive(_129); + nop; + nop; - _129 = (*_126); + _129 = copy (*_126); StorageLive(_130); - _130 = _1; + _130 = copy _1; - _128 = Add(move _129, move _130); -+ _128 = Add(_129, _1); ++ _128 = Add(copy _129, copy _1); StorageDead(_130); - StorageDead(_129); - _127 = opaque::(move _128) -> [return: bb35, unwind continue]; + nop; -+ _127 = opaque::(_128) -> [return: bb35, unwind continue]; ++ _127 = opaque::(copy _128) -> [return: bb35, unwind continue]; } bb35: { @@ -781,16 +781,16 @@ StorageLive(_131); StorageLive(_132); StorageLive(_133); -- _133 = (*_126); -+ _133 = _129; +- _133 = copy (*_126); ++ _133 = copy _129; StorageLive(_134); - _134 = _1; + _134 = copy _1; - _132 = Add(move _133, move _134); -+ _132 = _128; ++ _132 = copy _128; StorageDead(_134); StorageDead(_133); - _131 = opaque::(move _132) -> [return: bb36, unwind continue]; -+ _131 = opaque::(_128) -> [return: bb36, unwind continue]; ++ _131 = opaque::(copy _128) -> [return: bb36, unwind continue]; } bb36: { @@ -801,11 +801,11 @@ StorageLive(_136); StorageLive(_137); StorageLive(_138); - _138 = (*_135); + _138 = copy (*_135); StorageLive(_139); - _139 = _1; + _139 = copy _1; - _137 = Add(move _138, move _139); -+ _137 = Add(move _138, _1); ++ _137 = Add(move _138, copy _1); StorageDead(_139); StorageDead(_138); _136 = opaque::(move _137) -> [return: bb37, unwind continue]; @@ -817,11 +817,11 @@ StorageLive(_140); StorageLive(_141); StorageLive(_142); - _142 = (*_135); + _142 = copy (*_135); StorageLive(_143); - _143 = _1; + _143 = copy _1; - _141 = Add(move _142, move _143); -+ _141 = Add(move _142, _1); ++ _141 = Add(move _142, copy _1); StorageDead(_143); StorageDead(_142); _140 = opaque::(move _141) -> [return: bb38, unwind continue]; @@ -836,11 +836,11 @@ StorageLive(_146); StorageLive(_147); StorageLive(_148); - _148 = (*_145); + _148 = copy (*_145); StorageLive(_149); - _149 = _1; + _149 = copy _1; - _147 = Add(move _148, move _149); -+ _147 = Add(move _148, _1); ++ _147 = Add(move _148, copy _1); StorageDead(_149); StorageDead(_148); _146 = opaque::(move _147) -> [return: bb39, unwind continue]; @@ -852,11 +852,11 @@ StorageLive(_150); StorageLive(_151); StorageLive(_152); - _152 = (*_145); + _152 = copy (*_145); StorageLive(_153); - _153 = _1; + _153 = copy _1; - _151 = Add(move _152, move _153); -+ _151 = Add(move _152, _1); ++ _151 = Add(move _152, copy _1); StorageDead(_153); StorageDead(_152); _150 = opaque::(move _151) -> [return: bb40, unwind continue]; @@ -870,11 +870,11 @@ StorageLive(_155); StorageLive(_156); StorageLive(_157); - _157 = (*_154); + _157 = copy (*_154); StorageLive(_158); - _158 = _1; + _158 = copy _1; - _156 = Add(move _157, move _158); -+ _156 = Add(move _157, _1); ++ _156 = Add(move _157, copy _1); StorageDead(_158); StorageDead(_157); _155 = opaque::(move _156) -> [return: bb41, unwind continue]; @@ -886,11 +886,11 @@ StorageLive(_159); StorageLive(_160); StorageLive(_161); - _161 = (*_154); + _161 = copy (*_154); StorageLive(_162); - _162 = _1; + _162 = copy _1; - _160 = Add(move _161, move _162); -+ _160 = Add(move _161, _1); ++ _160 = Add(move _161, copy _1); StorageDead(_162); StorageDead(_161); _159 = opaque::(move _160) -> [return: bb42, unwind continue]; @@ -910,16 +910,16 @@ - StorageLive(_166); + nop; + nop; - _166 = (*_163); + _166 = copy (*_163); StorageLive(_167); - _167 = _1; + _167 = copy _1; - _165 = Add(move _166, move _167); -+ _165 = Add(_166, _1); ++ _165 = Add(copy _166, copy _1); StorageDead(_167); - StorageDead(_166); - _164 = opaque::(move _165) -> [return: bb43, unwind continue]; + nop; -+ _164 = opaque::(_165) -> [return: bb43, unwind continue]; ++ _164 = opaque::(copy _165) -> [return: bb43, unwind continue]; } bb43: { @@ -929,16 +929,16 @@ StorageLive(_168); StorageLive(_169); StorageLive(_170); -- _170 = (*_163); -+ _170 = _166; +- _170 = copy (*_163); ++ _170 = copy _166; StorageLive(_171); - _171 = _1; + _171 = copy _1; - _169 = Add(move _170, move _171); -+ _169 = _165; ++ _169 = copy _165; StorageDead(_171); StorageDead(_170); - _168 = opaque::(move _169) -> [return: bb44, unwind continue]; -+ _168 = opaque::(_165) -> [return: bb44, unwind continue]; ++ _168 = opaque::(copy _165) -> [return: bb44, unwind continue]; } bb44: { diff --git a/tests/mir-opt/gvn.unary.GVN.panic-abort.diff b/tests/mir-opt/gvn.unary.GVN.panic-abort.diff index 9469032f294e3..d14aec6df5fae 100644 --- a/tests/mir-opt/gvn.unary.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.unary.GVN.panic-abort.diff @@ -37,15 +37,15 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = Neg(move _5); -+ _4 = Neg(_1); ++ _4 = Neg(copy _1); StorageDead(_5); - _3 = Neg(move _4); -+ _3 = _1; ++ _3 = copy _1; StorageDead(_4); - _2 = opaque::(move _3) -> [return: bb1, unwind unreachable]; -+ _2 = opaque::(_1) -> [return: bb1, unwind unreachable]; ++ _2 = opaque::(copy _1) -> [return: bb1, unwind unreachable]; } bb1: { @@ -54,23 +54,23 @@ - StorageLive(_6); + nop; StorageLive(_7); - _7 = _1; + _7 = copy _1; - _6 = Lt(move _7, const 13_i64); -+ _6 = Lt(_1, const 13_i64); ++ _6 = Lt(copy _1, const 13_i64); StorageDead(_7); StorageLive(_8); StorageLive(_9); StorageLive(_10); StorageLive(_11); - _11 = _6; + _11 = copy _6; - _10 = Not(move _11); -+ _10 = Not(_6); ++ _10 = Not(copy _6); StorageDead(_11); - _9 = Not(move _10); -+ _9 = _6; ++ _9 = copy _6; StorageDead(_10); - _8 = opaque::(move _9) -> [return: bb2, unwind unreachable]; -+ _8 = opaque::(_6) -> [return: bb2, unwind unreachable]; ++ _8 = opaque::(copy _6) -> [return: bb2, unwind unreachable]; } bb2: { @@ -80,12 +80,12 @@ - StorageLive(_13); + nop; StorageLive(_14); - _14 = _1; + _14 = copy _1; - _13 = Ne(move _14, const 15_i64); -+ _13 = Ne(_1, const 15_i64); ++ _13 = Ne(copy _1, const 15_i64); StorageDead(_14); - _12 = opaque::(move _13) -> [return: bb3, unwind unreachable]; -+ _12 = opaque::(_13) -> [return: bb3, unwind unreachable]; ++ _12 = opaque::(copy _13) -> [return: bb3, unwind unreachable]; } bb3: { @@ -96,15 +96,15 @@ StorageLive(_16); StorageLive(_17); StorageLive(_18); - _18 = _1; + _18 = copy _1; - _17 = Eq(move _18, const 15_i64); -+ _17 = Eq(_1, const 15_i64); ++ _17 = Eq(copy _1, const 15_i64); StorageDead(_18); - _16 = Not(move _17); -+ _16 = _13; ++ _16 = copy _13; StorageDead(_17); - _15 = opaque::(move _16) -> [return: bb4, unwind unreachable]; -+ _15 = opaque::(_13) -> [return: bb4, unwind unreachable]; ++ _15 = opaque::(copy _13) -> [return: bb4, unwind unreachable]; } bb4: { @@ -114,12 +114,12 @@ - StorageLive(_20); + nop; StorageLive(_21); - _21 = _1; + _21 = copy _1; - _20 = Eq(move _21, const 35_i64); -+ _20 = Eq(_1, const 35_i64); ++ _20 = Eq(copy _1, const 35_i64); StorageDead(_21); - _19 = opaque::(move _20) -> [return: bb5, unwind unreachable]; -+ _19 = opaque::(_20) -> [return: bb5, unwind unreachable]; ++ _19 = opaque::(copy _20) -> [return: bb5, unwind unreachable]; } bb5: { @@ -130,15 +130,15 @@ StorageLive(_23); StorageLive(_24); StorageLive(_25); - _25 = _1; + _25 = copy _1; - _24 = Ne(move _25, const 35_i64); -+ _24 = Ne(_1, const 35_i64); ++ _24 = Ne(copy _1, const 35_i64); StorageDead(_25); - _23 = Not(move _24); -+ _23 = _20; ++ _23 = copy _20; StorageDead(_24); - _22 = opaque::(move _23) -> [return: bb6, unwind unreachable]; -+ _22 = opaque::(_20) -> [return: bb6, unwind unreachable]; ++ _22 = opaque::(copy _20) -> [return: bb6, unwind unreachable]; } bb6: { diff --git a/tests/mir-opt/gvn.unary.GVN.panic-unwind.diff b/tests/mir-opt/gvn.unary.GVN.panic-unwind.diff index e672f6fb6ba71..5978f1faa1f68 100644 --- a/tests/mir-opt/gvn.unary.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.unary.GVN.panic-unwind.diff @@ -37,15 +37,15 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = Neg(move _5); -+ _4 = Neg(_1); ++ _4 = Neg(copy _1); StorageDead(_5); - _3 = Neg(move _4); -+ _3 = _1; ++ _3 = copy _1; StorageDead(_4); - _2 = opaque::(move _3) -> [return: bb1, unwind continue]; -+ _2 = opaque::(_1) -> [return: bb1, unwind continue]; ++ _2 = opaque::(copy _1) -> [return: bb1, unwind continue]; } bb1: { @@ -54,23 +54,23 @@ - StorageLive(_6); + nop; StorageLive(_7); - _7 = _1; + _7 = copy _1; - _6 = Lt(move _7, const 13_i64); -+ _6 = Lt(_1, const 13_i64); ++ _6 = Lt(copy _1, const 13_i64); StorageDead(_7); StorageLive(_8); StorageLive(_9); StorageLive(_10); StorageLive(_11); - _11 = _6; + _11 = copy _6; - _10 = Not(move _11); -+ _10 = Not(_6); ++ _10 = Not(copy _6); StorageDead(_11); - _9 = Not(move _10); -+ _9 = _6; ++ _9 = copy _6; StorageDead(_10); - _8 = opaque::(move _9) -> [return: bb2, unwind continue]; -+ _8 = opaque::(_6) -> [return: bb2, unwind continue]; ++ _8 = opaque::(copy _6) -> [return: bb2, unwind continue]; } bb2: { @@ -80,12 +80,12 @@ - StorageLive(_13); + nop; StorageLive(_14); - _14 = _1; + _14 = copy _1; - _13 = Ne(move _14, const 15_i64); -+ _13 = Ne(_1, const 15_i64); ++ _13 = Ne(copy _1, const 15_i64); StorageDead(_14); - _12 = opaque::(move _13) -> [return: bb3, unwind continue]; -+ _12 = opaque::(_13) -> [return: bb3, unwind continue]; ++ _12 = opaque::(copy _13) -> [return: bb3, unwind continue]; } bb3: { @@ -96,15 +96,15 @@ StorageLive(_16); StorageLive(_17); StorageLive(_18); - _18 = _1; + _18 = copy _1; - _17 = Eq(move _18, const 15_i64); -+ _17 = Eq(_1, const 15_i64); ++ _17 = Eq(copy _1, const 15_i64); StorageDead(_18); - _16 = Not(move _17); -+ _16 = _13; ++ _16 = copy _13; StorageDead(_17); - _15 = opaque::(move _16) -> [return: bb4, unwind continue]; -+ _15 = opaque::(_13) -> [return: bb4, unwind continue]; ++ _15 = opaque::(copy _13) -> [return: bb4, unwind continue]; } bb4: { @@ -114,12 +114,12 @@ - StorageLive(_20); + nop; StorageLive(_21); - _21 = _1; + _21 = copy _1; - _20 = Eq(move _21, const 35_i64); -+ _20 = Eq(_1, const 35_i64); ++ _20 = Eq(copy _1, const 35_i64); StorageDead(_21); - _19 = opaque::(move _20) -> [return: bb5, unwind continue]; -+ _19 = opaque::(_20) -> [return: bb5, unwind continue]; ++ _19 = opaque::(copy _20) -> [return: bb5, unwind continue]; } bb5: { @@ -130,15 +130,15 @@ StorageLive(_23); StorageLive(_24); StorageLive(_25); - _25 = _1; + _25 = copy _1; - _24 = Ne(move _25, const 35_i64); -+ _24 = Ne(_1, const 35_i64); ++ _24 = Ne(copy _1, const 35_i64); StorageDead(_25); - _23 = Not(move _24); -+ _23 = _20; ++ _23 = copy _20; StorageDead(_24); - _22 = opaque::(move _23) -> [return: bb6, unwind continue]; -+ _22 = opaque::(_20) -> [return: bb6, unwind continue]; ++ _22 = opaque::(copy _20) -> [return: bb6, unwind continue]; } bb6: { diff --git a/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-abort.diff b/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-abort.diff index 3eed0473f7fc2..bb938f3ba6a9a 100644 --- a/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-abort.diff @@ -58,10 +58,10 @@ StorageLive(_5); StorageLive(_6); StorageLive(_7); -- _7 = _1; +- _7 = copy _1; + _7 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_8); -- _8 = _3; +- _8 = copy _3; - _6 = Eq(move _7, move _8); + _8 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _6 = const false; @@ -77,10 +77,10 @@ StorageLive(_9); StorageLive(_10); StorageLive(_11); -- _11 = _1; +- _11 = copy _1; + _11 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_12); -- _12 = _3; +- _12 = copy _3; - _10 = Ne(move _11, move _12); + _12 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _10 = const true; @@ -96,10 +96,10 @@ StorageLive(_13); StorageLive(_14); StorageLive(_15); -- _15 = _1; +- _15 = copy _1; + _15 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_16); -- _16 = _3; +- _16 = copy _3; - _14 = Lt(move _15, move _16); + _16 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _14 = const true; @@ -115,10 +115,10 @@ StorageLive(_17); StorageLive(_18); StorageLive(_19); -- _19 = _1; +- _19 = copy _1; + _19 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_20); -- _20 = _3; +- _20 = copy _3; - _18 = Le(move _19, move _20); + _20 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _18 = const true; @@ -134,10 +134,10 @@ StorageLive(_21); StorageLive(_22); StorageLive(_23); -- _23 = _1; +- _23 = copy _1; + _23 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_24); -- _24 = _3; +- _24 = copy _3; - _22 = Gt(move _23, move _24); + _24 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _22 = const false; @@ -153,10 +153,10 @@ StorageLive(_25); StorageLive(_26); StorageLive(_27); -- _27 = _1; +- _27 = copy _1; + _27 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_28); -- _28 = _3; +- _28 = copy _3; - _26 = Ge(move _27, move _28); + _28 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _26 = const false; diff --git a/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-unwind.diff b/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-unwind.diff index 9a6e255a872ea..81432d687eb32 100644 --- a/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-unwind.diff @@ -58,10 +58,10 @@ StorageLive(_5); StorageLive(_6); StorageLive(_7); -- _7 = _1; +- _7 = copy _1; + _7 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_8); -- _8 = _3; +- _8 = copy _3; - _6 = Eq(move _7, move _8); + _8 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _6 = const false; @@ -77,10 +77,10 @@ StorageLive(_9); StorageLive(_10); StorageLive(_11); -- _11 = _1; +- _11 = copy _1; + _11 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_12); -- _12 = _3; +- _12 = copy _3; - _10 = Ne(move _11, move _12); + _12 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _10 = const true; @@ -96,10 +96,10 @@ StorageLive(_13); StorageLive(_14); StorageLive(_15); -- _15 = _1; +- _15 = copy _1; + _15 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_16); -- _16 = _3; +- _16 = copy _3; - _14 = Lt(move _15, move _16); + _16 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _14 = const true; @@ -115,10 +115,10 @@ StorageLive(_17); StorageLive(_18); StorageLive(_19); -- _19 = _1; +- _19 = copy _1; + _19 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_20); -- _20 = _3; +- _20 = copy _3; - _18 = Le(move _19, move _20); + _20 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _18 = const true; @@ -134,10 +134,10 @@ StorageLive(_21); StorageLive(_22); StorageLive(_23); -- _23 = _1; +- _23 = copy _1; + _23 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_24); -- _24 = _3; +- _24 = copy _3; - _22 = Gt(move _23, move _24); + _24 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _22 = const false; @@ -153,10 +153,10 @@ StorageLive(_25); StorageLive(_26); StorageLive(_27); -- _27 = _1; +- _27 = copy _1; + _27 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_28); -- _28 = _3; +- _28 = copy _3; - _26 = Ge(move _27, move _28); + _28 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _26 = const false; diff --git a/tests/mir-opt/gvn.wide_ptr_provenance.GVN.panic-abort.diff b/tests/mir-opt/gvn.wide_ptr_provenance.GVN.panic-abort.diff index 629c222568203..c58362e391c43 100644 --- a/tests/mir-opt/gvn.wide_ptr_provenance.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.wide_ptr_provenance.GVN.panic-abort.diff @@ -69,7 +69,7 @@ _2 = &raw const (*_3); - _1 = move _2 as *const dyn std::marker::Send (PointerCoercion(Unsize)); - StorageDead(_2); -+ _1 = _2; ++ _1 = copy _2; + nop; StorageDead(_5); StorageDead(_3); @@ -87,24 +87,24 @@ _8 = &raw const (*_9); - _7 = move _8 as *const dyn std::marker::Send (PointerCoercion(Unsize)); - StorageDead(_8); -+ _7 = _8; ++ _7 = copy _8; + nop; StorageDead(_11); StorageDead(_9); StorageLive(_13); StorageLive(_14); StorageLive(_15); -- _15 = _1; -+ _15 = _2; +- _15 = copy _1; ++ _15 = copy _2; StorageLive(_16); StorageLive(_17); -- _17 = _7; +- _17 = copy _7; - _16 = move _17 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _17 = _8; -+ _16 = _8; ++ _17 = copy _8; ++ _16 = copy _8; StorageDead(_17); - _14 = Eq(move _15, move _16); -+ _14 = Eq(_2, _8); ++ _14 = Eq(copy _2, copy _8); StorageDead(_16); StorageDead(_15); _13 = opaque::(move _14) -> [return: bb1, unwind unreachable]; @@ -116,17 +116,17 @@ StorageLive(_18); StorageLive(_19); StorageLive(_20); -- _20 = _1; -+ _20 = _2; +- _20 = copy _1; ++ _20 = copy _2; StorageLive(_21); StorageLive(_22); -- _22 = _7; +- _22 = copy _7; - _21 = move _22 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _22 = _8; -+ _21 = _8; ++ _22 = copy _8; ++ _21 = copy _8; StorageDead(_22); - _19 = Ne(move _20, move _21); -+ _19 = Ne(_2, _8); ++ _19 = Ne(copy _2, copy _8); StorageDead(_21); StorageDead(_20); _18 = opaque::(move _19) -> [return: bb2, unwind unreachable]; @@ -138,17 +138,17 @@ StorageLive(_23); StorageLive(_24); StorageLive(_25); -- _25 = _1; -+ _25 = _2; +- _25 = copy _1; ++ _25 = copy _2; StorageLive(_26); StorageLive(_27); -- _27 = _7; +- _27 = copy _7; - _26 = move _27 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _27 = _8; -+ _26 = _8; ++ _27 = copy _8; ++ _26 = copy _8; StorageDead(_27); - _24 = Lt(move _25, move _26); -+ _24 = Lt(_2, _8); ++ _24 = Lt(copy _2, copy _8); StorageDead(_26); StorageDead(_25); _23 = opaque::(move _24) -> [return: bb3, unwind unreachable]; @@ -160,17 +160,17 @@ StorageLive(_28); StorageLive(_29); StorageLive(_30); -- _30 = _1; -+ _30 = _2; +- _30 = copy _1; ++ _30 = copy _2; StorageLive(_31); StorageLive(_32); -- _32 = _7; +- _32 = copy _7; - _31 = move _32 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _32 = _8; -+ _31 = _8; ++ _32 = copy _8; ++ _31 = copy _8; StorageDead(_32); - _29 = Le(move _30, move _31); -+ _29 = Le(_2, _8); ++ _29 = Le(copy _2, copy _8); StorageDead(_31); StorageDead(_30); _28 = opaque::(move _29) -> [return: bb4, unwind unreachable]; @@ -182,17 +182,17 @@ StorageLive(_33); StorageLive(_34); StorageLive(_35); -- _35 = _1; -+ _35 = _2; +- _35 = copy _1; ++ _35 = copy _2; StorageLive(_36); StorageLive(_37); -- _37 = _7; +- _37 = copy _7; - _36 = move _37 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _37 = _8; -+ _36 = _8; ++ _37 = copy _8; ++ _36 = copy _8; StorageDead(_37); - _34 = Gt(move _35, move _36); -+ _34 = Gt(_2, _8); ++ _34 = Gt(copy _2, copy _8); StorageDead(_36); StorageDead(_35); _33 = opaque::(move _34) -> [return: bb5, unwind unreachable]; @@ -204,17 +204,17 @@ StorageLive(_38); StorageLive(_39); StorageLive(_40); -- _40 = _1; -+ _40 = _2; +- _40 = copy _1; ++ _40 = copy _2; StorageLive(_41); StorageLive(_42); -- _42 = _7; +- _42 = copy _7; - _41 = move _42 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _42 = _8; -+ _41 = _8; ++ _42 = copy _8; ++ _41 = copy _8; StorageDead(_42); - _39 = Ge(move _40, move _41); -+ _39 = Ge(_2, _8); ++ _39 = Ge(copy _2, copy _8); StorageDead(_41); StorageDead(_40); _38 = opaque::(move _39) -> [return: bb6, unwind unreachable]; diff --git a/tests/mir-opt/gvn.wide_ptr_provenance.GVN.panic-unwind.diff b/tests/mir-opt/gvn.wide_ptr_provenance.GVN.panic-unwind.diff index 3380bc84cb807..b29ee862c81a3 100644 --- a/tests/mir-opt/gvn.wide_ptr_provenance.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.wide_ptr_provenance.GVN.panic-unwind.diff @@ -69,7 +69,7 @@ _2 = &raw const (*_3); - _1 = move _2 as *const dyn std::marker::Send (PointerCoercion(Unsize)); - StorageDead(_2); -+ _1 = _2; ++ _1 = copy _2; + nop; StorageDead(_5); StorageDead(_3); @@ -87,24 +87,24 @@ _8 = &raw const (*_9); - _7 = move _8 as *const dyn std::marker::Send (PointerCoercion(Unsize)); - StorageDead(_8); -+ _7 = _8; ++ _7 = copy _8; + nop; StorageDead(_11); StorageDead(_9); StorageLive(_13); StorageLive(_14); StorageLive(_15); -- _15 = _1; -+ _15 = _2; +- _15 = copy _1; ++ _15 = copy _2; StorageLive(_16); StorageLive(_17); -- _17 = _7; +- _17 = copy _7; - _16 = move _17 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _17 = _8; -+ _16 = _8; ++ _17 = copy _8; ++ _16 = copy _8; StorageDead(_17); - _14 = Eq(move _15, move _16); -+ _14 = Eq(_2, _8); ++ _14 = Eq(copy _2, copy _8); StorageDead(_16); StorageDead(_15); _13 = opaque::(move _14) -> [return: bb1, unwind continue]; @@ -116,17 +116,17 @@ StorageLive(_18); StorageLive(_19); StorageLive(_20); -- _20 = _1; -+ _20 = _2; +- _20 = copy _1; ++ _20 = copy _2; StorageLive(_21); StorageLive(_22); -- _22 = _7; +- _22 = copy _7; - _21 = move _22 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _22 = _8; -+ _21 = _8; ++ _22 = copy _8; ++ _21 = copy _8; StorageDead(_22); - _19 = Ne(move _20, move _21); -+ _19 = Ne(_2, _8); ++ _19 = Ne(copy _2, copy _8); StorageDead(_21); StorageDead(_20); _18 = opaque::(move _19) -> [return: bb2, unwind continue]; @@ -138,17 +138,17 @@ StorageLive(_23); StorageLive(_24); StorageLive(_25); -- _25 = _1; -+ _25 = _2; +- _25 = copy _1; ++ _25 = copy _2; StorageLive(_26); StorageLive(_27); -- _27 = _7; +- _27 = copy _7; - _26 = move _27 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _27 = _8; -+ _26 = _8; ++ _27 = copy _8; ++ _26 = copy _8; StorageDead(_27); - _24 = Lt(move _25, move _26); -+ _24 = Lt(_2, _8); ++ _24 = Lt(copy _2, copy _8); StorageDead(_26); StorageDead(_25); _23 = opaque::(move _24) -> [return: bb3, unwind continue]; @@ -160,17 +160,17 @@ StorageLive(_28); StorageLive(_29); StorageLive(_30); -- _30 = _1; -+ _30 = _2; +- _30 = copy _1; ++ _30 = copy _2; StorageLive(_31); StorageLive(_32); -- _32 = _7; +- _32 = copy _7; - _31 = move _32 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _32 = _8; -+ _31 = _8; ++ _32 = copy _8; ++ _31 = copy _8; StorageDead(_32); - _29 = Le(move _30, move _31); -+ _29 = Le(_2, _8); ++ _29 = Le(copy _2, copy _8); StorageDead(_31); StorageDead(_30); _28 = opaque::(move _29) -> [return: bb4, unwind continue]; @@ -182,17 +182,17 @@ StorageLive(_33); StorageLive(_34); StorageLive(_35); -- _35 = _1; -+ _35 = _2; +- _35 = copy _1; ++ _35 = copy _2; StorageLive(_36); StorageLive(_37); -- _37 = _7; +- _37 = copy _7; - _36 = move _37 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _37 = _8; -+ _36 = _8; ++ _37 = copy _8; ++ _36 = copy _8; StorageDead(_37); - _34 = Gt(move _35, move _36); -+ _34 = Gt(_2, _8); ++ _34 = Gt(copy _2, copy _8); StorageDead(_36); StorageDead(_35); _33 = opaque::(move _34) -> [return: bb5, unwind continue]; @@ -204,17 +204,17 @@ StorageLive(_38); StorageLive(_39); StorageLive(_40); -- _40 = _1; -+ _40 = _2; +- _40 = copy _1; ++ _40 = copy _2; StorageLive(_41); StorageLive(_42); -- _42 = _7; +- _42 = copy _7; - _41 = move _42 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _42 = _8; -+ _41 = _8; ++ _42 = copy _8; ++ _41 = copy _8; StorageDead(_42); - _39 = Ge(move _40, move _41); -+ _39 = Ge(_2, _8); ++ _39 = Ge(copy _2, copy _8); StorageDead(_41); StorageDead(_40); _38 = opaque::(move _39) -> [return: bb6, unwind continue]; diff --git a/tests/mir-opt/gvn.wide_ptr_same_provenance.GVN.panic-abort.diff b/tests/mir-opt/gvn.wide_ptr_same_provenance.GVN.panic-abort.diff index da1662615d240..f4c38b7ab071e 100644 --- a/tests/mir-opt/gvn.wide_ptr_same_provenance.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.wide_ptr_same_provenance.GVN.panic-abort.diff @@ -75,8 +75,8 @@ StorageLive(_8); _8 = const 0_usize; - _9 = Len((*_1)); -- _10 = Lt(_8, _9); -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb1, unwind unreachable]; +- _10 = Lt(copy _8, copy _9); +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, copy _8) -> [success: bb1, unwind unreachable]; + _9 = const 2_usize; + _10 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 2_usize, const 0_usize) -> [success: bb1, unwind unreachable]; @@ -91,7 +91,7 @@ _4 = &raw const (*_5); - _3 = move _4 as *const dyn std::marker::Send (PointerCoercion(Unsize)); - StorageDead(_4); -+ _3 = _4; ++ _3 = copy _4; + nop; StorageDead(_7); StorageDead(_5); @@ -104,8 +104,8 @@ StorageLive(_16); _16 = const 1_usize; - _17 = Len((*_1)); -- _18 = Lt(_16, _17); -- assert(move _18, "index out of bounds: the length is {} but the index is {}", move _17, _16) -> [success: bb2, unwind unreachable]; +- _18 = Lt(copy _16, copy _17); +- assert(move _18, "index out of bounds: the length is {} but the index is {}", move _17, copy _16) -> [success: bb2, unwind unreachable]; + _17 = const 2_usize; + _18 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 2_usize, const 1_usize) -> [success: bb2, unwind unreachable]; @@ -120,24 +120,24 @@ _12 = &raw const (*_13); - _11 = move _12 as *const dyn std::marker::Send (PointerCoercion(Unsize)); - StorageDead(_12); -+ _11 = _12; ++ _11 = copy _12; + nop; StorageDead(_15); StorageDead(_13); StorageLive(_19); StorageLive(_20); StorageLive(_21); -- _21 = _3; -+ _21 = _4; +- _21 = copy _3; ++ _21 = copy _4; StorageLive(_22); StorageLive(_23); -- _23 = _11; +- _23 = copy _11; - _22 = move _23 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _23 = _12; -+ _22 = _12; ++ _23 = copy _12; ++ _22 = copy _12; StorageDead(_23); - _20 = Eq(move _21, move _22); -+ _20 = Eq(_4, _12); ++ _20 = Eq(copy _4, copy _12); StorageDead(_22); StorageDead(_21); _19 = opaque::(move _20) -> [return: bb3, unwind unreachable]; @@ -149,17 +149,17 @@ StorageLive(_24); StorageLive(_25); StorageLive(_26); -- _26 = _3; -+ _26 = _4; +- _26 = copy _3; ++ _26 = copy _4; StorageLive(_27); StorageLive(_28); -- _28 = _11; +- _28 = copy _11; - _27 = move _28 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _28 = _12; -+ _27 = _12; ++ _28 = copy _12; ++ _27 = copy _12; StorageDead(_28); - _25 = Ne(move _26, move _27); -+ _25 = Ne(_4, _12); ++ _25 = Ne(copy _4, copy _12); StorageDead(_27); StorageDead(_26); _24 = opaque::(move _25) -> [return: bb4, unwind unreachable]; @@ -171,17 +171,17 @@ StorageLive(_29); StorageLive(_30); StorageLive(_31); -- _31 = _3; -+ _31 = _4; +- _31 = copy _3; ++ _31 = copy _4; StorageLive(_32); StorageLive(_33); -- _33 = _11; +- _33 = copy _11; - _32 = move _33 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _33 = _12; -+ _32 = _12; ++ _33 = copy _12; ++ _32 = copy _12; StorageDead(_33); - _30 = Lt(move _31, move _32); -+ _30 = Lt(_4, _12); ++ _30 = Lt(copy _4, copy _12); StorageDead(_32); StorageDead(_31); _29 = opaque::(move _30) -> [return: bb5, unwind unreachable]; @@ -193,17 +193,17 @@ StorageLive(_34); StorageLive(_35); StorageLive(_36); -- _36 = _3; -+ _36 = _4; +- _36 = copy _3; ++ _36 = copy _4; StorageLive(_37); StorageLive(_38); -- _38 = _11; +- _38 = copy _11; - _37 = move _38 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _38 = _12; -+ _37 = _12; ++ _38 = copy _12; ++ _37 = copy _12; StorageDead(_38); - _35 = Le(move _36, move _37); -+ _35 = Le(_4, _12); ++ _35 = Le(copy _4, copy _12); StorageDead(_37); StorageDead(_36); _34 = opaque::(move _35) -> [return: bb6, unwind unreachable]; @@ -215,17 +215,17 @@ StorageLive(_39); StorageLive(_40); StorageLive(_41); -- _41 = _3; -+ _41 = _4; +- _41 = copy _3; ++ _41 = copy _4; StorageLive(_42); StorageLive(_43); -- _43 = _11; +- _43 = copy _11; - _42 = move _43 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _43 = _12; -+ _42 = _12; ++ _43 = copy _12; ++ _42 = copy _12; StorageDead(_43); - _40 = Gt(move _41, move _42); -+ _40 = Gt(_4, _12); ++ _40 = Gt(copy _4, copy _12); StorageDead(_42); StorageDead(_41); _39 = opaque::(move _40) -> [return: bb7, unwind unreachable]; @@ -237,17 +237,17 @@ StorageLive(_44); StorageLive(_45); StorageLive(_46); -- _46 = _3; -+ _46 = _4; +- _46 = copy _3; ++ _46 = copy _4; StorageLive(_47); StorageLive(_48); -- _48 = _11; +- _48 = copy _11; - _47 = move _48 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _48 = _12; -+ _47 = _12; ++ _48 = copy _12; ++ _47 = copy _12; StorageDead(_48); - _45 = Ge(move _46, move _47); -+ _45 = Ge(_4, _12); ++ _45 = Ge(copy _4, copy _12); StorageDead(_47); StorageDead(_46); _44 = opaque::(move _45) -> [return: bb8, unwind unreachable]; diff --git a/tests/mir-opt/gvn.wide_ptr_same_provenance.GVN.panic-unwind.diff b/tests/mir-opt/gvn.wide_ptr_same_provenance.GVN.panic-unwind.diff index 6c4f3a91264b5..03f2d129a9b6f 100644 --- a/tests/mir-opt/gvn.wide_ptr_same_provenance.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.wide_ptr_same_provenance.GVN.panic-unwind.diff @@ -75,8 +75,8 @@ StorageLive(_8); _8 = const 0_usize; - _9 = Len((*_1)); -- _10 = Lt(_8, _9); -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb1, unwind continue]; +- _10 = Lt(copy _8, copy _9); +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, copy _8) -> [success: bb1, unwind continue]; + _9 = const 2_usize; + _10 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 2_usize, const 0_usize) -> [success: bb1, unwind continue]; @@ -91,7 +91,7 @@ _4 = &raw const (*_5); - _3 = move _4 as *const dyn std::marker::Send (PointerCoercion(Unsize)); - StorageDead(_4); -+ _3 = _4; ++ _3 = copy _4; + nop; StorageDead(_7); StorageDead(_5); @@ -104,8 +104,8 @@ StorageLive(_16); _16 = const 1_usize; - _17 = Len((*_1)); -- _18 = Lt(_16, _17); -- assert(move _18, "index out of bounds: the length is {} but the index is {}", move _17, _16) -> [success: bb2, unwind continue]; +- _18 = Lt(copy _16, copy _17); +- assert(move _18, "index out of bounds: the length is {} but the index is {}", move _17, copy _16) -> [success: bb2, unwind continue]; + _17 = const 2_usize; + _18 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 2_usize, const 1_usize) -> [success: bb2, unwind continue]; @@ -120,24 +120,24 @@ _12 = &raw const (*_13); - _11 = move _12 as *const dyn std::marker::Send (PointerCoercion(Unsize)); - StorageDead(_12); -+ _11 = _12; ++ _11 = copy _12; + nop; StorageDead(_15); StorageDead(_13); StorageLive(_19); StorageLive(_20); StorageLive(_21); -- _21 = _3; -+ _21 = _4; +- _21 = copy _3; ++ _21 = copy _4; StorageLive(_22); StorageLive(_23); -- _23 = _11; +- _23 = copy _11; - _22 = move _23 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _23 = _12; -+ _22 = _12; ++ _23 = copy _12; ++ _22 = copy _12; StorageDead(_23); - _20 = Eq(move _21, move _22); -+ _20 = Eq(_4, _12); ++ _20 = Eq(copy _4, copy _12); StorageDead(_22); StorageDead(_21); _19 = opaque::(move _20) -> [return: bb3, unwind continue]; @@ -149,17 +149,17 @@ StorageLive(_24); StorageLive(_25); StorageLive(_26); -- _26 = _3; -+ _26 = _4; +- _26 = copy _3; ++ _26 = copy _4; StorageLive(_27); StorageLive(_28); -- _28 = _11; +- _28 = copy _11; - _27 = move _28 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _28 = _12; -+ _27 = _12; ++ _28 = copy _12; ++ _27 = copy _12; StorageDead(_28); - _25 = Ne(move _26, move _27); -+ _25 = Ne(_4, _12); ++ _25 = Ne(copy _4, copy _12); StorageDead(_27); StorageDead(_26); _24 = opaque::(move _25) -> [return: bb4, unwind continue]; @@ -171,17 +171,17 @@ StorageLive(_29); StorageLive(_30); StorageLive(_31); -- _31 = _3; -+ _31 = _4; +- _31 = copy _3; ++ _31 = copy _4; StorageLive(_32); StorageLive(_33); -- _33 = _11; +- _33 = copy _11; - _32 = move _33 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _33 = _12; -+ _32 = _12; ++ _33 = copy _12; ++ _32 = copy _12; StorageDead(_33); - _30 = Lt(move _31, move _32); -+ _30 = Lt(_4, _12); ++ _30 = Lt(copy _4, copy _12); StorageDead(_32); StorageDead(_31); _29 = opaque::(move _30) -> [return: bb5, unwind continue]; @@ -193,17 +193,17 @@ StorageLive(_34); StorageLive(_35); StorageLive(_36); -- _36 = _3; -+ _36 = _4; +- _36 = copy _3; ++ _36 = copy _4; StorageLive(_37); StorageLive(_38); -- _38 = _11; +- _38 = copy _11; - _37 = move _38 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _38 = _12; -+ _37 = _12; ++ _38 = copy _12; ++ _37 = copy _12; StorageDead(_38); - _35 = Le(move _36, move _37); -+ _35 = Le(_4, _12); ++ _35 = Le(copy _4, copy _12); StorageDead(_37); StorageDead(_36); _34 = opaque::(move _35) -> [return: bb6, unwind continue]; @@ -215,17 +215,17 @@ StorageLive(_39); StorageLive(_40); StorageLive(_41); -- _41 = _3; -+ _41 = _4; +- _41 = copy _3; ++ _41 = copy _4; StorageLive(_42); StorageLive(_43); -- _43 = _11; +- _43 = copy _11; - _42 = move _43 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _43 = _12; -+ _42 = _12; ++ _43 = copy _12; ++ _42 = copy _12; StorageDead(_43); - _40 = Gt(move _41, move _42); -+ _40 = Gt(_4, _12); ++ _40 = Gt(copy _4, copy _12); StorageDead(_42); StorageDead(_41); _39 = opaque::(move _40) -> [return: bb7, unwind continue]; @@ -237,17 +237,17 @@ StorageLive(_44); StorageLive(_45); StorageLive(_46); -- _46 = _3; -+ _46 = _4; +- _46 = copy _3; ++ _46 = copy _4; StorageLive(_47); StorageLive(_48); -- _48 = _11; +- _48 = copy _11; - _47 = move _48 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _48 = _12; -+ _47 = _12; ++ _48 = copy _12; ++ _47 = copy _12; StorageDead(_48); - _45 = Ge(move _46, move _47); -+ _45 = Ge(_4, _12); ++ _45 = Ge(copy _4, copy _12); StorageDead(_47); StorageDead(_46); _44 = opaque::(move _45) -> [return: bb8, unwind continue]; diff --git a/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-abort.diff b/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-abort.diff index a5c29c191ad5c..0433152bb4f29 100644 --- a/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-abort.diff @@ -16,9 +16,9 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Option::::Some(move _3); -+ _2 = Option::::Some(_1); ++ _2 = Option::::Some(copy _1); StorageDead(_3); - _4 = discriminant(_2); - switchInt(move _4) -> [0: bb2, 1: bb3, otherwise: bb1]; @@ -37,10 +37,10 @@ bb3: { StorageLive(_5); -- _5 = ((_2 as Some).0: T); -- _0 = _5; -+ _5 = _1; -+ _0 = _1; +- _5 = copy ((_2 as Some).0: T); +- _0 = copy _5; ++ _5 = copy _1; ++ _0 = copy _1; StorageDead(_5); StorageDead(_2); return; diff --git a/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-unwind.diff b/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-unwind.diff index 6f2e52482716d..5722c865c2f9f 100644 --- a/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-unwind.diff @@ -16,9 +16,9 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Option::::Some(move _3); -+ _2 = Option::::Some(_1); ++ _2 = Option::::Some(copy _1); StorageDead(_3); - _4 = discriminant(_2); - switchInt(move _4) -> [0: bb2, 1: bb3, otherwise: bb1]; @@ -37,10 +37,10 @@ bb3: { StorageLive(_5); -- _5 = ((_2 as Some).0: T); -- _0 = _5; -+ _5 = _1; -+ _0 = _1; +- _5 = copy ((_2 as Some).0: T); +- _0 = copy _5; ++ _5 = copy _1; ++ _0 = copy _1; StorageDead(_5); StorageDead(_2); return; diff --git a/tests/mir-opt/gvn_copy_moves.fn0.GVN.diff b/tests/mir-opt/gvn_copy_moves.fn0.GVN.diff index b12de636f58b1..c364da7a3cc68 100644 --- a/tests/mir-opt/gvn_copy_moves.fn0.GVN.diff +++ b/tests/mir-opt/gvn_copy_moves.fn0.GVN.diff @@ -14,10 +14,10 @@ _2 = [const 42_u128; 6]; - _2[_1] = const 1_u128; + _2[1 of 2] = const 1_u128; - _3 = (_2,); - _4 = _3; -- _5 = fn1(move (_3.0: [u128; 6]), _4) -> [return: bb1, unwind unreachable]; -+ _5 = fn1((_3.0: [u128; 6]), _3) -> [return: bb1, unwind unreachable]; + _3 = (copy _2,); + _4 = copy _3; +- _5 = fn1(move (_3.0: [u128; 6]), copy _4) -> [return: bb1, unwind unreachable]; ++ _5 = fn1(copy (_3.0: [u128; 6]), copy _3) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/gvn_ptr_eq_with_constant.main.GVN.diff b/tests/mir-opt/gvn_ptr_eq_with_constant.main.GVN.diff index 3af78d9b6ce98..1e378d30a3e9d 100644 --- a/tests/mir-opt/gvn_ptr_eq_with_constant.main.GVN.diff +++ b/tests/mir-opt/gvn_ptr_eq_with_constant.main.GVN.diff @@ -25,20 +25,20 @@ StorageLive(_2); StorageLive(_3); - _3 = AlignOf(u8); -- _2 = _3 as *mut u8 (Transmute); +- _2 = copy _3 as *mut u8 (Transmute); + _3 = const 1_usize; + _2 = const {0x1 as *mut u8}; StorageDead(_3); StorageLive(_4); StorageLive(_5); -- _5 = _2; -- _4 = _2 as *const u8 (PtrToPtr); +- _5 = copy _2; +- _4 = copy _2 as *const u8 (PtrToPtr); + _5 = const {0x1 as *mut u8}; + _4 = const {0x1 as *const u8}; StorageDead(_5); StorageLive(_6); - _6 = const Foo::::SENTINEL as *const u8 (PtrToPtr); -- _1 = Eq(_4, _6); +- _1 = Eq(copy _4, copy _6); + _6 = const {0x1 as *const u8}; + _1 = const true; StorageDead(_6); diff --git a/tests/mir-opt/gvn_uninhabited.f.GVN.panic-abort.diff b/tests/mir-opt/gvn_uninhabited.f.GVN.panic-abort.diff index 626367766d76d..37b7b0d2c9db3 100644 --- a/tests/mir-opt/gvn_uninhabited.f.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn_uninhabited.f.GVN.panic-abort.diff @@ -17,14 +17,14 @@ StorageLive(_3); _5 = const f::promoted[0]; _3 = &(*_5); -- _2 = ((*_3).1: E); -+ _2 = ((*_5).1: E); +- _2 = copy ((*_3).1: E); ++ _2 = copy ((*_5).1: E); StorageLive(_1); -- _1 = ((_2 as A).1: u32); +- _1 = copy ((_2 as A).1: u32); + _1 = const 0_u32; StorageDead(_3); StorageDead(_2); -- _0 = _1; +- _0 = copy _1; + _0 = const 0_u32; StorageDead(_1); return; diff --git a/tests/mir-opt/gvn_uninhabited.f.GVN.panic-unwind.diff b/tests/mir-opt/gvn_uninhabited.f.GVN.panic-unwind.diff index 626367766d76d..37b7b0d2c9db3 100644 --- a/tests/mir-opt/gvn_uninhabited.f.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn_uninhabited.f.GVN.panic-unwind.diff @@ -17,14 +17,14 @@ StorageLive(_3); _5 = const f::promoted[0]; _3 = &(*_5); -- _2 = ((*_3).1: E); -+ _2 = ((*_5).1: E); +- _2 = copy ((*_3).1: E); ++ _2 = copy ((*_5).1: E); StorageLive(_1); -- _1 = ((_2 as A).1: u32); +- _1 = copy ((_2 as A).1: u32); + _1 = const 0_u32; StorageDead(_3); StorageDead(_2); -- _0 = _1; +- _0 = copy _1; + _0 = const 0_u32; StorageDead(_1); return; diff --git a/tests/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff index 083515aebc69d..2350faa05d3f0 100644 --- a/tests/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; switchInt(move _2) -> [0: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff index 15319586062b8..94570017730df 100644 --- a/tests/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = Eq(move _3, const -42f32); switchInt(move _2) -> [0: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff index 218d7fd59b735..d19b4148405e2 100644 --- a/tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff @@ -17,11 +17,11 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(move _3, const 17_i8); - StorageDead(_3); -- switchInt(_2) -> [0: bb2, otherwise: bb1]; -+ _2 = Eq(_3, const 17_i8); +- switchInt(copy _2) -> [0: bb2, otherwise: bb1]; ++ _2 = Eq(copy _3, const 17_i8); + nop; + switchInt(move _3) -> [17: bb1, otherwise: bb2]; } @@ -30,7 +30,7 @@ + StorageDead(_3); StorageLive(_6); StorageLive(_7); - _7 = _2; + _7 = copy _2; _6 = move _7 as i32 (IntToInt); StorageDead(_7); _0 = Add(const 100_i32, move _6); @@ -42,7 +42,7 @@ + StorageDead(_3); StorageLive(_4); StorageLive(_5); - _5 = _2; + _5 = copy _2; _4 = move _5 as i32 (IntToInt); StorageDead(_5); _0 = Add(const 10_i32, move _4); diff --git a/tests/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff index fedbd6cdd24a6..e47b7e5225983 100644 --- a/tests/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(move _3, const 'x'); - switchInt(move _2) -> [0: bb2, otherwise: bb1]; + nop; diff --git a/tests/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff index 9c38d8fe06577..b6cdc6af8bf48 100644 --- a/tests/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(move _3, const 42_i8); - switchInt(move _2) -> [0: bb2, otherwise: bb1]; + nop; diff --git a/tests/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff index 8c85ce78565c3..31745ac732a22 100644 --- a/tests/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff @@ -12,7 +12,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(move _3, const 42_u32); - switchInt(move _2) -> [0: bb2, otherwise: bb1]; + nop; @@ -29,7 +29,7 @@ StorageDead(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = Ne(move _5, const 21_u32); - switchInt(move _4) -> [0: bb4, otherwise: bb3]; + nop; diff --git a/tests/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff index 876ed61e9fa3a..d747985f6e135 100644 --- a/tests/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(move _3, const -42_i32); - switchInt(move _2) -> [0: bb2, otherwise: bb1]; + nop; diff --git a/tests/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff index ed3eb47dd3d9d..1d6809a9438a0 100644 --- a/tests/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(move _3, const 42_u32); - switchInt(move _2) -> [0: bb2, otherwise: bb1]; + nop; diff --git a/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-abort.diff b/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-abort.diff index 4e495c37fbc9a..2d64d49ce5c13 100644 --- a/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-abort.diff @@ -21,17 +21,17 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = ::cache::(move _3) -> [return: bb1, unwind unreachable]; } bb1: { StorageDead(_3); StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = try_execute_query::<::C>(move _4) -> [return: bb2, unwind unreachable]; + StorageLive(_5); -+ _5 = _4 as &dyn Cache::V> (PointerCoercion(Unsize)); ++ _5 = copy _4 as &dyn Cache::V> (PointerCoercion(Unsize)); + _0 = ::V> as Cache>::store_nocache(move _5) -> [return: bb2, unwind unreachable]; } diff --git a/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-unwind.diff b/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-unwind.diff index 7fdb7618212a9..c5e9654e19cfd 100644 --- a/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-unwind.diff @@ -21,17 +21,17 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = ::cache::(move _3) -> [return: bb1, unwind continue]; } bb1: { StorageDead(_3); StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = try_execute_query::<::C>(move _4) -> [return: bb2, unwind continue]; + StorageLive(_5); -+ _5 = _4 as &dyn Cache::V> (PointerCoercion(Unsize)); ++ _5 = copy _4 as &dyn Cache::V> (PointerCoercion(Unsize)); + _0 = ::V> as Cache>::store_nocache(move _5) -> [return: bb2, unwind continue]; } diff --git a/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-abort.diff b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-abort.diff index 8df4408690b74..13bc54424d1db 100644 --- a/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-abort.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; _0 = as Cache>::store_nocache(move _2) -> [return: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-unwind.diff b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-unwind.diff index 43a0621f766d4..35d4db3780275 100644 --- a/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-unwind.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; _0 = as Cache>::store_nocache(move _2) -> [return: bb1, unwind continue]; } diff --git a/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-abort.diff b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-abort.diff index e72c312f54966..f02ca6233173f 100644 --- a/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-abort.diff @@ -13,7 +13,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = move _3 as &dyn Cache::V> (PointerCoercion(Unsize)); StorageDead(_3); - _0 = mk_cycle::<::V>(move _2) -> [return: bb1, unwind unreachable]; diff --git a/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-unwind.diff b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-unwind.diff index 46728f9e2e659..31080dff4ded7 100644 --- a/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-unwind.diff @@ -13,7 +13,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = move _3 as &dyn Cache::V> (PointerCoercion(Unsize)); StorageDead(_3); - _0 = mk_cycle::<::V>(move _2) -> [return: bb1, unwind continue]; diff --git a/tests/mir-opt/inline/inline_any_operand.bar.Inline.after.mir b/tests/mir-opt/inline/inline_any_operand.bar.Inline.after.mir index 2d0b71e0a645b..0ee5968419a06 100644 --- a/tests/mir-opt/inline/inline_any_operand.bar.Inline.after.mir +++ b/tests/mir-opt/inline/inline_any_operand.bar.Inline.after.mir @@ -18,12 +18,12 @@ fn bar() -> bool { StorageLive(_1); _1 = foo; StorageLive(_2); - _2 = _1; + _2 = copy _1; StorageLive(_3); _3 = const 1_i32; StorageLive(_4); _4 = const -1_i32; - _0 = Eq(_3, _4); + _0 = Eq(copy _3, copy _4); StorageDead(_4); StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir b/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir index 8a60f4b1bdc6f..5bc227c87df17 100644 --- a/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir +++ b/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir @@ -26,15 +26,15 @@ fn foo(_1: T, _2: i32) -> i32 { _4 = &_3; StorageLive(_5); StorageLive(_6); - _6 = _2; + _6 = copy _2; StorageLive(_7); - _7 = _2; + _7 = copy _2; _5 = (move _6, move _7); StorageLive(_8); _8 = move (_5.0: i32); StorageLive(_9); _9 = move (_5.1: i32); - _0 = _8; + _0 = copy _8; StorageDead(_9); StorageDead(_8); StorageDead(_7); diff --git a/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir b/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir index f524b054b61bd..7930111cf2296 100644 --- a/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir +++ b/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir @@ -26,15 +26,15 @@ fn foo(_1: T, _2: &i32) -> i32 { _4 = &_3; StorageLive(_5); StorageLive(_6); - _6 = _2; + _6 = copy _2; StorageLive(_7); - _7 = _2; + _7 = copy _2; _5 = (move _6, move _7); StorageLive(_8); _8 = move (_5.0: &i32); StorageLive(_9); _9 = move (_5.1: &i32); - _0 = (*_8); + _0 = copy (*_8); StorageDead(_9); StorageDead(_8); StorageDead(_7); diff --git a/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir b/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir index 2f9d28ea09376..17e6e39a86bc7 100644 --- a/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir +++ b/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir @@ -34,18 +34,18 @@ fn foo(_1: T, _2: i32) -> (i32, T) { _6 = &_3; StorageLive(_7); StorageLive(_8); - _8 = _2; + _8 = copy _2; _7 = (move _8,); StorageLive(_9); _9 = move (_7.0: i32); StorageLive(_10); StorageLive(_12); StorageLive(_11); - _10 = ((*_6).0: &i32); - _11 = (*_10); + _10 = copy ((*_6).0: &i32); + _11 = copy (*_10); StorageLive(_13); - _12 = ((*_6).1: &T); - _13 = (*_12); + _12 = copy ((*_6).1: &T); + _13 = copy (*_12); _0 = (move _11, move _13); StorageDead(_13); StorageDead(_11); diff --git a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff index 07031a298bc36..94017f028cccf 100644 --- a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff @@ -34,13 +34,13 @@ - _4 = g() -> [return: bb1, unwind unreachable]; + _4 = {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8 (#0)}; + _3 = &mut _4; -+ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}> { __pointer: _3 }; ++ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}> { __pointer: copy _3 }; + StorageDead(_3); + StorageLive(_5); + _5 = const false; + StorageLive(_6); + StorageLive(_7); -+ _6 = (_2.0: &mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}); ++ _6 = copy (_2.0: &mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}); + _7 = discriminant((*_6)); + switchInt(move _7) -> [0: bb3, 1: bb7, 3: bb8, otherwise: bb9]; } @@ -68,7 +68,7 @@ - StorageDead(_2); - drop(_4) -> [return: bb4, unwind unreachable]; + StorageLive(_8); -+ switchInt(_5) -> [0: bb4, otherwise: bb5]; ++ switchInt(copy _5) -> [0: bb4, otherwise: bb5]; } bb4: { @@ -99,7 +99,7 @@ + bb8: { + StorageLive(_8); + StorageDead(_8); -+ _1 = CoroutineState::::Complete(_5); ++ _1 = CoroutineState::::Complete(copy _5); + discriminant((*_6)) = 1; + goto -> bb2; + } diff --git a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff index ab6c62b0baf56..858f9ace9b40a 100644 --- a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff @@ -34,13 +34,13 @@ - _4 = g() -> [return: bb1, unwind continue]; + _4 = {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8 (#0)}; + _3 = &mut _4; -+ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}> { __pointer: _3 }; ++ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}> { __pointer: copy _3 }; + StorageDead(_3); + StorageLive(_5); + _5 = const false; + StorageLive(_6); + StorageLive(_7); -+ _6 = (_2.0: &mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}); ++ _6 = copy (_2.0: &mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}); + _7 = discriminant((*_6)); + switchInt(move _7) -> [0: bb5, 1: bb9, 3: bb10, otherwise: bb11]; } @@ -84,7 +84,7 @@ - drop(_4) -> [return: bb6, unwind terminate(cleanup)]; + bb5: { + StorageLive(_8); -+ switchInt(_5) -> [0: bb6, otherwise: bb7]; ++ switchInt(copy _5) -> [0: bb6, otherwise: bb7]; } - bb6 (cleanup): { @@ -113,7 +113,7 @@ + bb10: { + StorageLive(_8); + StorageDead(_8); -+ _1 = CoroutineState::::Complete(_5); ++ _1 = CoroutineState::::Complete(copy _5); + discriminant((*_6)) = 1; + goto -> bb4; + } diff --git a/tests/mir-opt/inline/inline_diverging.g.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_diverging.g.Inline.panic-abort.diff index d675695eb1047..bda855865153a 100644 --- a/tests/mir-opt/inline/inline_diverging.g.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/inline_diverging.g.Inline.panic-abort.diff @@ -16,7 +16,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = Gt(move _3, const 0_i32); switchInt(move _2) -> [0: bb2, otherwise: bb1]; } @@ -24,7 +24,7 @@ bb1: { StorageDead(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; _0 = move _4 as u32 (IntToInt); StorageDead(_4); StorageDead(_2); diff --git a/tests/mir-opt/inline/inline_diverging.g.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_diverging.g.Inline.panic-unwind.diff index 1142616115fb7..ecd72d2b37fa9 100644 --- a/tests/mir-opt/inline/inline_diverging.g.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/inline_diverging.g.Inline.panic-unwind.diff @@ -16,7 +16,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = Gt(move _3, const 0_i32); switchInt(move _2) -> [0: bb2, otherwise: bb1]; } @@ -24,7 +24,7 @@ bb1: { StorageDead(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; _0 = move _4 as u32 (IntToInt); StorageDead(_4); StorageDead(_2); diff --git a/tests/mir-opt/inline/inline_diverging.h.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_diverging.h.Inline.panic-abort.diff index 2bbb830fc7790..338dca85e5c9f 100644 --- a/tests/mir-opt/inline/inline_diverging.h.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/inline_diverging.h.Inline.panic-abort.diff @@ -40,7 +40,7 @@ + + bb2: { + StorageDead(_5); -+ _1 = (_4, _6); ++ _1 = (copy _4, copy _6); + drop(_2) -> [return: bb3, unwind unreachable]; + } + diff --git a/tests/mir-opt/inline/inline_diverging.h.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_diverging.h.Inline.panic-unwind.diff index bc4f2d24df0b5..a77cb913bfd03 100644 --- a/tests/mir-opt/inline/inline_diverging.h.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/inline_diverging.h.Inline.panic-unwind.diff @@ -43,7 +43,7 @@ + StorageDead(_5); + StorageLive(_7); + _7 = move _4; -+ _1 = (move _7, _6); ++ _1 = (move _7, copy _6); + StorageDead(_7); + StorageDead(_4); + drop(_2) -> [return: bb3, unwind continue]; diff --git a/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_direct.Inline.after.panic-abort.mir b/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_direct.Inline.after.panic-abort.mir index 522f772c6f48e..9b28aeb271df3 100644 --- a/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_direct.Inline.after.panic-abort.mir +++ b/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_direct.Inline.after.panic-abort.mir @@ -9,7 +9,7 @@ fn marked_inline_direct(_1: i32) -> () { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = call_twice(move _3) -> [return: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_direct.Inline.after.panic-unwind.mir b/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_direct.Inline.after.panic-unwind.mir index 722b02eeba806..929c89940dcb5 100644 --- a/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_direct.Inline.after.panic-unwind.mir +++ b/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_direct.Inline.after.panic-unwind.mir @@ -9,7 +9,7 @@ fn marked_inline_direct(_1: i32) -> () { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = call_twice(move _3) -> [return: bb1, unwind continue]; } diff --git a/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_indirect.Inline.after.panic-abort.mir b/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_indirect.Inline.after.panic-abort.mir index 63b91cbce2d60..374ed294d8b26 100644 --- a/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_indirect.Inline.after.panic-abort.mir +++ b/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_indirect.Inline.after.panic-abort.mir @@ -12,7 +12,7 @@ fn marked_inline_indirect(_1: i32) -> () { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); _4 = call_twice(move _3) -> [return: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_indirect.Inline.after.panic-unwind.mir b/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_indirect.Inline.after.panic-unwind.mir index 7c84e98dd516c..97bed8020bad7 100644 --- a/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_indirect.Inline.after.panic-unwind.mir +++ b/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_indirect.Inline.after.panic-unwind.mir @@ -12,7 +12,7 @@ fn marked_inline_indirect(_1: i32) -> () { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); _4 = call_twice(move _3) -> [return: bb1, unwind continue]; } diff --git a/tests/mir-opt/inline/inline_more_in_non_inline.monomorphic_not_inline.Inline.after.panic-abort.mir b/tests/mir-opt/inline/inline_more_in_non_inline.monomorphic_not_inline.Inline.after.panic-abort.mir index 989014b8b476d..cffe0e96f5c94 100644 --- a/tests/mir-opt/inline/inline_more_in_non_inline.monomorphic_not_inline.Inline.after.panic-abort.mir +++ b/tests/mir-opt/inline/inline_more_in_non_inline.monomorphic_not_inline.Inline.after.panic-abort.mir @@ -13,10 +13,10 @@ fn monomorphic_not_inline(_1: i32) -> () { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); StorageLive(_5); - _4 = other_thing(_3) -> [return: bb2, unwind unreachable]; + _4 = other_thing(copy _3) -> [return: bb2, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/inline/inline_more_in_non_inline.monomorphic_not_inline.Inline.after.panic-unwind.mir b/tests/mir-opt/inline/inline_more_in_non_inline.monomorphic_not_inline.Inline.after.panic-unwind.mir index bd200719bbbe9..7f3a093012bcd 100644 --- a/tests/mir-opt/inline/inline_more_in_non_inline.monomorphic_not_inline.Inline.after.panic-unwind.mir +++ b/tests/mir-opt/inline/inline_more_in_non_inline.monomorphic_not_inline.Inline.after.panic-unwind.mir @@ -13,10 +13,10 @@ fn monomorphic_not_inline(_1: i32) -> () { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); StorageLive(_5); - _4 = other_thing(_3) -> [return: bb2, unwind continue]; + _4 = other_thing(copy _3) -> [return: bb2, unwind continue]; } bb1: { diff --git a/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir b/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir index ec3c79e2a3749..9a256ea19496a 100644 --- a/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir +++ b/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir @@ -26,25 +26,25 @@ fn bar() -> bool { StorageLive(_1); _1 = foo; StorageLive(_2); - _2 = _1; + _2 = copy _1; StorageLive(_3); StorageLive(_4); _10 = const bar::promoted[1]; Retag(_10); - _4 = _10; - _3 = _4; + _4 = copy _10; + _3 = copy _4; StorageLive(_6); StorageLive(_7); _9 = const bar::promoted[0]; Retag(_9); - _7 = _9; - _6 = _7; + _7 = copy _9; + _6 = copy _7; Retag(_3); Retag(_6); StorageLive(_11); - _11 = (*_3); + _11 = copy (*_3); StorageLive(_12); - _12 = (*_6); + _12 = copy (*_6); _0 = Eq(move _11, move _12); StorageDead(_12); StorageDead(_11); diff --git a/tests/mir-opt/inline/inline_shims.clone.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_shims.clone.Inline.panic-abort.diff index 8117e58fa51a3..26b4dc357f337 100644 --- a/tests/mir-opt/inline/inline_shims.clone.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/inline_shims.clone.Inline.panic-abort.diff @@ -15,7 +15,7 @@ - } - - bb1: { -+ _0 = (*_2); ++ _0 = copy (*_2); StorageDead(_2); return; } diff --git a/tests/mir-opt/inline/inline_shims.clone.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_shims.clone.Inline.panic-unwind.diff index 00e92a0f5e5af..faa12d5c73605 100644 --- a/tests/mir-opt/inline/inline_shims.clone.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/inline_shims.clone.Inline.panic-unwind.diff @@ -15,7 +15,7 @@ - } - - bb1: { -+ _0 = (*_2); ++ _0 = copy (*_2); StorageDead(_2); return; } diff --git a/tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff index 2a36ccaab110a..581244074b36c 100644 --- a/tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff @@ -20,7 +20,7 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; - _3 = std::ptr::drop_in_place::>(move _4) -> [return: bb1, unwind unreachable]; + StorageLive(_6); + StorageLive(_7); @@ -34,7 +34,7 @@ StorageDead(_4); StorageDead(_3); StorageLive(_5); - _5 = _2; + _5 = copy _2; - _0 = std::ptr::drop_in_place::>(move _5) -> [return: bb2, unwind unreachable]; + StorageLive(_8); + StorageLive(_9); diff --git a/tests/mir-opt/inline/inline_shims.drop.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_shims.drop.Inline.panic-unwind.diff index e11561076e641..d89ca003d77b3 100644 --- a/tests/mir-opt/inline/inline_shims.drop.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/inline_shims.drop.Inline.panic-unwind.diff @@ -16,7 +16,7 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; _3 = std::ptr::drop_in_place::>(move _4) -> [return: bb1, unwind continue]; } @@ -24,7 +24,7 @@ StorageDead(_4); StorageDead(_3); StorageLive(_5); - _5 = _2; + _5 = copy _2; - _0 = std::ptr::drop_in_place::>(move _5) -> [return: bb2, unwind continue]; + StorageLive(_6); + StorageLive(_7); diff --git a/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-abort.mir b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-abort.mir index d7b4302b06d9f..8355cd0070de3 100644 --- a/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-abort.mir +++ b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-abort.mir @@ -7,7 +7,7 @@ fn test(_1: &dyn X) -> u32 { bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; _0 = ::y(move _2) -> [return: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-unwind.mir b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-unwind.mir index 0d6f3e61f71f3..ebfbfeb0b13eb 100644 --- a/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-unwind.mir +++ b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-unwind.mir @@ -7,7 +7,7 @@ fn test(_1: &dyn X) -> u32 { bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; _0 = ::y(move _2) -> [return: bb1, unwind continue]; } diff --git a/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-abort.mir b/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-abort.mir index af79c7ce1968a..1105dba06ac41 100644 --- a/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-abort.mir +++ b/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-abort.mir @@ -12,7 +12,7 @@ fn test2(_1: &dyn X) -> bool { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = move _3; StorageDead(_3); _0 = ::y(move _2) -> [return: bb1, unwind unreachable]; diff --git a/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-unwind.mir b/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-unwind.mir index bf5a56b8e6240..faa6ef47b18a4 100644 --- a/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-unwind.mir +++ b/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-unwind.mir @@ -12,7 +12,7 @@ fn test2(_1: &dyn X) -> bool { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = move _3; StorageDead(_3); _0 = ::y(move _2) -> [return: bb1, unwind continue]; diff --git a/tests/mir-opt/inline/issue_106141.outer.Inline.panic-abort.diff b/tests/mir-opt/inline/issue_106141.outer.Inline.panic-abort.diff index 2ab79cc2a509e..e87a565f0fc98 100644 --- a/tests/mir-opt/inline/issue_106141.outer.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/issue_106141.outer.Inline.panic-abort.diff @@ -25,12 +25,12 @@ bb1: { + StorageLive(_3); -+ _2 = Lt(_0, const 1_usize); -+ assert(move _2, "index out of bounds: the length is {} but the index is {}", const 1_usize, _0) -> [success: bb2, unwind unreachable]; ++ _2 = Lt(copy _0, const 1_usize); ++ assert(move _2, "index out of bounds: the length is {} but the index is {}", const 1_usize, copy _0) -> [success: bb2, unwind unreachable]; + } + + bb2: { -+ _3 = (*_1)[_0]; ++ _3 = copy (*_1)[_0]; + switchInt(move _3) -> [0: bb3, otherwise: bb4]; + } + diff --git a/tests/mir-opt/inline/issue_106141.outer.Inline.panic-unwind.diff b/tests/mir-opt/inline/issue_106141.outer.Inline.panic-unwind.diff index 4d96a86288596..834851b75adf1 100644 --- a/tests/mir-opt/inline/issue_106141.outer.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/issue_106141.outer.Inline.panic-unwind.diff @@ -25,12 +25,12 @@ bb1: { + StorageLive(_3); -+ _2 = Lt(_0, const 1_usize); -+ assert(move _2, "index out of bounds: the length is {} but the index is {}", const 1_usize, _0) -> [success: bb2, unwind continue]; ++ _2 = Lt(copy _0, const 1_usize); ++ assert(move _2, "index out of bounds: the length is {} but the index is {}", const 1_usize, copy _0) -> [success: bb2, unwind continue]; + } + + bb2: { -+ _3 = (*_1)[_0]; ++ _3 = copy (*_1)[_0]; + switchInt(move _3) -> [0: bb3, otherwise: bb4]; + } + diff --git a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir index 8c457037ec971..a48a9a0bb0c46 100644 --- a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir +++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir @@ -14,11 +14,11 @@ fn a(_1: &mut [T]) -> &mut [T] { StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; - _3 = _4; - _2 = _3; + _4 = copy _1; + _3 = copy _4; + _2 = copy _3; StorageDead(_4); - _0 = _2; + _0 = copy _2; StorageDead(_3); StorageDead(_2); return; diff --git a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir index e27d9fe38c7e2..02aadfc1de064 100644 --- a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir +++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir @@ -16,17 +16,17 @@ fn b(_1: &mut Box) -> &mut T { StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); StorageLive(_6); - _5 = (*_4); - _6 = (((_5.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const T); + _5 = copy (*_4); + _6 = copy (((_5.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const T); _3 = &mut (*_6); StorageDead(_6); StorageDead(_5); - _2 = _3; + _2 = copy _3; StorageDead(_4); - _0 = _2; + _0 = copy _2; StorageDead(_3); StorageDead(_2); return; diff --git a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir index da0464c64d697..2d88f9e55249f 100644 --- a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir +++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir @@ -12,9 +12,9 @@ fn c(_1: &[T]) -> &[T] { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; - _2 = _3; - _0 = _2; + _3 = copy _1; + _2 = copy _3; + _0 = copy _2; StorageDead(_3); StorageDead(_2); return; diff --git a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir index 25eaedfc842d2..1ea347510fdb4 100644 --- a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir +++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir @@ -14,15 +14,15 @@ fn d(_1: &Box) -> &T { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); StorageLive(_5); - _4 = (*_3); - _5 = (((_4.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const T); + _4 = copy (*_3); + _5 = copy (((_4.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const T); _2 = &(*_5); StorageDead(_5); StorageDead(_4); - _0 = _2; + _0 = copy _2; StorageDead(_3); StorageDead(_2); return; diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff index 0d9d58316ea19..f36157a762c27 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff @@ -18,9 +18,9 @@ bb0: { StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = core::num::::unchecked_shl(move _3, move _4) -> [return: bb1, unwind unreachable]; + StorageLive(_6); + StorageLive(_5); @@ -29,12 +29,12 @@ } bb1: { -+ _6 = core::num::::unchecked_shl::precondition_check(_4) -> [return: bb2, unwind unreachable]; ++ _6 = core::num::::unchecked_shl::precondition_check(copy _4) -> [return: bb2, unwind unreachable]; + } + + bb2: { + StorageDead(_5); -+ _0 = ShlUnchecked(_3, _4); ++ _0 = ShlUnchecked(copy _3, copy _4); + StorageDead(_6); StorageDead(_4); StorageDead(_3); diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff index 82f7eceaa1808..be1b066c6c1b4 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff @@ -18,9 +18,9 @@ bb0: { StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = core::num::::unchecked_shl(move _3, move _4) -> [return: bb1, unwind continue]; + StorageLive(_6); + StorageLive(_5); @@ -29,12 +29,12 @@ } bb1: { -+ _6 = core::num::::unchecked_shl::precondition_check(_4) -> [return: bb2, unwind unreachable]; ++ _6 = core::num::::unchecked_shl::precondition_check(copy _4) -> [return: bb2, unwind unreachable]; + } + + bb2: { + StorageDead(_5); -+ _0 = ShlUnchecked(_3, _4); ++ _0 = ShlUnchecked(copy _3, copy _4); + StorageDead(_6); StorageDead(_4); StorageDead(_3); diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-abort.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-abort.mir index dc27685ee79b2..611273ab08d74 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-abort.mir @@ -12,7 +12,7 @@ fn unchecked_shl_unsigned_smaller(_1: u16, _2: u32) -> u16 { } bb0: { - _0 = ShlUnchecked(_1, _2); + _0 = ShlUnchecked(copy _1, copy _2); return; } } diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-unwind.mir index dc27685ee79b2..611273ab08d74 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-unwind.mir @@ -12,7 +12,7 @@ fn unchecked_shl_unsigned_smaller(_1: u16, _2: u32) -> u16 { } bb0: { - _0 = ShlUnchecked(_1, _2); + _0 = ShlUnchecked(copy _1, copy _2); return; } } diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff index 6894b24669908..360687f3c4e7f 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff @@ -18,9 +18,9 @@ bb0: { StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = core::num::::unchecked_shr(move _3, move _4) -> [return: bb1, unwind unreachable]; + StorageLive(_6); + StorageLive(_5); @@ -29,12 +29,12 @@ } bb1: { -+ _6 = core::num::::unchecked_shr::precondition_check(_4) -> [return: bb2, unwind unreachable]; ++ _6 = core::num::::unchecked_shr::precondition_check(copy _4) -> [return: bb2, unwind unreachable]; + } + + bb2: { + StorageDead(_5); -+ _0 = ShrUnchecked(_3, _4); ++ _0 = ShrUnchecked(copy _3, copy _4); + StorageDead(_6); StorageDead(_4); StorageDead(_3); diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff index 070f4a1c5c835..986df55df0372 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff @@ -18,9 +18,9 @@ bb0: { StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = core::num::::unchecked_shr(move _3, move _4) -> [return: bb1, unwind continue]; + StorageLive(_6); + StorageLive(_5); @@ -29,12 +29,12 @@ } bb1: { -+ _6 = core::num::::unchecked_shr::precondition_check(_4) -> [return: bb2, unwind unreachable]; ++ _6 = core::num::::unchecked_shr::precondition_check(copy _4) -> [return: bb2, unwind unreachable]; + } + + bb2: { + StorageDead(_5); -+ _0 = ShrUnchecked(_3, _4); ++ _0 = ShrUnchecked(copy _3, copy _4); + StorageDead(_6); StorageDead(_4); StorageDead(_3); diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-abort.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-abort.mir index 54f093b87d19f..f4ddd0bca04d9 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-abort.mir @@ -12,7 +12,7 @@ fn unchecked_shr_signed_bigger(_1: i64, _2: u32) -> i64 { } bb0: { - _0 = ShrUnchecked(_1, _2); + _0 = ShrUnchecked(copy _1, copy _2); return; } } diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-unwind.mir index 54f093b87d19f..f4ddd0bca04d9 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-unwind.mir @@ -12,7 +12,7 @@ fn unchecked_shr_signed_bigger(_1: i64, _2: u32) -> i64 { } bb0: { - _0 = ShrUnchecked(_1, _2); + _0 = ShrUnchecked(copy _1, copy _2); return; } } diff --git a/tests/mir-opt/inline/unsized_argument.caller.Inline.diff b/tests/mir-opt/inline/unsized_argument.caller.Inline.diff index 37083973fd159..70671e2089a01 100644 --- a/tests/mir-opt/inline/unsized_argument.caller.Inline.diff +++ b/tests/mir-opt/inline/unsized_argument.caller.Inline.diff @@ -12,7 +12,7 @@ StorageLive(_2); StorageLive(_3); _3 = move _1; - _4 = (((_3.0: std::ptr::Unique<[i32]>).0: std::ptr::NonNull<[i32]>).0: *const [i32]); + _4 = copy (((_3.0: std::ptr::Unique<[i32]>).0: std::ptr::NonNull<[i32]>).0: *const [i32]); _2 = callee(move (*_4)) -> [return: bb1, unwind: bb3]; } diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-abort.diff b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-abort.diff index c1f7879cf0e8c..28878736ed7cd 100644 --- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-abort.diff @@ -36,7 +36,7 @@ + bb2: { + StorageLive(_4); + _4 = UbChecks(); -+ assume(_4); ++ assume(copy _4); + _5 = unreachable_unchecked::precondition_check() -> [return: bb1, unwind unreachable]; + } + diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-unwind.diff b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-unwind.diff index 5271e538dafe4..27b6bb6a5bb23 100644 --- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-unwind.diff @@ -40,7 +40,7 @@ + bb2: { + StorageLive(_4); + _4 = UbChecks(); -+ assume(_4); ++ assume(copy _4); + _5 = unreachable_unchecked::precondition_check() -> [return: bb1, unwind unreachable]; + } + diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-abort.mir b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-abort.mir index dcab8a679a875..66ab5e1b96228 100644 --- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-abort.mir @@ -22,7 +22,7 @@ fn unwrap_unchecked(_1: Option) -> T { } bb1: { - _0 = ((_1 as Some).0: T); + _0 = copy ((_1 as Some).0: T); StorageDead(_2); return; } diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-unwind.mir index dcab8a679a875..66ab5e1b96228 100644 --- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-unwind.mir @@ -22,7 +22,7 @@ fn unwrap_unchecked(_1: Option) -> T { } bb1: { - _0 = ((_1 as Some).0: T); + _0 = copy ((_1 as Some).0: T); StorageDead(_2); return; } diff --git a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff index f8715789cec14..1e33e222b27f6 100644 --- a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff +++ b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff @@ -85,7 +85,7 @@ - } - - bb2: { -+ _4 = Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}> { __pointer: _5 }; ++ _4 = Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}> { __pointer: copy _5 }; StorageDead(_5); StorageLive(_6); StorageLive(_7); @@ -160,7 +160,7 @@ + StorageLive(_14); + _14 = (); + StorageLive(_41); -+ _41 = Option::<()>::Some(_14); ++ _41 = Option::<()>::Some(copy _14); + _13 = std::future::Ready::<()>(move _41); + StorageDead(_41); + StorageDead(_14); @@ -193,7 +193,7 @@ + StorageLive(_22); + StorageLive(_23); + StorageLive(_24); -+ _24 = _31; ++ _24 = copy _31; + _23 = move _24; + _22 = &mut (*_23); + StorageDead(_24); @@ -231,8 +231,8 @@ + + bb10: { + StorageLive(_26); -+ _26 = ((_18 as Ready).0: ()); -+ _30 = _26; ++ _26 = copy ((_18 as Ready).0: ()); ++ _30 = copy _26; + StorageDead(_26); + StorageDead(_23); + StorageDead(_21); diff --git a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff index 494f5591e3250..b1840beb3efcc 100644 --- a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff @@ -87,7 +87,7 @@ - } - - bb2: { -+ _4 = Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}> { __pointer: _5 }; ++ _4 = Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}> { __pointer: copy _5 }; StorageDead(_5); StorageLive(_6); StorageLive(_7); @@ -177,7 +177,7 @@ + StorageLive(_14); + _14 = (); + StorageLive(_43); -+ _43 = Option::<()>::Some(_14); ++ _43 = Option::<()>::Some(copy _14); + _13 = std::future::Ready::<()>(move _43); + StorageDead(_43); + StorageDead(_14); @@ -212,7 +212,7 @@ + StorageLive(_22); + StorageLive(_23); + StorageLive(_24); -+ _24 = _31; ++ _24 = copy _31; + _23 = move _24; + _22 = &mut (*_23); + StorageDead(_24); @@ -250,8 +250,8 @@ + + bb12: { + StorageLive(_26); -+ _26 = ((_18 as Ready).0: ()); -+ _30 = _26; ++ _26 = copy ((_18 as Ready).0: ()); ++ _30 = copy _26; + StorageDead(_26); + StorageDead(_23); + StorageDead(_21); diff --git a/tests/mir-opt/instsimplify/bool_compare.eq_false.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/bool_compare.eq_false.InstSimplify-after-simplifycfg.diff index fea5f4f02ceb9..4762123184b65 100644 --- a/tests/mir-opt/instsimplify/bool_compare.eq_false.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/bool_compare.eq_false.InstSimplify-after-simplifycfg.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(move _3, const false); + _2 = Not(move _3); switchInt(move _2) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/instsimplify/bool_compare.eq_true.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/bool_compare.eq_true.InstSimplify-after-simplifycfg.diff index 9a509ccfa67b1..6fae0acf439d2 100644 --- a/tests/mir-opt/instsimplify/bool_compare.eq_true.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/bool_compare.eq_true.InstSimplify-after-simplifycfg.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(move _3, const true); + _2 = move _3; switchInt(move _2) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/instsimplify/bool_compare.false_eq.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/bool_compare.false_eq.InstSimplify-after-simplifycfg.diff index e4ec4c80579ed..7975a808d4f2b 100644 --- a/tests/mir-opt/instsimplify/bool_compare.false_eq.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/bool_compare.false_eq.InstSimplify-after-simplifycfg.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(const false, move _3); + _2 = Not(move _3); switchInt(move _2) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/instsimplify/bool_compare.false_ne.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/bool_compare.false_ne.InstSimplify-after-simplifycfg.diff index 3aea55f4db4f2..80d0cd62007b4 100644 --- a/tests/mir-opt/instsimplify/bool_compare.false_ne.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/bool_compare.false_ne.InstSimplify-after-simplifycfg.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Ne(const false, move _3); + _2 = move _3; switchInt(move _2) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/instsimplify/bool_compare.ne_false.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/bool_compare.ne_false.InstSimplify-after-simplifycfg.diff index b6e891088a1df..c0f8b5261c276 100644 --- a/tests/mir-opt/instsimplify/bool_compare.ne_false.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/bool_compare.ne_false.InstSimplify-after-simplifycfg.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Ne(move _3, const false); + _2 = move _3; switchInt(move _2) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/instsimplify/bool_compare.ne_true.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/bool_compare.ne_true.InstSimplify-after-simplifycfg.diff index 974738bb3a9ee..4627b31440887 100644 --- a/tests/mir-opt/instsimplify/bool_compare.ne_true.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/bool_compare.ne_true.InstSimplify-after-simplifycfg.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Ne(move _3, const true); + _2 = Not(move _3); switchInt(move _2) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/instsimplify/bool_compare.true_eq.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/bool_compare.true_eq.InstSimplify-after-simplifycfg.diff index 240835bf7f22a..91ca1ba553e02 100644 --- a/tests/mir-opt/instsimplify/bool_compare.true_eq.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/bool_compare.true_eq.InstSimplify-after-simplifycfg.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(const true, move _3); + _2 = move _3; switchInt(move _2) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/instsimplify/bool_compare.true_ne.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/bool_compare.true_ne.InstSimplify-after-simplifycfg.diff index 1e2b2c27f5707..744c61b987d1a 100644 --- a/tests/mir-opt/instsimplify/bool_compare.true_ne.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/bool_compare.true_ne.InstSimplify-after-simplifycfg.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Ne(const true, move _3); + _2 = Not(move _3); switchInt(move _2) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/instsimplify/casts.redundant.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/casts.redundant.InstSimplify-after-simplifycfg.diff index 7001589d9e3c8..afa25ecdbfba4 100644 --- a/tests/mir-opt/instsimplify/casts.redundant.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/casts.redundant.InstSimplify-after-simplifycfg.diff @@ -15,16 +15,16 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _4; + _5 = copy _4; - _3 = move _5 as *const &u8 (PtrToPtr); + _3 = move _5; StorageDead(_5); StorageDead(_4); - _2 = move _3 as *const &u8 (PtrToPtr); + _2 = move _3; - _0 = _2; + _0 = copy _2; StorageDead(_3); StorageDead(_2); return; diff --git a/tests/mir-opt/instsimplify/casts.roundtrip.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/casts.roundtrip.InstSimplify-after-simplifycfg.diff index e1045db973078..12e2913a8ca8d 100644 --- a/tests/mir-opt/instsimplify/casts.roundtrip.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/casts.roundtrip.InstSimplify-after-simplifycfg.diff @@ -12,7 +12,7 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; _3 = move _4 as *mut u8 (PtrToPtr); _2 = move _3 as *const u8 (PtrToPtr); StorageDead(_4); diff --git a/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-abort.diff b/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-abort.diff index a7de09ca38682..f39df7ffca0fb 100644 --- a/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-abort.diff +++ b/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-abort.diff @@ -31,38 +31,38 @@ _3 = const 0_usize; - _4 = Len(_1); + _4 = const 2_usize; - _5 = Lt(_3, _4); - assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; + _5 = Lt(copy _3, copy _4); + assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind unreachable]; } bb1: { - _2 = _1[_3]; + _2 = copy _1[_3]; StorageDead(_3); StorageLive(_6); StorageLive(_7); _7 = const 1_usize; - _8 = Len(_1); + _8 = const 2_usize; - _9 = Lt(_7, _8); - assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind unreachable]; + _9 = Lt(copy _7, copy _8); + assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb2, unwind unreachable]; } bb2: { - _6 = _1[_7]; + _6 = copy _1[_7]; StorageDead(_7); StorageLive(_10); StorageLive(_11); - _11 = _2; + _11 = copy _2; StorageLive(_12); - _12 = _2; + _12 = copy _2; _10 = Mul(move _11, move _12); StorageDead(_12); StorageDead(_11); StorageLive(_13); StorageLive(_14); - _14 = _6; + _14 = copy _6; StorageLive(_15); - _15 = _6; + _15 = copy _6; _13 = Mul(move _14, move _15); StorageDead(_15); StorageDead(_14); diff --git a/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-unwind.diff b/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-unwind.diff index c15f7e47fe36f..0e7d5653c6820 100644 --- a/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-unwind.diff +++ b/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-unwind.diff @@ -31,38 +31,38 @@ _3 = const 0_usize; - _4 = Len(_1); + _4 = const 2_usize; - _5 = Lt(_3, _4); - assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue]; + _5 = Lt(copy _3, copy _4); + assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind continue]; } bb1: { - _2 = _1[_3]; + _2 = copy _1[_3]; StorageDead(_3); StorageLive(_6); StorageLive(_7); _7 = const 1_usize; - _8 = Len(_1); + _8 = const 2_usize; - _9 = Lt(_7, _8); - assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind continue]; + _9 = Lt(copy _7, copy _8); + assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb2, unwind continue]; } bb2: { - _6 = _1[_7]; + _6 = copy _1[_7]; StorageDead(_7); StorageLive(_10); StorageLive(_11); - _11 = _2; + _11 = copy _2; StorageLive(_12); - _12 = _2; + _12 = copy _2; _10 = Mul(move _11, move _12); StorageDead(_12); StorageDead(_11); StorageLive(_13); StorageLive(_14); - _14 = _6; + _14 = copy _6; StorageLive(_15); - _15 = _6; + _15 = copy _6; _13 = Mul(move _14, move _15); StorageDead(_15); StorageDead(_14); diff --git a/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-abort.diff b/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-abort.diff index c6f858d89eb2c..d0b50c597c4f7 100644 --- a/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-abort.diff +++ b/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-abort.diff @@ -20,7 +20,7 @@ StorageLive(_4); _4 = &((*_1).0: T); - _3 = &(*_4); -+ _3 = _4; ++ _3 = copy _4; _2 = ::clone(move _3) -> [return: bb1, unwind unreachable]; } @@ -32,8 +32,8 @@ _7 = &((*_1).1: u64); - _6 = &(*_7); - _5 = ::clone(move _6) -> [return: bb2, unwind unreachable]; -+ _6 = _7; -+ _5 = (*_6); ++ _6 = copy _7; ++ _5 = copy (*_6); + goto -> bb2; } @@ -45,8 +45,8 @@ _10 = &((*_1).2: [f32; 3]); - _9 = &(*_10); - _8 = <[f32; 3] as Clone>::clone(move _9) -> [return: bb3, unwind unreachable]; -+ _9 = _10; -+ _8 = (*_9); ++ _9 = copy _10; ++ _8 = copy (*_9); + goto -> bb3; } diff --git a/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-unwind.diff b/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-unwind.diff index 691ab1f0e7fb7..b8f4f348530a3 100644 --- a/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-unwind.diff +++ b/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-unwind.diff @@ -20,7 +20,7 @@ StorageLive(_4); _4 = &((*_1).0: T); - _3 = &(*_4); -+ _3 = _4; ++ _3 = copy _4; _2 = ::clone(move _3) -> [return: bb1, unwind continue]; } @@ -32,8 +32,8 @@ _7 = &((*_1).1: u64); - _6 = &(*_7); - _5 = ::clone(move _6) -> [return: bb2, unwind: bb4]; -+ _6 = _7; -+ _5 = (*_6); ++ _6 = copy _7; ++ _5 = copy (*_6); + goto -> bb2; } @@ -45,8 +45,8 @@ _10 = &((*_1).2: [f32; 3]); - _9 = &(*_10); - _8 = <[f32; 3] as Clone>::clone(move _9) -> [return: bb3, unwind: bb4]; -+ _9 = _10; -+ _8 = (*_9); ++ _9 = copy _10; ++ _8 = copy (*_9); + goto -> bb3; } diff --git a/tests/mir-opt/instsimplify/duplicate_switch_targets.assert_zero.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/duplicate_switch_targets.assert_zero.InstSimplify-after-simplifycfg.diff index 7596aa203086e..5d74f0f75db95 100644 --- a/tests/mir-opt/instsimplify/duplicate_switch_targets.assert_zero.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/duplicate_switch_targets.assert_zero.InstSimplify-after-simplifycfg.diff @@ -5,8 +5,8 @@ let mut _0: u8; bb0: { -- switchInt(_1) -> [0: bb2, 1: bb1, otherwise: bb1]; -+ switchInt(_1) -> [0: bb2, otherwise: bb1]; +- switchInt(copy _1) -> [0: bb2, 1: bb1, otherwise: bb1]; ++ switchInt(copy _1) -> [0: bb2, otherwise: bb1]; } bb1: { @@ -14,7 +14,7 @@ } bb2: { - _0 = _1; + _0 = copy _1; return; } } diff --git a/tests/mir-opt/instsimplify/ref_of_deref.pointers.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/ref_of_deref.pointers.InstSimplify-after-simplifycfg.diff index ca26f0240f9de..b2f720be9e166 100644 --- a/tests/mir-opt/instsimplify/ref_of_deref.pointers.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/ref_of_deref.pointers.InstSimplify-after-simplifycfg.diff @@ -39,12 +39,12 @@ _5 = &mut (*_2); StorageLive(_6); - _6 = &raw const (*_1); -+ _6 = _1; ++ _6 = copy _1; StorageLive(_7); _7 = &raw const (*_2); StorageLive(_8); - _8 = &raw mut (*_2); -+ _8 = _2; ++ _8 = copy _2; _0 = const (); StorageDead(_8); StorageDead(_7); diff --git a/tests/mir-opt/instsimplify/ref_of_deref.references.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/ref_of_deref.references.InstSimplify-after-simplifycfg.diff index 928ee3acaa028..4ea9da46c55d6 100644 --- a/tests/mir-opt/instsimplify/ref_of_deref.references.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/ref_of_deref.references.InstSimplify-after-simplifycfg.diff @@ -33,12 +33,12 @@ bb0: { StorageLive(_3); - _3 = &(*_1); -+ _3 = _1; ++ _3 = copy _1; StorageLive(_4); _4 = &(*_2); StorageLive(_5); - _5 = &mut (*_2); -+ _5 = _2; ++ _5 = copy _2; StorageLive(_6); _6 = &raw const (*_1); StorageLive(_7); diff --git a/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify-after-simplifycfg.diff index 7ef77e76d1297..5fee9a6733dd0 100644 --- a/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify-after-simplifycfg.diff @@ -21,7 +21,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; StorageLive(_3); StorageLive(_5); _3 = discriminant(_2); @@ -36,7 +36,7 @@ StorageLive(_4); - _4 = UbChecks(); + _4 = const false; - assume(_4); + assume(copy _4); _5 = unreachable_unchecked::precondition_check() -> [return: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/issue_101973.inner.GVN.panic-abort.diff b/tests/mir-opt/issue_101973.inner.GVN.panic-abort.diff index 311de9e1c93f3..ac88fe67bb86f 100644 --- a/tests/mir-opt/issue_101973.inner.GVN.panic-abort.diff +++ b/tests/mir-opt/issue_101973.inner.GVN.panic-abort.diff @@ -29,22 +29,22 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; nop; - StorageLive(_14); -- _14 = BitAnd(_5, const 255_u32); +- _14 = BitAnd(copy _5, const 255_u32); - _4 = BitOr(const 0_u32, move _14); - StorageDead(_14); + nop; -+ _14 = BitAnd(_1, const 255_u32); -+ _4 = _14; ++ _14 = BitAnd(copy _1, const 255_u32); ++ _4 = copy _14; + nop; StorageDead(_5); StorageLive(_6); StorageLive(_7); StorageLive(_8); StorageLive(_9); - _9 = _1; + _9 = copy _1; - _10 = const 8_i32 as u32 (IntToInt); - _11 = Lt(move _10, const 32_u32); - assert(move _11, "attempt to shift right by `{}`, which would overflow", const 8_i32) -> [success: bb1, unwind unreachable]; @@ -55,7 +55,7 @@ bb1: { - _8 = Shr(move _9, const 8_i32); -+ _8 = Shr(_1, const 8_i32); ++ _8 = Shr(copy _1, const 8_i32); StorageDead(_9); _7 = BitAnd(move _8, const 15_u32); StorageDead(_8); @@ -71,7 +71,7 @@ _6 = Shl(move _7, const 1_i32); StorageDead(_7); - _3 = rotate_right::(move _4, move _6) -> [return: bb3, unwind unreachable]; -+ _3 = rotate_right::(_14, move _6) -> [return: bb3, unwind unreachable]; ++ _3 = rotate_right::(copy _14, move _6) -> [return: bb3, unwind unreachable]; } bb3: { diff --git a/tests/mir-opt/issue_101973.inner.GVN.panic-unwind.diff b/tests/mir-opt/issue_101973.inner.GVN.panic-unwind.diff index c5fd042161d27..96c3cae2d334a 100644 --- a/tests/mir-opt/issue_101973.inner.GVN.panic-unwind.diff +++ b/tests/mir-opt/issue_101973.inner.GVN.panic-unwind.diff @@ -29,22 +29,22 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; nop; - StorageLive(_14); -- _14 = BitAnd(_5, const 255_u32); +- _14 = BitAnd(copy _5, const 255_u32); - _4 = BitOr(const 0_u32, move _14); - StorageDead(_14); + nop; -+ _14 = BitAnd(_1, const 255_u32); -+ _4 = _14; ++ _14 = BitAnd(copy _1, const 255_u32); ++ _4 = copy _14; + nop; StorageDead(_5); StorageLive(_6); StorageLive(_7); StorageLive(_8); StorageLive(_9); - _9 = _1; + _9 = copy _1; - _10 = const 8_i32 as u32 (IntToInt); - _11 = Lt(move _10, const 32_u32); - assert(move _11, "attempt to shift right by `{}`, which would overflow", const 8_i32) -> [success: bb1, unwind continue]; @@ -55,7 +55,7 @@ bb1: { - _8 = Shr(move _9, const 8_i32); -+ _8 = Shr(_1, const 8_i32); ++ _8 = Shr(copy _1, const 8_i32); StorageDead(_9); _7 = BitAnd(move _8, const 15_u32); StorageDead(_8); @@ -71,7 +71,7 @@ _6 = Shl(move _7, const 1_i32); StorageDead(_7); - _3 = rotate_right::(move _4, move _6) -> [return: bb3, unwind unreachable]; -+ _3 = rotate_right::(_14, move _6) -> [return: bb3, unwind unreachable]; ++ _3 = rotate_right::(copy _14, move _6) -> [return: bb3, unwind unreachable]; } bb3: { diff --git a/tests/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir b/tests/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir index 632b5580656d6..66dbbc0c044b3 100644 --- a/tests/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir @@ -25,7 +25,7 @@ fn main() -> () { bb2: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; switchInt(move _4) -> [0: bb4, otherwise: bb3]; } diff --git a/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-abort.diff b/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-abort.diff index 4469270a9b232..cf9522301281b 100644 --- a/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-abort.diff +++ b/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-abort.diff @@ -63,7 +63,7 @@ + } + + bb8 (cleanup): { -+ switchInt(_5) -> [0: bb6, otherwise: bb7]; ++ switchInt(copy _5) -> [0: bb6, otherwise: bb7]; } } diff --git a/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-unwind.diff b/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-unwind.diff index 4469270a9b232..cf9522301281b 100644 --- a/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-unwind.diff +++ b/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-unwind.diff @@ -63,7 +63,7 @@ + } + + bb8 (cleanup): { -+ switchInt(_5) -> [0: bb6, otherwise: bb7]; ++ switchInt(copy _5) -> [0: bb6, otherwise: bb7]; } } diff --git a/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-abort.diff b/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-abort.diff index 78184f6aeeb1c..15fd95a63fff0 100644 --- a/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-abort.diff +++ b/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-abort.diff @@ -93,7 +93,7 @@ + } + + bb12 (cleanup): { -+ switchInt(_6) -> [0: bb10, otherwise: bb11]; ++ switchInt(copy _6) -> [0: bb10, otherwise: bb11]; } } diff --git a/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-unwind.diff b/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-unwind.diff index 688887c3c1f52..4a0067981cb7a 100644 --- a/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-unwind.diff +++ b/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-unwind.diff @@ -93,7 +93,7 @@ + } + + bb12 (cleanup): { -+ switchInt(_6) -> [0: bb10, otherwise: bb11]; ++ switchInt(copy _6) -> [0: bb10, otherwise: bb11]; } } diff --git a/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-abort.diff b/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-abort.diff index 55d2629a5519c..e2726464ef3ad 100644 --- a/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-abort.diff +++ b/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-abort.diff @@ -115,7 +115,7 @@ + } + + bb15 (cleanup): { -+ switchInt(_7) -> [0: bb12, otherwise: bb14]; ++ switchInt(copy _7) -> [0: bb12, otherwise: bb14]; + } + + bb16: { @@ -132,7 +132,7 @@ + } + + bb19: { -+ switchInt(_7) -> [0: bb13, otherwise: bb18]; ++ switchInt(copy _7) -> [0: bb13, otherwise: bb18]; + } + + bb20 (cleanup): { @@ -141,7 +141,7 @@ + } + + bb21 (cleanup): { -+ switchInt(_7) -> [0: bb12, otherwise: bb20]; ++ switchInt(copy _7) -> [0: bb12, otherwise: bb20]; } } diff --git a/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-unwind.diff b/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-unwind.diff index c731b5646f681..7efa3330e66a7 100644 --- a/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-unwind.diff +++ b/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-unwind.diff @@ -115,7 +115,7 @@ + } + + bb15 (cleanup): { -+ switchInt(_7) -> [0: bb12, otherwise: bb14]; ++ switchInt(copy _7) -> [0: bb12, otherwise: bb14]; + } + + bb16: { @@ -132,7 +132,7 @@ + } + + bb19: { -+ switchInt(_7) -> [0: bb13, otherwise: bb18]; ++ switchInt(copy _7) -> [0: bb13, otherwise: bb18]; + } + + bb20 (cleanup): { @@ -141,7 +141,7 @@ + } + + bb21 (cleanup): { -+ switchInt(_7) -> [0: bb12, otherwise: bb20]; ++ switchInt(copy _7) -> [0: bb12, otherwise: bb20]; } } diff --git a/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-abort.mir b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-abort.mir index 3104baa5fdbd4..736a8bbca49c7 100644 --- a/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-abort.mir +++ b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-abort.mir @@ -54,8 +54,8 @@ fn test() -> Option> { bb4: { StorageLive(_12); - _12 = ((_6 as Continue).0: u32); - (*_5) = _12; + _12 = copy ((_6 as Continue).0: u32); + (*_5) = copy _12; StorageDead(_12); _1 = move _5; drop(_5) -> [return: bb7, unwind: bb11]; @@ -63,9 +63,9 @@ fn test() -> Option> { bb5: { StorageLive(_9); - _9 = ((_6 as Break).0: std::option::Option); + _9 = copy ((_6 as Break).0: std::option::Option); StorageLive(_11); - _11 = _9; + _11 = copy _9; _0 = > as FromResidual>>::from_residual(move _11) -> [return: bb6, unwind: bb12]; } diff --git a/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir index da33c83011516..1acb1ae20b698 100644 --- a/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir +++ b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir @@ -54,8 +54,8 @@ fn test() -> Option> { bb4: { StorageLive(_12); - _12 = ((_6 as Continue).0: u32); - (*_5) = _12; + _12 = copy ((_6 as Continue).0: u32); + (*_5) = copy _12; StorageDead(_12); _1 = move _5; drop(_5) -> [return: bb7, unwind: bb11]; @@ -63,9 +63,9 @@ fn test() -> Option> { bb5: { StorageLive(_9); - _9 = ((_6 as Break).0: std::option::Option); + _9 = copy ((_6 as Break).0: std::option::Option); StorageLive(_11); - _11 = _9; + _11 = copy _9; _0 = > as FromResidual>>::from_residual(move _11) -> [return: bb6, unwind: bb12]; } diff --git a/tests/mir-opt/issue_72181.bar.built.after.mir b/tests/mir-opt/issue_72181.bar.built.after.mir index b6cc7d2219569..569c4a0062829 100644 --- a/tests/mir-opt/issue_72181.bar.built.after.mir +++ b/tests/mir-opt/issue_72181.bar.built.after.mir @@ -9,8 +9,8 @@ fn bar(_1: [(Never, u32); 1]) -> u32 { bb0: { StorageLive(_2); - _2 = (_1[0 of 1].1: u32); - _0 = _2; + _2 = copy (_1[0 of 1].1: u32); + _0 = copy _2; StorageDead(_2); return; } diff --git a/tests/mir-opt/issue_72181.foo.built.after.mir b/tests/mir-opt/issue_72181.foo.built.after.mir index f78942cc56fdc..314cf8b367f57 100644 --- a/tests/mir-opt/issue_72181.foo.built.after.mir +++ b/tests/mir-opt/issue_72181.foo.built.after.mir @@ -11,12 +11,12 @@ fn foo(_1: [(Never, u32); 1]) -> u32 { StorageLive(_2); _2 = const 0_usize; _3 = Len(_1); - _4 = Lt(_2, _3); - assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, _2) -> [success: bb1, unwind: bb2]; + _4 = Lt(copy _2, copy _3); + assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, copy _2) -> [success: bb1, unwind: bb2]; } bb1: { - _0 = (_1[_2].1: u32); + _0 = copy (_1[_2].1: u32); StorageDead(_2); return; } diff --git a/tests/mir-opt/issue_72181.main.built.after.mir b/tests/mir-opt/issue_72181.main.built.after.mir index 89d351d5172ce..aade84a6dd2e8 100644 --- a/tests/mir-opt/issue_72181.main.built.after.mir +++ b/tests/mir-opt/issue_72181.main.built.after.mir @@ -39,8 +39,8 @@ fn main() -> () { StorageLive(_6); _6 = const 0_usize; _7 = Len(_2); - _8 = Lt(_6, _7); - assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb3, unwind: bb5]; + _8 = Lt(copy _6, copy _7); + assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb3, unwind: bb5]; } bb2: { @@ -49,7 +49,7 @@ fn main() -> () { } bb3: { - _5 = (_2[_6].0: u64); + _5 = copy (_2[_6].0: u64); PlaceMention(_5); StorageDead(_6); StorageDead(_5); diff --git a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff index 861ee1d3d3d46..f03691ad67316 100644 --- a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff +++ b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff @@ -24,9 +24,9 @@ bb0: { StorageLive(_4); - _4 = [_1, _1, _1]; + _4 = [copy _1, copy _1, copy _1]; _3 = &_4; - _2 = _3 as &[T] (PointerCoercion(Unsize)); + _2 = copy _3 as &[T] (PointerCoercion(Unsize)); nop; nop; goto -> bb2; diff --git a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff index f27be95338479..633e5c740a1a8 100644 --- a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff +++ b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff @@ -24,9 +24,9 @@ bb0: { StorageLive(_4); - _4 = [_1, _1, _1]; + _4 = [copy _1, copy _1, copy _1]; _3 = &_4; - _2 = _3 as &[T] (PointerCoercion(Unsize)); + _2 = copy _3 as &[T] (PointerCoercion(Unsize)); nop; nop; goto -> bb2; diff --git a/tests/mir-opt/issue_78192.f.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/issue_78192.f.InstSimplify-after-simplifycfg.diff index 53957bb3cb193..aae0570973df3 100644 --- a/tests/mir-opt/issue_78192.f.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/issue_78192.f.InstSimplify-after-simplifycfg.diff @@ -17,9 +17,9 @@ StorageLive(_4); _4 = &raw const (*_1); _3 = &_4; - _2 = _3; + _2 = copy _3; StorageDead(_3); - _0 = (*_2); + _0 = copy (*_2); StorageDead(_4); StorageDead(_2); return; diff --git a/tests/mir-opt/issue_91633.foo.built.after.mir b/tests/mir-opt/issue_91633.foo.built.after.mir index a66769f0d112e..50fdf08375a00 100644 --- a/tests/mir-opt/issue_91633.foo.built.after.mir +++ b/tests/mir-opt/issue_91633.foo.built.after.mir @@ -18,8 +18,8 @@ fn foo(_1: Box<[T]>) -> T { StorageLive(_4); _4 = const 0_usize; _5 = Len((*_1)); - _6 = Lt(_4, _5); - assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind: bb5]; + _6 = Lt(copy _4, copy _5); + assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, copy _4) -> [success: bb1, unwind: bb5]; } bb1: { diff --git a/tests/mir-opt/issue_91633.fun.built.after.mir b/tests/mir-opt/issue_91633.fun.built.after.mir index 7175c9e800662..5b41b376719b2 100644 --- a/tests/mir-opt/issue_91633.fun.built.after.mir +++ b/tests/mir-opt/issue_91633.fun.built.after.mir @@ -16,8 +16,8 @@ fn fun(_1: &[T]) -> &T { StorageLive(_3); _3 = const 0_usize; _4 = Len((*_1)); - _5 = Lt(_3, _4); - assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb2]; + _5 = Lt(copy _3, copy _4); + assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind: bb2]; } bb1: { diff --git a/tests/mir-opt/issue_99325.main.built.after.32bit.mir b/tests/mir-opt/issue_99325.main.built.after.32bit.mir index 72e7f4794f980..161c73529f53c 100644 --- a/tests/mir-opt/issue_99325.main.built.after.32bit.mir +++ b/tests/mir-opt/issue_99325.main.built.after.32bit.mir @@ -83,9 +83,9 @@ fn main() -> () { StorageDead(_3); PlaceMention(_2); StorageLive(_8); - _8 = (_2.0: &&[u8]); + _8 = copy (_2.0: &&[u8]); StorageLive(_9); - _9 = (_2.1: &&[u8; 4]); + _9 = copy (_2.1: &&[u8; 4]); StorageLive(_10); StorageLive(_11); _11 = &(*_8); @@ -187,9 +187,9 @@ fn main() -> () { StorageDead(_24); PlaceMention(_23); StorageLive(_28); - _28 = (_23.0: &&[u8]); + _28 = copy (_23.0: &&[u8]); StorageLive(_29); - _29 = (_23.1: &&[u8; 4]); + _29 = copy (_23.1: &&[u8; 4]); StorageLive(_30); StorageLive(_31); _31 = &(*_28); diff --git a/tests/mir-opt/issue_99325.main.built.after.64bit.mir b/tests/mir-opt/issue_99325.main.built.after.64bit.mir index 72e7f4794f980..161c73529f53c 100644 --- a/tests/mir-opt/issue_99325.main.built.after.64bit.mir +++ b/tests/mir-opt/issue_99325.main.built.after.64bit.mir @@ -83,9 +83,9 @@ fn main() -> () { StorageDead(_3); PlaceMention(_2); StorageLive(_8); - _8 = (_2.0: &&[u8]); + _8 = copy (_2.0: &&[u8]); StorageLive(_9); - _9 = (_2.1: &&[u8; 4]); + _9 = copy (_2.1: &&[u8; 4]); StorageLive(_10); StorageLive(_11); _11 = &(*_8); @@ -187,9 +187,9 @@ fn main() -> () { StorageDead(_24); PlaceMention(_23); StorageLive(_28); - _28 = (_23.0: &&[u8]); + _28 = copy (_23.0: &&[u8]); StorageLive(_29); - _29 = (_23.1: &&[u8; 4]); + _29 = copy (_23.1: &&[u8; 4]); StorageLive(_30); StorageLive(_31); _31 = &(*_28); diff --git a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir index 8da56d59aaa60..573c0a12bc1a7 100644 --- a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir @@ -19,7 +19,7 @@ fn num_to_digit(_1: char) -> u32 { bb0: { StorageLive(_2); - _2 = char::methods::::to_digit(_1, const 8_u32) -> [return: bb1, unwind unreachable]; + _2 = char::methods::::to_digit(copy _1, const 8_u32) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir index 61bc09d901cbf..049803041d4e3 100644 --- a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir @@ -19,7 +19,7 @@ fn num_to_digit(_1: char) -> u32 { bb0: { StorageLive(_2); - _2 = char::methods::::to_digit(_1, const 8_u32) -> [return: bb1, unwind continue]; + _2 = char::methods::::to_digit(copy _1, const 8_u32) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff b/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff index 25ed1b4d0c764..1ab9be9665221 100644 --- a/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff +++ b/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff @@ -19,26 +19,26 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = move _3 as [u32; 4] (Transmute); StorageDead(_3); - switchInt(_2[0 of 4]) -> [0: bb1, otherwise: bb4]; + switchInt(copy _2[0 of 4]) -> [0: bb1, otherwise: bb4]; } bb1: { - switchInt(_2[1 of 4]) -> [0: bb2, otherwise: bb4]; + switchInt(copy _2[1 of 4]) -> [0: bb2, otherwise: bb4]; } bb2: { - switchInt(_2[2 of 4]) -> [0: bb3, 4294901760: bb3, otherwise: bb4]; + switchInt(copy _2[2 of 4]) -> [0: bb3, 4294901760: bb3, otherwise: bb4]; } bb3: { StorageLive(_4); - _4 = _2[3 of 4]; + _4 = copy _2[3 of 4]; StorageLive(_5); StorageLive(_6); - _6 = _4; + _6 = copy _4; _5 = move _6 as [u8; 4] (Transmute); StorageDead(_6); _0 = Option::<[u8; 4]>::Some(move _5); diff --git a/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-abort.diff index e955e66901437..a7551c3fb5b79 100644 --- a/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-abort.diff @@ -18,13 +18,13 @@ StorageLive(_4); _4 = const aggregate::FOO; StorageLive(_2); - _2 = (_4.0: u8); + _2 = copy (_4.0: u8); StorageLive(_3); - _3 = (_4.1: u8); + _3 = copy (_4.1: u8); StorageDead(_4); StorageLive(_5); StorageLive(_6); - _6 = _2; + _6 = copy _2; _5 = Eq(move _6, const 7_u8); - switchInt(move _5) -> [0: bb2, otherwise: bb1]; + goto -> bb2; @@ -32,13 +32,13 @@ bb1: { StorageDead(_6); - _0 = _3; + _0 = copy _3; goto -> bb3; } bb2: { StorageDead(_6); - _0 = _2; + _0 = copy _2; goto -> bb3; } diff --git a/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-unwind.diff index e955e66901437..a7551c3fb5b79 100644 --- a/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-unwind.diff @@ -18,13 +18,13 @@ StorageLive(_4); _4 = const aggregate::FOO; StorageLive(_2); - _2 = (_4.0: u8); + _2 = copy (_4.0: u8); StorageLive(_3); - _3 = (_4.1: u8); + _3 = copy (_4.1: u8); StorageDead(_4); StorageLive(_5); StorageLive(_6); - _6 = _2; + _6 = copy _2; _5 = Eq(move _6, const 7_u8); - switchInt(move _5) -> [0: bb2, otherwise: bb1]; + goto -> bb2; @@ -32,13 +32,13 @@ bb1: { StorageDead(_6); - _0 = _3; + _0 = copy _3; goto -> bb3; } bb2: { StorageDead(_6); - _0 = _2; + _0 = copy _2; goto -> bb3; } diff --git a/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-abort.diff index 0c8e04a1e74dc..4d639d89f0d12 100644 --- a/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-abort.diff @@ -22,12 +22,12 @@ StorageLive(_1); _1 = const aggregate_copy::Foo; StorageLive(_2); - _2 = _1; + _2 = copy _1; StorageLive(_3); - _3 = (_2.1: u32); + _3 = copy (_2.1: u32); StorageLive(_4); StorageLive(_5); - _5 = _3; + _5 = copy _3; _4 = Eq(move _5, const 2_u32); - switchInt(move _4) -> [0: bb2, otherwise: bb1]; + goto -> bb2; @@ -35,7 +35,7 @@ bb1: { StorageDead(_5); - _0 = (_2.0: u32); + _0 = copy (_2.0: u32); goto -> bb3; } diff --git a/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-unwind.diff index 0c8e04a1e74dc..4d639d89f0d12 100644 --- a/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-unwind.diff @@ -22,12 +22,12 @@ StorageLive(_1); _1 = const aggregate_copy::Foo; StorageLive(_2); - _2 = _1; + _2 = copy _1; StorageLive(_3); - _3 = (_2.1: u32); + _3 = copy (_2.1: u32); StorageLive(_4); StorageLive(_5); - _5 = _3; + _5 = copy _3; _4 = Eq(move _5, const 2_u32); - switchInt(move _4) -> [0: bb2, otherwise: bb1]; + goto -> bb2; @@ -35,7 +35,7 @@ bb1: { StorageDead(_5); - _0 = (_2.0: u32); + _0 = copy (_2.0: u32); goto -> bb3; } diff --git a/tests/mir-opt/jump_threading.assume.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.assume.JumpThreading.panic-abort.diff index f1f0106fdbce9..519cb0f0ab1df 100644 --- a/tests/mir-opt/jump_threading.assume.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.assume.JumpThreading.panic-abort.diff @@ -5,11 +5,11 @@ let mut _0: u8; bb0: { - switchInt(_1) -> [7: bb1, otherwise: bb2]; + switchInt(copy _1) -> [7: bb1, otherwise: bb2]; } bb1: { - assume(_2); + assume(copy _2); - goto -> bb3; + goto -> bb6; } @@ -19,7 +19,7 @@ } bb3: { - switchInt(_2) -> [0: bb4, otherwise: bb5]; + switchInt(copy _2) -> [0: bb4, otherwise: bb5]; } bb4: { diff --git a/tests/mir-opt/jump_threading.assume.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.assume.JumpThreading.panic-unwind.diff index f1f0106fdbce9..519cb0f0ab1df 100644 --- a/tests/mir-opt/jump_threading.assume.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.assume.JumpThreading.panic-unwind.diff @@ -5,11 +5,11 @@ let mut _0: u8; bb0: { - switchInt(_1) -> [7: bb1, otherwise: bb2]; + switchInt(copy _1) -> [7: bb1, otherwise: bb2]; } bb1: { - assume(_2); + assume(copy _2); - goto -> bb3; + goto -> bb6; } @@ -19,7 +19,7 @@ } bb3: { - switchInt(_2) -> [0: bb4, otherwise: bb5]; + switchInt(copy _2) -> [0: bb4, otherwise: bb5]; } bb4: { diff --git a/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-abort.diff index 462cc20778580..a86371794ebe9 100644 --- a/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-abort.diff @@ -11,7 +11,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; switchInt(move _3) -> [0: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-unwind.diff index 462cc20778580..a86371794ebe9 100644 --- a/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-unwind.diff @@ -11,7 +11,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; switchInt(move _3) -> [0: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-abort.diff index f290da84e5d88..d17f2752f58ec 100644 --- a/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-abort.diff @@ -9,7 +9,7 @@ bb0: { _2 = const true; _3 = const true; - switchInt(_1) -> [0: bb3, 1: bb3, 2: bb1, otherwise: bb2]; + switchInt(copy _1) -> [0: bb3, 1: bb3, 2: bb1, otherwise: bb2]; } bb1: { @@ -28,11 +28,11 @@ } bb4: { - switchInt(_3) -> [0: bb5, otherwise: bb7]; + switchInt(copy _3) -> [0: bb5, otherwise: bb7]; } bb5: { - switchInt(_2) -> [0: bb6, otherwise: bb8]; + switchInt(copy _2) -> [0: bb6, otherwise: bb8]; } bb6: { diff --git a/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-unwind.diff index f290da84e5d88..d17f2752f58ec 100644 --- a/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-unwind.diff @@ -9,7 +9,7 @@ bb0: { _2 = const true; _3 = const true; - switchInt(_1) -> [0: bb3, 1: bb3, 2: bb1, otherwise: bb2]; + switchInt(copy _1) -> [0: bb3, 1: bb3, 2: bb1, otherwise: bb2]; } bb1: { @@ -28,11 +28,11 @@ } bb4: { - switchInt(_3) -> [0: bb5, otherwise: bb7]; + switchInt(copy _3) -> [0: bb5, otherwise: bb7]; } bb5: { - switchInt(_2) -> [0: bb6, otherwise: bb8]; + switchInt(copy _2) -> [0: bb6, otherwise: bb8]; } bb6: { diff --git a/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-abort.diff index adcedfb366700..083a6e7487a05 100644 --- a/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-abort.diff @@ -8,7 +8,7 @@ let mut _4: i32; bb0: { - switchInt(_1) -> [1: bb1, otherwise: bb2]; + switchInt(copy _1) -> [1: bb1, otherwise: bb2]; } bb1: { @@ -28,7 +28,7 @@ bb4: { _4 = const 15_i32; -- switchInt(_2) -> [5: bb5, otherwise: bb6]; +- switchInt(copy _2) -> [5: bb5, otherwise: bb6]; + goto -> bb5; } diff --git a/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-unwind.diff index adcedfb366700..083a6e7487a05 100644 --- a/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-unwind.diff @@ -8,7 +8,7 @@ let mut _4: i32; bb0: { - switchInt(_1) -> [1: bb1, otherwise: bb2]; + switchInt(copy _1) -> [1: bb1, otherwise: bb2]; } bb1: { @@ -28,7 +28,7 @@ bb4: { _4 = const 15_i32; -- switchInt(_2) -> [5: bb5, otherwise: bb6]; +- switchInt(copy _2) -> [5: bb5, otherwise: bb6]; + goto -> bb5; } diff --git a/tests/mir-opt/jump_threading.floats.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.floats.JumpThreading.panic-abort.diff index 6ca37e96d297b..1192f7c23e15d 100644 --- a/tests/mir-opt/jump_threading.floats.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.floats.JumpThreading.panic-abort.diff @@ -33,7 +33,7 @@ StorageDead(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; _3 = Eq(move _4, const 0f64); switchInt(move _3) -> [0: bb5, otherwise: bb4]; } diff --git a/tests/mir-opt/jump_threading.floats.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.floats.JumpThreading.panic-unwind.diff index 6ca37e96d297b..1192f7c23e15d 100644 --- a/tests/mir-opt/jump_threading.floats.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.floats.JumpThreading.panic-unwind.diff @@ -33,7 +33,7 @@ StorageDead(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; _3 = Eq(move _4, const 0f64); switchInt(move _3) -> [0: bb5, otherwise: bb4]; } diff --git a/tests/mir-opt/jump_threading.identity.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.identity.JumpThreading.panic-abort.diff index 65379ae8b890e..79599f856115d 100644 --- a/tests/mir-opt/jump_threading.identity.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.identity.JumpThreading.panic-abort.diff @@ -45,7 +45,7 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_10); StorageLive(_11); StorageLive(_12); @@ -59,8 +59,8 @@ bb2: { StorageLive(_9); - _9 = ((_3 as Continue).0: i32); - _2 = _9; + _9 = copy ((_3 as Continue).0: i32); + _2 = copy _9; StorageDead(_9); _0 = Result::::Ok(move _2); StorageDead(_2); @@ -70,9 +70,9 @@ bb3: { StorageLive(_6); - _6 = ((_3 as Break).0: std::result::Result); + _6 = copy ((_3 as Break).0: std::result::Result); StorageLive(_8); - _8 = _6; + _8 = copy _6; StorageLive(_14); _14 = move ((_8 as Err).0: i32); StorageLive(_15); @@ -104,7 +104,7 @@ bb6: { _12 = move ((_4 as Err).0: i32); StorageLive(_13); - _13 = Result::::Err(_12); + _13 = Result::::Err(copy _12); _3 = ControlFlow::, i32>::Break(move _13); StorageDead(_13); - goto -> bb5; @@ -113,7 +113,7 @@ bb7: { _11 = move ((_4 as Ok).0: i32); - _3 = ControlFlow::, i32>::Continue(_11); + _3 = ControlFlow::, i32>::Continue(copy _11); goto -> bb5; + } + diff --git a/tests/mir-opt/jump_threading.identity.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.identity.JumpThreading.panic-unwind.diff index 65379ae8b890e..79599f856115d 100644 --- a/tests/mir-opt/jump_threading.identity.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.identity.JumpThreading.panic-unwind.diff @@ -45,7 +45,7 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_10); StorageLive(_11); StorageLive(_12); @@ -59,8 +59,8 @@ bb2: { StorageLive(_9); - _9 = ((_3 as Continue).0: i32); - _2 = _9; + _9 = copy ((_3 as Continue).0: i32); + _2 = copy _9; StorageDead(_9); _0 = Result::::Ok(move _2); StorageDead(_2); @@ -70,9 +70,9 @@ bb3: { StorageLive(_6); - _6 = ((_3 as Break).0: std::result::Result); + _6 = copy ((_3 as Break).0: std::result::Result); StorageLive(_8); - _8 = _6; + _8 = copy _6; StorageLive(_14); _14 = move ((_8 as Err).0: i32); StorageLive(_15); @@ -104,7 +104,7 @@ bb6: { _12 = move ((_4 as Err).0: i32); StorageLive(_13); - _13 = Result::::Err(_12); + _13 = Result::::Err(copy _12); _3 = ControlFlow::, i32>::Break(move _13); StorageDead(_13); - goto -> bb5; @@ -113,7 +113,7 @@ bb7: { _11 = move ((_4 as Ok).0: i32); - _3 = ControlFlow::, i32>::Continue(_11); + _3 = ControlFlow::, i32>::Continue(copy _11); goto -> bb5; + } + diff --git a/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-abort.diff index 2ca03e439a0be..09c0ad6d48560 100644 --- a/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-abort.diff @@ -7,18 +7,18 @@ let mut _3: u8; bb0: { - switchInt(_1) -> [3: bb1, otherwise: bb2]; + switchInt(copy _1) -> [3: bb1, otherwise: bb2]; } bb1: { - _2 = _1; -- switchInt(_2) -> [3: bb3, otherwise: bb4]; + _2 = copy _1; +- switchInt(copy _2) -> [3: bb3, otherwise: bb4]; + goto -> bb3; } bb2: { - _3 = _1; -- switchInt(_3) -> [3: bb5, otherwise: bb6]; + _3 = copy _1; +- switchInt(copy _3) -> [3: bb5, otherwise: bb6]; + goto -> bb6; } @@ -38,7 +38,7 @@ } bb6: { - switchInt(_3) -> [1: bb7, otherwise: bb8]; + switchInt(copy _3) -> [1: bb7, otherwise: bb8]; } bb7: { diff --git a/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-unwind.diff index 2ca03e439a0be..09c0ad6d48560 100644 --- a/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-unwind.diff @@ -7,18 +7,18 @@ let mut _3: u8; bb0: { - switchInt(_1) -> [3: bb1, otherwise: bb2]; + switchInt(copy _1) -> [3: bb1, otherwise: bb2]; } bb1: { - _2 = _1; -- switchInt(_2) -> [3: bb3, otherwise: bb4]; + _2 = copy _1; +- switchInt(copy _2) -> [3: bb3, otherwise: bb4]; + goto -> bb3; } bb2: { - _3 = _1; -- switchInt(_3) -> [3: bb5, otherwise: bb6]; + _3 = copy _1; +- switchInt(copy _3) -> [3: bb5, otherwise: bb6]; + goto -> bb6; } @@ -38,7 +38,7 @@ } bb6: { - switchInt(_3) -> [1: bb7, otherwise: bb8]; + switchInt(copy _3) -> [1: bb7, otherwise: bb8]; } bb7: { diff --git a/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-abort.diff index e9d4352014f71..bb47f57b542a5 100644 --- a/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-abort.diff @@ -27,7 +27,7 @@ StorageDead(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; _4 = Eq(move _5, const 7_i32); switchInt(move _4) -> [0: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-unwind.diff index e9d4352014f71..bb47f57b542a5 100644 --- a/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-unwind.diff @@ -27,7 +27,7 @@ StorageDead(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; _4 = Eq(move _5, const 7_i32); switchInt(move _4) -> [0: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-abort.diff index 8821b47c34576..7014146cb8624 100644 --- a/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-abort.diff @@ -10,7 +10,7 @@ discriminant(_1) = 1; (((_1 as variant#1).0: NonZeroUsize).0: usize) = const 0_usize; _2 = discriminant(_1); - switchInt(_2) -> [0: bb1, otherwise: bb2]; + switchInt(copy _2) -> [0: bb1, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-unwind.diff index 8821b47c34576..7014146cb8624 100644 --- a/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-unwind.diff @@ -10,7 +10,7 @@ discriminant(_1) = 1; (((_1 as variant#1).0: NonZeroUsize).0: usize) = const 0_usize; _2 = discriminant(_1); - switchInt(_2) -> [0: bb1, otherwise: bb2]; + switchInt(copy _2) -> [0: bb1, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-abort.diff index 2d943a4bee219..9a8bdc8f4d952 100644 --- a/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-abort.diff @@ -8,7 +8,7 @@ bb0: { _3 = const false; - switchInt(_1) -> [1: bb1, otherwise: bb2]; + switchInt(copy _1) -> [1: bb1, otherwise: bb2]; } bb1: { @@ -18,17 +18,17 @@ } bb2: { - _2 = _1; - _3 = _1; + _2 = copy _1; + _3 = copy _1; goto -> bb3; } bb3: { - switchInt(_2) -> [0: bb4, otherwise: bb5]; + switchInt(copy _2) -> [0: bb4, otherwise: bb5]; } bb4: { - switchInt(_3) -> [0: bb6, otherwise: bb7]; + switchInt(copy _3) -> [0: bb6, otherwise: bb7]; } bb5: { diff --git a/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-unwind.diff index 2d943a4bee219..9a8bdc8f4d952 100644 --- a/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-unwind.diff @@ -8,7 +8,7 @@ bb0: { _3 = const false; - switchInt(_1) -> [1: bb1, otherwise: bb2]; + switchInt(copy _1) -> [1: bb1, otherwise: bb2]; } bb1: { @@ -18,17 +18,17 @@ } bb2: { - _2 = _1; - _3 = _1; + _2 = copy _1; + _3 = copy _1; goto -> bb3; } bb3: { - switchInt(_2) -> [0: bb4, otherwise: bb5]; + switchInt(copy _2) -> [0: bb4, otherwise: bb5]; } bb4: { - switchInt(_3) -> [0: bb6, otherwise: bb7]; + switchInt(copy _3) -> [0: bb6, otherwise: bb7]; } bb5: { diff --git a/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-abort.diff index 365d9d6b32bde..7de359298922b 100644 --- a/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-abort.diff @@ -39,9 +39,9 @@ bb2: { StorageLive(_6); - _6 = ((_1 as Err).0: usize); + _6 = copy ((_1 as Err).0: usize); StorageLive(_7); - _7 = _6; + _7 = copy _6; _2 = ControlFlow::::Break(move _7); StorageDead(_7); StorageDead(_6); @@ -51,9 +51,9 @@ bb3: { StorageLive(_4); - _4 = ((_1 as Ok).0: i32); + _4 = copy ((_1 as Ok).0: i32); StorageLive(_5); - _5 = _4; + _5 = copy _4; _2 = ControlFlow::::Continue(move _5); StorageDead(_5); StorageDead(_4); @@ -68,7 +68,7 @@ bb5: { StorageLive(_11); - _11 = ((_2 as Break).0: usize); + _11 = copy ((_2 as Break).0: usize); _0 = Option::::None; StorageDead(_11); goto -> bb7; @@ -76,9 +76,9 @@ bb6: { StorageLive(_9); - _9 = ((_2 as Continue).0: i32); + _9 = copy ((_2 as Continue).0: i32); StorageLive(_10); - _10 = _9; + _10 = copy _9; _0 = Option::::Some(move _10); StorageDead(_10); StorageDead(_9); diff --git a/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-unwind.diff index 365d9d6b32bde..7de359298922b 100644 --- a/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-unwind.diff @@ -39,9 +39,9 @@ bb2: { StorageLive(_6); - _6 = ((_1 as Err).0: usize); + _6 = copy ((_1 as Err).0: usize); StorageLive(_7); - _7 = _6; + _7 = copy _6; _2 = ControlFlow::::Break(move _7); StorageDead(_7); StorageDead(_6); @@ -51,9 +51,9 @@ bb3: { StorageLive(_4); - _4 = ((_1 as Ok).0: i32); + _4 = copy ((_1 as Ok).0: i32); StorageLive(_5); - _5 = _4; + _5 = copy _4; _2 = ControlFlow::::Continue(move _5); StorageDead(_5); StorageDead(_4); @@ -68,7 +68,7 @@ bb5: { StorageLive(_11); - _11 = ((_2 as Break).0: usize); + _11 = copy ((_2 as Break).0: usize); _0 = Option::::None; StorageDead(_11); goto -> bb7; @@ -76,9 +76,9 @@ bb6: { StorageLive(_9); - _9 = ((_2 as Continue).0: i32); + _9 = copy ((_2 as Continue).0: i32); StorageLive(_10); - _10 = _9; + _10 = copy _9; _0 = Option::::Some(move _10); StorageDead(_10); StorageDead(_9); diff --git a/tests/mir-opt/lower_array_len.array_bound.GVN.panic-abort.diff b/tests/mir-opt/lower_array_len.array_bound.GVN.panic-abort.diff index 7aca2cb000701..8223cbbb41216 100644 --- a/tests/mir-opt/lower_array_len.array_bound.GVN.panic-abort.diff +++ b/tests/mir-opt/lower_array_len.array_bound.GVN.panic-abort.diff @@ -18,7 +18,7 @@ - StorageLive(_3); + nop; StorageLive(_4); - _4 = _1; + _4 = copy _1; - StorageLive(_5); + nop; StorageLive(_6); @@ -35,8 +35,8 @@ StorageDead(_6); - _3 = Lt(move _4, move _5); - switchInt(move _3) -> [0: bb4, otherwise: bb2]; -+ _3 = Lt(_1, const N); -+ switchInt(_3) -> [0: bb4, otherwise: bb2]; ++ _3 = Lt(copy _1, const N); ++ switchInt(copy _3) -> [0: bb4, otherwise: bb2]; } bb2: { @@ -44,18 +44,18 @@ + nop; StorageDead(_4); StorageLive(_8); - _8 = _1; + _8 = copy _1; - _9 = Len((*_2)); -- _10 = Lt(_8, _9); -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb3, unwind unreachable]; +- _10 = Lt(copy _8, copy _9); +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, copy _8) -> [success: bb3, unwind unreachable]; + _9 = const N; -+ _10 = _3; -+ assert(_3, "index out of bounds: the length is {} but the index is {}", const N, _1) -> [success: bb3, unwind unreachable]; ++ _10 = copy _3; ++ assert(copy _3, "index out of bounds: the length is {} but the index is {}", const N, copy _1) -> [success: bb3, unwind unreachable]; } bb3: { -- _0 = (*_2)[_8]; -+ _0 = (*_2)[_1]; +- _0 = copy (*_2)[_8]; ++ _0 = copy (*_2)[_1]; StorageDead(_8); goto -> bb5; } diff --git a/tests/mir-opt/lower_array_len.array_bound.GVN.panic-unwind.diff b/tests/mir-opt/lower_array_len.array_bound.GVN.panic-unwind.diff index ed39c11319af4..d8f33accbc005 100644 --- a/tests/mir-opt/lower_array_len.array_bound.GVN.panic-unwind.diff +++ b/tests/mir-opt/lower_array_len.array_bound.GVN.panic-unwind.diff @@ -18,7 +18,7 @@ - StorageLive(_3); + nop; StorageLive(_4); - _4 = _1; + _4 = copy _1; - StorageLive(_5); + nop; StorageLive(_6); @@ -35,8 +35,8 @@ StorageDead(_6); - _3 = Lt(move _4, move _5); - switchInt(move _3) -> [0: bb4, otherwise: bb2]; -+ _3 = Lt(_1, const N); -+ switchInt(_3) -> [0: bb4, otherwise: bb2]; ++ _3 = Lt(copy _1, const N); ++ switchInt(copy _3) -> [0: bb4, otherwise: bb2]; } bb2: { @@ -44,18 +44,18 @@ + nop; StorageDead(_4); StorageLive(_8); - _8 = _1; + _8 = copy _1; - _9 = Len((*_2)); -- _10 = Lt(_8, _9); -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb3, unwind continue]; +- _10 = Lt(copy _8, copy _9); +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, copy _8) -> [success: bb3, unwind continue]; + _9 = const N; -+ _10 = _3; -+ assert(_3, "index out of bounds: the length is {} but the index is {}", const N, _1) -> [success: bb3, unwind continue]; ++ _10 = copy _3; ++ assert(copy _3, "index out of bounds: the length is {} but the index is {}", const N, copy _1) -> [success: bb3, unwind continue]; } bb3: { -- _0 = (*_2)[_8]; -+ _0 = (*_2)[_1]; +- _0 = copy (*_2)[_8]; ++ _0 = copy (*_2)[_1]; StorageDead(_8); goto -> bb5; } diff --git a/tests/mir-opt/lower_array_len.array_bound_mut.GVN.panic-abort.diff b/tests/mir-opt/lower_array_len.array_bound_mut.GVN.panic-abort.diff index 734d28e9546c1..1cb9963c00e94 100644 --- a/tests/mir-opt/lower_array_len.array_bound_mut.GVN.panic-abort.diff +++ b/tests/mir-opt/lower_array_len.array_bound_mut.GVN.panic-abort.diff @@ -21,7 +21,7 @@ - StorageLive(_3); + nop; StorageLive(_4); - _4 = _1; + _4 = copy _1; - StorageLive(_5); + nop; StorageLive(_6); @@ -38,8 +38,8 @@ StorageDead(_6); - _3 = Lt(move _4, move _5); - switchInt(move _3) -> [0: bb4, otherwise: bb2]; -+ _3 = Lt(_1, const N); -+ switchInt(_3) -> [0: bb4, otherwise: bb2]; ++ _3 = Lt(copy _1, const N); ++ switchInt(copy _3) -> [0: bb4, otherwise: bb2]; } bb2: { @@ -47,18 +47,18 @@ + nop; StorageDead(_4); StorageLive(_8); - _8 = _1; + _8 = copy _1; - _9 = Len((*_2)); -- _10 = Lt(_8, _9); -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb3, unwind unreachable]; +- _10 = Lt(copy _8, copy _9); +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, copy _8) -> [success: bb3, unwind unreachable]; + _9 = const N; -+ _10 = _3; -+ assert(_3, "index out of bounds: the length is {} but the index is {}", const N, _1) -> [success: bb3, unwind unreachable]; ++ _10 = copy _3; ++ assert(copy _3, "index out of bounds: the length is {} but the index is {}", const N, copy _1) -> [success: bb3, unwind unreachable]; } bb3: { -- _0 = (*_2)[_8]; -+ _0 = (*_2)[_1]; +- _0 = copy (*_2)[_8]; ++ _0 = copy (*_2)[_1]; StorageDead(_8); goto -> bb6; } @@ -70,8 +70,8 @@ StorageLive(_11); _11 = const 0_usize; - _12 = Len((*_2)); -- _13 = Lt(_11, _12); -- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> [success: bb5, unwind unreachable]; +- _13 = Lt(copy _11, copy _12); +- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb5, unwind unreachable]; + _12 = const N; + _13 = Lt(const 0_usize, const N); + assert(move _13, "index out of bounds: the length is {} but the index is {}", const N, const 0_usize) -> [success: bb5, unwind unreachable]; diff --git a/tests/mir-opt/lower_array_len.array_bound_mut.GVN.panic-unwind.diff b/tests/mir-opt/lower_array_len.array_bound_mut.GVN.panic-unwind.diff index ec569ab504233..fa4e11ed20192 100644 --- a/tests/mir-opt/lower_array_len.array_bound_mut.GVN.panic-unwind.diff +++ b/tests/mir-opt/lower_array_len.array_bound_mut.GVN.panic-unwind.diff @@ -21,7 +21,7 @@ - StorageLive(_3); + nop; StorageLive(_4); - _4 = _1; + _4 = copy _1; - StorageLive(_5); + nop; StorageLive(_6); @@ -38,8 +38,8 @@ StorageDead(_6); - _3 = Lt(move _4, move _5); - switchInt(move _3) -> [0: bb4, otherwise: bb2]; -+ _3 = Lt(_1, const N); -+ switchInt(_3) -> [0: bb4, otherwise: bb2]; ++ _3 = Lt(copy _1, const N); ++ switchInt(copy _3) -> [0: bb4, otherwise: bb2]; } bb2: { @@ -47,18 +47,18 @@ + nop; StorageDead(_4); StorageLive(_8); - _8 = _1; + _8 = copy _1; - _9 = Len((*_2)); -- _10 = Lt(_8, _9); -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb3, unwind continue]; +- _10 = Lt(copy _8, copy _9); +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, copy _8) -> [success: bb3, unwind continue]; + _9 = const N; -+ _10 = _3; -+ assert(_3, "index out of bounds: the length is {} but the index is {}", const N, _1) -> [success: bb3, unwind continue]; ++ _10 = copy _3; ++ assert(copy _3, "index out of bounds: the length is {} but the index is {}", const N, copy _1) -> [success: bb3, unwind continue]; } bb3: { -- _0 = (*_2)[_8]; -+ _0 = (*_2)[_1]; +- _0 = copy (*_2)[_8]; ++ _0 = copy (*_2)[_1]; StorageDead(_8); goto -> bb6; } @@ -70,8 +70,8 @@ StorageLive(_11); _11 = const 0_usize; - _12 = Len((*_2)); -- _13 = Lt(_11, _12); -- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> [success: bb5, unwind continue]; +- _13 = Lt(copy _11, copy _12); +- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb5, unwind continue]; + _12 = const N; + _13 = Lt(const 0_usize, const N); + assert(move _13, "index out of bounds: the length is {} but the index is {}", const N, const 0_usize) -> [success: bb5, unwind continue]; diff --git a/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-abort.diff index 96b66af66a2d2..7f325245bce63 100644 --- a/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-abort.diff @@ -33,7 +33,7 @@ StorageLive(_7); _7 = &_1; _6 = &raw const (*_7); - _5 = _6; + _5 = copy _6; _4 = move _5 as *const i32 (PtrToPtr); StorageDead(_5); StorageLive(_8); @@ -42,7 +42,7 @@ StorageLive(_11); _11 = &mut _2; _10 = &raw mut (*_11); - _9 = _10; + _9 = copy _10; _8 = move _9 as *mut i32 (PtrToPtr); StorageDead(_9); - _3 = copy_nonoverlapping::(move _4, move _8, const 0_usize) -> [return: bb1, unwind unreachable]; diff --git a/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-unwind.diff index 96b66af66a2d2..7f325245bce63 100644 --- a/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-unwind.diff @@ -33,7 +33,7 @@ StorageLive(_7); _7 = &_1; _6 = &raw const (*_7); - _5 = _6; + _5 = copy _6; _4 = move _5 as *const i32 (PtrToPtr); StorageDead(_5); StorageLive(_8); @@ -42,7 +42,7 @@ StorageLive(_11); _11 = &mut _2; _10 = &raw mut (*_11); - _9 = _10; + _9 = copy _10; _8 = move _9 as *mut i32 (PtrToPtr); StorageDead(_9); - _3 = copy_nonoverlapping::(move _4, move _8, const 0_usize) -> [return: bb1, unwind unreachable]; diff --git a/tests/mir-opt/lower_intrinsics.get_metadata.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.get_metadata.LowerIntrinsics.panic-abort.diff index d256058c05ee6..f2cfce1b6e3f8 100644 --- a/tests/mir-opt/lower_intrinsics.get_metadata.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.get_metadata.LowerIntrinsics.panic-abort.diff @@ -25,7 +25,7 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = ptr_metadata::(move _5) -> [return: bb1, unwind unreachable]; + _4 = PtrMetadata(move _5); + goto -> bb1; @@ -35,7 +35,7 @@ StorageDead(_5); StorageLive(_6); StorageLive(_7); - _7 = _2; + _7 = copy _2; - _6 = ptr_metadata::<[u8], usize>(move _7) -> [return: bb2, unwind unreachable]; + _6 = PtrMetadata(move _7); + goto -> bb2; @@ -45,7 +45,7 @@ StorageDead(_7); StorageLive(_8); StorageLive(_9); - _9 = _3; + _9 = copy _3; - _8 = ptr_metadata::>(move _9) -> [return: bb3, unwind unreachable]; + _8 = PtrMetadata(move _9); + goto -> bb3; diff --git a/tests/mir-opt/lower_intrinsics.get_metadata.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.get_metadata.LowerIntrinsics.panic-unwind.diff index d256058c05ee6..f2cfce1b6e3f8 100644 --- a/tests/mir-opt/lower_intrinsics.get_metadata.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.get_metadata.LowerIntrinsics.panic-unwind.diff @@ -25,7 +25,7 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = ptr_metadata::(move _5) -> [return: bb1, unwind unreachable]; + _4 = PtrMetadata(move _5); + goto -> bb1; @@ -35,7 +35,7 @@ StorageDead(_5); StorageLive(_6); StorageLive(_7); - _7 = _2; + _7 = copy _2; - _6 = ptr_metadata::<[u8], usize>(move _7) -> [return: bb2, unwind unreachable]; + _6 = PtrMetadata(move _7); + goto -> bb2; @@ -45,7 +45,7 @@ StorageDead(_7); StorageLive(_8); StorageLive(_9); - _9 = _3; + _9 = copy _3; - _8 = ptr_metadata::>(move _9) -> [return: bb3, unwind unreachable]; + _8 = PtrMetadata(move _9); + goto -> bb3; diff --git a/tests/mir-opt/lower_intrinsics.make_pointers.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.make_pointers.LowerIntrinsics.panic-abort.diff index 02934d4c01e6f..b282509c06861 100644 --- a/tests/mir-opt/lower_intrinsics.make_pointers.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.make_pointers.LowerIntrinsics.panic-abort.diff @@ -34,7 +34,7 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; StorageLive(_6); _6 = (); - _4 = aggregate_raw_ptr::<*const i32, *const u8, ()>(move _5, move _6) -> [return: bb1, unwind unreachable]; @@ -47,7 +47,7 @@ StorageDead(_5); StorageLive(_7); StorageLive(_8); - _8 = _2; + _8 = copy _2; StorageLive(_9); _9 = (); - _7 = aggregate_raw_ptr::<*mut u8, *mut (), ()>(move _8, move _9) -> [return: bb2, unwind unreachable]; @@ -60,9 +60,9 @@ StorageDead(_8); StorageLive(_10); StorageLive(_11); - _11 = _1; + _11 = copy _1; StorageLive(_12); - _12 = _3; + _12 = copy _3; - _10 = aggregate_raw_ptr::<*const [u16], *const u8, usize>(move _11, move _12) -> [return: bb3, unwind unreachable]; + _10 = *const [u16] from (move _11, move _12); + goto -> bb3; @@ -73,9 +73,9 @@ StorageDead(_11); StorageLive(_13); StorageLive(_14); - _14 = _2; + _14 = copy _2; StorageLive(_15); - _15 = _3; + _15 = copy _3; - _13 = aggregate_raw_ptr::<*mut [u64], *mut (), usize>(move _14, move _15) -> [return: bb4, unwind unreachable]; + _13 = *mut [u64] from (move _14, move _15); + goto -> bb4; diff --git a/tests/mir-opt/lower_intrinsics.make_pointers.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.make_pointers.LowerIntrinsics.panic-unwind.diff index 02934d4c01e6f..b282509c06861 100644 --- a/tests/mir-opt/lower_intrinsics.make_pointers.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.make_pointers.LowerIntrinsics.panic-unwind.diff @@ -34,7 +34,7 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; StorageLive(_6); _6 = (); - _4 = aggregate_raw_ptr::<*const i32, *const u8, ()>(move _5, move _6) -> [return: bb1, unwind unreachable]; @@ -47,7 +47,7 @@ StorageDead(_5); StorageLive(_7); StorageLive(_8); - _8 = _2; + _8 = copy _2; StorageLive(_9); _9 = (); - _7 = aggregate_raw_ptr::<*mut u8, *mut (), ()>(move _8, move _9) -> [return: bb2, unwind unreachable]; @@ -60,9 +60,9 @@ StorageDead(_8); StorageLive(_10); StorageLive(_11); - _11 = _1; + _11 = copy _1; StorageLive(_12); - _12 = _3; + _12 = copy _3; - _10 = aggregate_raw_ptr::<*const [u16], *const u8, usize>(move _11, move _12) -> [return: bb3, unwind unreachable]; + _10 = *const [u16] from (move _11, move _12); + goto -> bb3; @@ -73,9 +73,9 @@ StorageDead(_11); StorageLive(_13); StorageLive(_14); - _14 = _2; + _14 = copy _2; StorageLive(_15); - _15 = _3; + _15 = copy _3; - _13 = aggregate_raw_ptr::<*mut [u64], *mut (), usize>(move _14, move _15) -> [return: bb4, unwind unreachable]; + _13 = *mut [u64] from (move _14, move _15); + goto -> bb4; diff --git a/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-abort.diff index 069a82b95215d..5aa9869847680 100644 --- a/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-abort.diff @@ -13,7 +13,7 @@ StorageLive(_1); _1 = std::intrinsics::size_of::; StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = move _2() -> [return: bb1, unwind unreachable]; + _0 = SizeOf(T); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-unwind.diff index 069a82b95215d..5aa9869847680 100644 --- a/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-unwind.diff @@ -13,7 +13,7 @@ StorageLive(_1); _1 = std::intrinsics::size_of::; StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = move _2() -> [return: bb1, unwind unreachable]; + _0 = SizeOf(T); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-abort.diff index 4f7ad0b6094f6..62cce84f69560 100644 --- a/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-abort.diff @@ -10,9 +10,9 @@ bb0: { StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = offset::<*const i32, isize>(move _3, move _4) -> [return: bb1, unwind unreachable]; + _0 = Offset(move _3, move _4); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-unwind.diff index 4f7ad0b6094f6..62cce84f69560 100644 --- a/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-unwind.diff @@ -10,9 +10,9 @@ bb0: { StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = offset::<*const i32, isize>(move _3, move _4) -> [return: bb1, unwind unreachable]; + _0 = Offset(move _3, move _4); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-abort.diff index 781104be290a6..95717d03b61f5 100644 --- a/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-abort.diff @@ -10,7 +10,7 @@ StorageLive(_2); _2 = &raw const (*_1); - _0 = read_via_copy::(move _2) -> [return: bb1, unwind unreachable]; -+ _0 = (*_2); ++ _0 = copy (*_2); + goto -> bb1; } diff --git a/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-unwind.diff index 781104be290a6..95717d03b61f5 100644 --- a/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-unwind.diff @@ -10,7 +10,7 @@ StorageLive(_2); _2 = &raw const (*_1); - _0 = read_via_copy::(move _2) -> [return: bb1, unwind unreachable]; -+ _0 = (*_2); ++ _0 = copy (*_2); + goto -> bb1; } diff --git a/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-abort.diff index 56c357b3776d9..8828549249e56 100644 --- a/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-abort.diff @@ -10,7 +10,7 @@ StorageLive(_2); _2 = &raw const (*_1); - _0 = read_via_copy::(move _2) -> unwind unreachable; -+ _0 = (*_2); ++ _0 = copy (*_2); + unreachable; } } diff --git a/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-unwind.diff index 56c357b3776d9..8828549249e56 100644 --- a/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-unwind.diff @@ -10,7 +10,7 @@ StorageLive(_2); _2 = &raw const (*_1); - _0 = read_via_copy::(move _2) -> unwind unreachable; -+ _0 = (*_2); ++ _0 = copy (*_2); + unreachable; } } diff --git a/tests/mir-opt/lower_intrinsics.three_way_compare_char.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.three_way_compare_char.LowerIntrinsics.panic-abort.diff index 816d620971588..f29bc5dfc6e4f 100644 --- a/tests/mir-opt/lower_intrinsics.three_way_compare_char.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.three_way_compare_char.LowerIntrinsics.panic-abort.diff @@ -15,9 +15,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = three_way_compare::(move _4, move _5) -> [return: bb1, unwind unreachable]; + _3 = Cmp(move _4, move _5); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.three_way_compare_char.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.three_way_compare_char.LowerIntrinsics.panic-unwind.diff index 80b4bd7a2be75..596ad70b3bfad 100644 --- a/tests/mir-opt/lower_intrinsics.three_way_compare_char.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.three_way_compare_char.LowerIntrinsics.panic-unwind.diff @@ -15,9 +15,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = three_way_compare::(move _4, move _5) -> [return: bb1, unwind continue]; + _3 = Cmp(move _4, move _5); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.three_way_compare_signed.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.three_way_compare_signed.LowerIntrinsics.panic-abort.diff index 05c20aaa09a27..654cb2503df58 100644 --- a/tests/mir-opt/lower_intrinsics.three_way_compare_signed.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.three_way_compare_signed.LowerIntrinsics.panic-abort.diff @@ -12,9 +12,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = three_way_compare::(move _4, move _5) -> [return: bb1, unwind unreachable]; + _3 = Cmp(move _4, move _5); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.three_way_compare_signed.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.three_way_compare_signed.LowerIntrinsics.panic-unwind.diff index 8a254d02a47b2..987c216669271 100644 --- a/tests/mir-opt/lower_intrinsics.three_way_compare_signed.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.three_way_compare_signed.LowerIntrinsics.panic-unwind.diff @@ -12,9 +12,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = three_way_compare::(move _4, move _5) -> [return: bb1, unwind continue]; + _3 = Cmp(move _4, move _5); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.three_way_compare_unsigned.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.three_way_compare_unsigned.LowerIntrinsics.panic-abort.diff index 437614ec6738d..82c89b7ce549c 100644 --- a/tests/mir-opt/lower_intrinsics.three_way_compare_unsigned.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.three_way_compare_unsigned.LowerIntrinsics.panic-abort.diff @@ -15,9 +15,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = three_way_compare::(move _4, move _5) -> [return: bb1, unwind unreachable]; + _3 = Cmp(move _4, move _5); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.three_way_compare_unsigned.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.three_way_compare_unsigned.LowerIntrinsics.panic-unwind.diff index 7d6137979c81b..d7ec6dcfa2c3c 100644 --- a/tests/mir-opt/lower_intrinsics.three_way_compare_unsigned.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.three_way_compare_unsigned.LowerIntrinsics.panic-unwind.diff @@ -15,9 +15,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = three_way_compare::(move _4, move _5) -> [return: bb1, unwind continue]; + _3 = Cmp(move _4, move _5); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-abort.diff index 6e542c4b5a7b7..71e84fdd8816e 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-abort.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = transmute::(move _2) -> [return: bb1, unwind unreachable]; + _0 = move _2 as i8 (Transmute); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-unwind.diff index 6e542c4b5a7b7..71e84fdd8816e 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-unwind.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = transmute::(move _2) -> [return: bb1, unwind unreachable]; + _0 = move _2 as i8 (Transmute); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-abort.diff index ab4646370f163..37232b826c129 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-abort.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = transmute::<&T, *const T>(move _2) -> [return: bb1, unwind unreachable]; + _0 = move _2 as *const T (Transmute); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-unwind.diff index ab4646370f163..37232b826c129 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-unwind.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = transmute::<&T, *const T>(move _2) -> [return: bb1, unwind unreachable]; + _0 = move _2 as *const T (Transmute); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-abort.diff index c4a3358ffa3ab..8ac70f99ad2f0 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-abort.diff @@ -17,7 +17,7 @@ } bb1: { - _2 = (((_1.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const Never); + _2 = copy (((_1.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const Never); PlaceMention((*_2)); unreachable; } diff --git a/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-unwind.diff index c4a3358ffa3ab..8ac70f99ad2f0 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-unwind.diff @@ -17,7 +17,7 @@ } bb1: { - _2 = (((_1.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const Never); + _2 = copy (((_1.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const Never); PlaceMention((*_2)); unreachable; } diff --git a/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-abort.diff index 6d3ad348988b3..eab969e9fe5bb 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-abort.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = transmute::<(), Never>(move _2) -> unwind unreachable; + _0 = move _2 as Never (Transmute); + unreachable; diff --git a/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-unwind.diff index 6d3ad348988b3..eab969e9fe5bb 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-unwind.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = transmute::<(), Never>(move _2) -> unwind unreachable; + _0 = move _2 as Never (Transmute); + unreachable; diff --git a/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-abort.diff index 3c9694d0370d8..d0d38462f8dd8 100644 --- a/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-abort.diff @@ -64,9 +64,9 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; StorageLive(_6); - _6 = _2; + _6 = copy _2; - _4 = unchecked_add::(move _5, move _6) -> [return: bb1, unwind unreachable]; + _4 = AddUnchecked(move _5, move _6); + goto -> bb1; @@ -77,9 +77,9 @@ StorageDead(_5); StorageLive(_7); StorageLive(_8); - _8 = _1; + _8 = copy _1; StorageLive(_9); - _9 = _2; + _9 = copy _2; - _7 = unchecked_sub::(move _8, move _9) -> [return: bb2, unwind unreachable]; + _7 = SubUnchecked(move _8, move _9); + goto -> bb2; @@ -90,9 +90,9 @@ StorageDead(_8); StorageLive(_10); StorageLive(_11); - _11 = _1; + _11 = copy _1; StorageLive(_12); - _12 = _2; + _12 = copy _2; - _10 = unchecked_mul::(move _11, move _12) -> [return: bb3, unwind unreachable]; + _10 = MulUnchecked(move _11, move _12); + goto -> bb3; @@ -103,9 +103,9 @@ StorageDead(_11); StorageLive(_13); StorageLive(_14); - _14 = _1; + _14 = copy _1; StorageLive(_15); - _15 = _2; + _15 = copy _2; - _13 = unchecked_div::(move _14, move _15) -> [return: bb4, unwind unreachable]; + _13 = Div(move _14, move _15); + goto -> bb4; @@ -116,9 +116,9 @@ StorageDead(_14); StorageLive(_16); StorageLive(_17); - _17 = _1; + _17 = copy _1; StorageLive(_18); - _18 = _2; + _18 = copy _2; - _16 = unchecked_rem::(move _17, move _18) -> [return: bb5, unwind unreachable]; + _16 = Rem(move _17, move _18); + goto -> bb5; @@ -129,9 +129,9 @@ StorageDead(_17); StorageLive(_19); StorageLive(_20); - _20 = _1; + _20 = copy _1; StorageLive(_21); - _21 = _2; + _21 = copy _2; - _19 = unchecked_shl::(move _20, move _21) -> [return: bb6, unwind unreachable]; + _19 = ShlUnchecked(move _20, move _21); + goto -> bb6; @@ -142,9 +142,9 @@ StorageDead(_20); StorageLive(_22); StorageLive(_23); - _23 = _1; + _23 = copy _1; StorageLive(_24); - _24 = _2; + _24 = copy _2; - _22 = unchecked_shr::(move _23, move _24) -> [return: bb7, unwind unreachable]; + _22 = ShrUnchecked(move _23, move _24); + goto -> bb7; @@ -155,9 +155,9 @@ StorageDead(_23); StorageLive(_25); StorageLive(_26); - _26 = _1; + _26 = copy _1; StorageLive(_27); - _27 = _3; + _27 = copy _3; - _25 = unchecked_shl::(move _26, move _27) -> [return: bb8, unwind unreachable]; + _25 = ShlUnchecked(move _26, move _27); + goto -> bb8; @@ -168,9 +168,9 @@ StorageDead(_26); StorageLive(_28); StorageLive(_29); - _29 = _1; + _29 = copy _1; StorageLive(_30); - _30 = _3; + _30 = copy _3; - _28 = unchecked_shr::(move _29, move _30) -> [return: bb9, unwind unreachable]; + _28 = ShrUnchecked(move _29, move _30); + goto -> bb9; diff --git a/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-unwind.diff index 3c9694d0370d8..d0d38462f8dd8 100644 --- a/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-unwind.diff @@ -64,9 +64,9 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; StorageLive(_6); - _6 = _2; + _6 = copy _2; - _4 = unchecked_add::(move _5, move _6) -> [return: bb1, unwind unreachable]; + _4 = AddUnchecked(move _5, move _6); + goto -> bb1; @@ -77,9 +77,9 @@ StorageDead(_5); StorageLive(_7); StorageLive(_8); - _8 = _1; + _8 = copy _1; StorageLive(_9); - _9 = _2; + _9 = copy _2; - _7 = unchecked_sub::(move _8, move _9) -> [return: bb2, unwind unreachable]; + _7 = SubUnchecked(move _8, move _9); + goto -> bb2; @@ -90,9 +90,9 @@ StorageDead(_8); StorageLive(_10); StorageLive(_11); - _11 = _1; + _11 = copy _1; StorageLive(_12); - _12 = _2; + _12 = copy _2; - _10 = unchecked_mul::(move _11, move _12) -> [return: bb3, unwind unreachable]; + _10 = MulUnchecked(move _11, move _12); + goto -> bb3; @@ -103,9 +103,9 @@ StorageDead(_11); StorageLive(_13); StorageLive(_14); - _14 = _1; + _14 = copy _1; StorageLive(_15); - _15 = _2; + _15 = copy _2; - _13 = unchecked_div::(move _14, move _15) -> [return: bb4, unwind unreachable]; + _13 = Div(move _14, move _15); + goto -> bb4; @@ -116,9 +116,9 @@ StorageDead(_14); StorageLive(_16); StorageLive(_17); - _17 = _1; + _17 = copy _1; StorageLive(_18); - _18 = _2; + _18 = copy _2; - _16 = unchecked_rem::(move _17, move _18) -> [return: bb5, unwind unreachable]; + _16 = Rem(move _17, move _18); + goto -> bb5; @@ -129,9 +129,9 @@ StorageDead(_17); StorageLive(_19); StorageLive(_20); - _20 = _1; + _20 = copy _1; StorageLive(_21); - _21 = _2; + _21 = copy _2; - _19 = unchecked_shl::(move _20, move _21) -> [return: bb6, unwind unreachable]; + _19 = ShlUnchecked(move _20, move _21); + goto -> bb6; @@ -142,9 +142,9 @@ StorageDead(_20); StorageLive(_22); StorageLive(_23); - _23 = _1; + _23 = copy _1; StorageLive(_24); - _24 = _2; + _24 = copy _2; - _22 = unchecked_shr::(move _23, move _24) -> [return: bb7, unwind unreachable]; + _22 = ShrUnchecked(move _23, move _24); + goto -> bb7; @@ -155,9 +155,9 @@ StorageDead(_23); StorageLive(_25); StorageLive(_26); - _26 = _1; + _26 = copy _1; StorageLive(_27); - _27 = _3; + _27 = copy _3; - _25 = unchecked_shl::(move _26, move _27) -> [return: bb8, unwind unreachable]; + _25 = ShlUnchecked(move _26, move _27); + goto -> bb8; @@ -168,9 +168,9 @@ StorageDead(_26); StorageLive(_28); StorageLive(_29); - _29 = _1; + _29 = copy _1; StorageLive(_30); - _30 = _3; + _30 = copy _3; - _28 = unchecked_shr::(move _29, move _30) -> [return: bb9, unwind unreachable]; + _28 = ShrUnchecked(move _29, move _30); + goto -> bb9; diff --git a/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-abort.diff index efbbeeeac73da..a9bb5e7e3a443 100644 --- a/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-abort.diff @@ -27,9 +27,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = add_with_overflow::(move _4, move _5) -> [return: bb1, unwind unreachable]; + _3 = AddWithOverflow(move _4, move _5); + goto -> bb1; @@ -40,9 +40,9 @@ StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = _1; + _7 = copy _1; StorageLive(_8); - _8 = _2; + _8 = copy _2; - _6 = sub_with_overflow::(move _7, move _8) -> [return: bb2, unwind unreachable]; + _6 = SubWithOverflow(move _7, move _8); + goto -> bb2; @@ -53,9 +53,9 @@ StorageDead(_7); StorageLive(_9); StorageLive(_10); - _10 = _1; + _10 = copy _1; StorageLive(_11); - _11 = _2; + _11 = copy _2; - _9 = mul_with_overflow::(move _10, move _11) -> [return: bb3, unwind unreachable]; + _9 = MulWithOverflow(move _10, move _11); + goto -> bb3; diff --git a/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-unwind.diff index efbbeeeac73da..a9bb5e7e3a443 100644 --- a/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-unwind.diff @@ -27,9 +27,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = add_with_overflow::(move _4, move _5) -> [return: bb1, unwind unreachable]; + _3 = AddWithOverflow(move _4, move _5); + goto -> bb1; @@ -40,9 +40,9 @@ StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = _1; + _7 = copy _1; StorageLive(_8); - _8 = _2; + _8 = copy _2; - _6 = sub_with_overflow::(move _7, move _8) -> [return: bb2, unwind unreachable]; + _6 = SubWithOverflow(move _7, move _8); + goto -> bb2; @@ -53,9 +53,9 @@ StorageDead(_7); StorageLive(_9); StorageLive(_10); - _10 = _1; + _10 = copy _1; StorageLive(_11); - _11 = _2; + _11 = copy _2; - _9 = mul_with_overflow::(move _10, move _11) -> [return: bb3, unwind unreachable]; + _9 = MulWithOverflow(move _10, move _11); + goto -> bb3; diff --git a/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-abort.diff index 2acb193e054d5..552b1a9a32b41 100644 --- a/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-abort.diff @@ -27,9 +27,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = std::intrinsics::wrapping_add::(move _4, move _5) -> [return: bb1, unwind unreachable]; + _3 = Add(move _4, move _5); + goto -> bb1; @@ -40,9 +40,9 @@ StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = _1; + _7 = copy _1; StorageLive(_8); - _8 = _2; + _8 = copy _2; - _6 = std::intrinsics::wrapping_sub::(move _7, move _8) -> [return: bb2, unwind unreachable]; + _6 = Sub(move _7, move _8); + goto -> bb2; @@ -53,9 +53,9 @@ StorageDead(_7); StorageLive(_9); StorageLive(_10); - _10 = _1; + _10 = copy _1; StorageLive(_11); - _11 = _2; + _11 = copy _2; - _9 = wrapping_mul::(move _10, move _11) -> [return: bb3, unwind unreachable]; + _9 = Mul(move _10, move _11); + goto -> bb3; diff --git a/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-unwind.diff index 2acb193e054d5..552b1a9a32b41 100644 --- a/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-unwind.diff @@ -27,9 +27,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = std::intrinsics::wrapping_add::(move _4, move _5) -> [return: bb1, unwind unreachable]; + _3 = Add(move _4, move _5); + goto -> bb1; @@ -40,9 +40,9 @@ StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = _1; + _7 = copy _1; StorageLive(_8); - _8 = _2; + _8 = copy _2; - _6 = std::intrinsics::wrapping_sub::(move _7, move _8) -> [return: bb2, unwind unreachable]; + _6 = Sub(move _7, move _8); + goto -> bb2; @@ -53,9 +53,9 @@ StorageDead(_7); StorageLive(_9); StorageLive(_10); - _10 = _1; + _10 = copy _1; StorageLive(_11); - _11 = _2; + _11 = copy _2; - _9 = wrapping_mul::(move _10, move _11) -> [return: bb3, unwind unreachable]; + _9 = Mul(move _10, move _11); + goto -> bb3; diff --git a/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-abort.diff b/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-abort.diff index a212ee6788115..20001f1248ef5 100644 --- a/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-abort.diff +++ b/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-abort.diff @@ -16,7 +16,7 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); StorageLive(_6); _6 = &(*_2); @@ -35,14 +35,14 @@ StorageDead(_5); StorageDead(_4); StorageLive(_7); - _7 = _1; + _7 = copy _1; _8 = Len((*_2)); - _9 = Lt(_7, _8); - assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb3, unwind unreachable]; + _9 = Lt(copy _7, copy _8); + assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb3, unwind unreachable]; } bb3: { - _0 = (*_2)[_7]; + _0 = copy (*_2)[_7]; StorageDead(_7); goto -> bb5; } diff --git a/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-unwind.diff b/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-unwind.diff index 38ec8a5b0c72e..ca8f92df5de0c 100644 --- a/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-unwind.diff +++ b/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-unwind.diff @@ -16,7 +16,7 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); StorageLive(_6); _6 = &(*_2); @@ -35,14 +35,14 @@ StorageDead(_5); StorageDead(_4); StorageLive(_7); - _7 = _1; + _7 = copy _1; _8 = Len((*_2)); - _9 = Lt(_7, _8); - assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb3, unwind continue]; + _9 = Lt(copy _7, copy _8); + assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb3, unwind continue]; } bb3: { - _0 = (*_2)[_7]; + _0 = copy (*_2)[_7]; StorageDead(_7); goto -> bb5; } diff --git a/tests/mir-opt/match_arm_scopes.complicated_match.panic-abort.SimplifyCfg-initial.after-ElaborateDrops.after.diff b/tests/mir-opt/match_arm_scopes.complicated_match.panic-abort.SimplifyCfg-initial.after-ElaborateDrops.after.diff index 3c4a84bc24368..b3eb3e1f8b9d2 100644 --- a/tests/mir-opt/match_arm_scopes.complicated_match.panic-abort.SimplifyCfg-initial.after-ElaborateDrops.after.diff +++ b/tests/mir-opt/match_arm_scopes.complicated_match.panic-abort.SimplifyCfg-initial.after-ElaborateDrops.after.diff @@ -32,22 +32,22 @@ bb0: { PlaceMention(_2); -- switchInt((_2.0: bool)) -> [0: bb2, otherwise: bb1]; -+ switchInt((_2.0: bool)) -> [0: bb6, otherwise: bb1]; +- switchInt(copy (_2.0: bool)) -> [0: bb2, otherwise: bb1]; ++ switchInt(copy (_2.0: bool)) -> [0: bb6, otherwise: bb1]; } bb1: { -- switchInt((_2.1: bool)) -> [0: bb4, otherwise: bb3]; -+ switchInt((_2.1: bool)) -> [0: bb5, otherwise: bb2]; +- switchInt(copy (_2.1: bool)) -> [0: bb4, otherwise: bb3]; ++ switchInt(copy (_2.1: bool)) -> [0: bb5, otherwise: bb2]; } bb2: { - falseEdge -> [real: bb9, imaginary: bb1]; -+ switchInt((_2.0: bool)) -> [0: bb3, otherwise: bb4]; ++ switchInt(copy (_2.0: bool)) -> [0: bb3, otherwise: bb4]; } bb3: { -- switchInt((_2.0: bool)) -> [0: bb6, otherwise: bb5]; +- switchInt(copy (_2.0: bool)) -> [0: bb6, otherwise: bb5]; - } - - bb4: { @@ -60,7 +60,7 @@ - - bb6: { StorageLive(_15); - _15 = (_2.1: bool); + _15 = copy (_2.1: bool); StorageLive(_16); _16 = move (_2.2: std::string::String); - goto -> bb20; @@ -70,7 +70,7 @@ - bb7: { + bb4: { StorageLive(_15); - _15 = (_2.1: bool); + _15 = copy (_2.1: bool); StorageLive(_16); _16 = move (_2.2: std::string::String); - goto -> bb20; @@ -87,7 +87,7 @@ - _4 = &fake shallow (_2.1: bool); StorageLive(_12); StorageLive(_13); - _13 = _1; + _13 = copy _1; - switchInt(move _13) -> [0: bb16, otherwise: bb15]; + switchInt(move _13) -> [0: bb13, otherwise: bb12]; } @@ -102,7 +102,7 @@ - _4 = &fake shallow (_2.1: bool); StorageLive(_9); StorageLive(_10); - _10 = _1; + _10 = copy _1; - switchInt(move _10) -> [0: bb12, otherwise: bb11]; + switchInt(move _10) -> [0: bb9, otherwise: bb8]; } @@ -125,7 +125,7 @@ - bb12: { + bb9: { - _9 = (*_6); + _9 = copy (*_6); - switchInt(move _9) -> [0: bb14, otherwise: bb13]; + switchInt(move _9) -> [0: bb11, otherwise: bb10]; } @@ -139,7 +139,7 @@ - FakeRead(ForGuardBinding, _6); - FakeRead(ForGuardBinding, _8); StorageLive(_5); - _5 = (_2.1: bool); + _5 = copy (_2.1: bool); StorageLive(_7); _7 = move (_2.2: std::string::String); - goto -> bb10; @@ -167,7 +167,7 @@ - bb16: { + bb13: { - _12 = (*_6); + _12 = copy (*_6); - switchInt(move _12) -> [0: bb18, otherwise: bb17]; + switchInt(move _12) -> [0: bb15, otherwise: bb14]; } @@ -181,7 +181,7 @@ - FakeRead(ForGuardBinding, _6); - FakeRead(ForGuardBinding, _8); StorageLive(_5); - _5 = (_2.0: bool); + _5 = copy (_2.0: bool); StorageLive(_7); _7 = move (_2.2: std::string::String); - goto -> bb10; diff --git a/tests/mir-opt/match_arm_scopes.complicated_match.panic-unwind.SimplifyCfg-initial.after-ElaborateDrops.after.diff b/tests/mir-opt/match_arm_scopes.complicated_match.panic-unwind.SimplifyCfg-initial.after-ElaborateDrops.after.diff index 3c4a84bc24368..b3eb3e1f8b9d2 100644 --- a/tests/mir-opt/match_arm_scopes.complicated_match.panic-unwind.SimplifyCfg-initial.after-ElaborateDrops.after.diff +++ b/tests/mir-opt/match_arm_scopes.complicated_match.panic-unwind.SimplifyCfg-initial.after-ElaborateDrops.after.diff @@ -32,22 +32,22 @@ bb0: { PlaceMention(_2); -- switchInt((_2.0: bool)) -> [0: bb2, otherwise: bb1]; -+ switchInt((_2.0: bool)) -> [0: bb6, otherwise: bb1]; +- switchInt(copy (_2.0: bool)) -> [0: bb2, otherwise: bb1]; ++ switchInt(copy (_2.0: bool)) -> [0: bb6, otherwise: bb1]; } bb1: { -- switchInt((_2.1: bool)) -> [0: bb4, otherwise: bb3]; -+ switchInt((_2.1: bool)) -> [0: bb5, otherwise: bb2]; +- switchInt(copy (_2.1: bool)) -> [0: bb4, otherwise: bb3]; ++ switchInt(copy (_2.1: bool)) -> [0: bb5, otherwise: bb2]; } bb2: { - falseEdge -> [real: bb9, imaginary: bb1]; -+ switchInt((_2.0: bool)) -> [0: bb3, otherwise: bb4]; ++ switchInt(copy (_2.0: bool)) -> [0: bb3, otherwise: bb4]; } bb3: { -- switchInt((_2.0: bool)) -> [0: bb6, otherwise: bb5]; +- switchInt(copy (_2.0: bool)) -> [0: bb6, otherwise: bb5]; - } - - bb4: { @@ -60,7 +60,7 @@ - - bb6: { StorageLive(_15); - _15 = (_2.1: bool); + _15 = copy (_2.1: bool); StorageLive(_16); _16 = move (_2.2: std::string::String); - goto -> bb20; @@ -70,7 +70,7 @@ - bb7: { + bb4: { StorageLive(_15); - _15 = (_2.1: bool); + _15 = copy (_2.1: bool); StorageLive(_16); _16 = move (_2.2: std::string::String); - goto -> bb20; @@ -87,7 +87,7 @@ - _4 = &fake shallow (_2.1: bool); StorageLive(_12); StorageLive(_13); - _13 = _1; + _13 = copy _1; - switchInt(move _13) -> [0: bb16, otherwise: bb15]; + switchInt(move _13) -> [0: bb13, otherwise: bb12]; } @@ -102,7 +102,7 @@ - _4 = &fake shallow (_2.1: bool); StorageLive(_9); StorageLive(_10); - _10 = _1; + _10 = copy _1; - switchInt(move _10) -> [0: bb12, otherwise: bb11]; + switchInt(move _10) -> [0: bb9, otherwise: bb8]; } @@ -125,7 +125,7 @@ - bb12: { + bb9: { - _9 = (*_6); + _9 = copy (*_6); - switchInt(move _9) -> [0: bb14, otherwise: bb13]; + switchInt(move _9) -> [0: bb11, otherwise: bb10]; } @@ -139,7 +139,7 @@ - FakeRead(ForGuardBinding, _6); - FakeRead(ForGuardBinding, _8); StorageLive(_5); - _5 = (_2.1: bool); + _5 = copy (_2.1: bool); StorageLive(_7); _7 = move (_2.2: std::string::String); - goto -> bb10; @@ -167,7 +167,7 @@ - bb16: { + bb13: { - _12 = (*_6); + _12 = copy (*_6); - switchInt(move _12) -> [0: bb18, otherwise: bb17]; + switchInt(move _12) -> [0: bb15, otherwise: bb14]; } @@ -181,7 +181,7 @@ - FakeRead(ForGuardBinding, _6); - FakeRead(ForGuardBinding, _8); StorageLive(_5); - _5 = (_2.0: bool); + _5 = copy (_2.0: bool); StorageLive(_7); _7 = move (_2.2: std::string::String); - goto -> bb10; diff --git a/tests/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff index 65da13eec50e3..597d93926f169 100644 --- a/tests/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff @@ -33,16 +33,16 @@ StorageLive(_4); StorageLive(_5); StorageLive(_6); -- switchInt(_1) -> [7: bb2, otherwise: bb1]; +- switchInt(copy _1) -> [7: bb2, otherwise: bb1]; - } - - bb1: { - _2 = const true; - _3 = const false; + StorageLive(_11); -+ _11 = _1; -+ _2 = Ne(_11, const 7_i32); -+ _3 = Eq(_11, const 7_i32); ++ _11 = copy _1; ++ _2 = Ne(copy _11, const 7_i32); ++ _3 = Eq(copy _11, const 7_i32); _4 = const false; _5 = const true; _6 = (); @@ -62,13 +62,13 @@ + StorageDead(_11); StorageDead(_6); StorageLive(_7); - _7 = _2; + _7 = copy _2; StorageLive(_8); - _8 = _3; + _8 = copy _3; StorageLive(_9); - _9 = _4; + _9 = copy _4; StorageLive(_10); - _10 = _5; + _10 = copy _5; _0 = (move _7, move _8, move _9, move _10); StorageDead(_10); StorageDead(_9); diff --git a/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff index 052e2e126643e..281f43b355dc0 100644 --- a/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff @@ -14,7 +14,7 @@ - switchInt(move _3) -> [0: bb2, otherwise: bb1]; + StorageLive(_4); + _4 = move _3; -+ _2 = Eq(_4, const 0_isize); ++ _2 = Eq(copy _4, const 0_isize); + StorageDead(_4); + switchInt(move _2) -> [0: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/matches_reduce_branches.match_i128_u128.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_i128_u128.MatchBranchSimplification.diff index fc34ce7125ec2..cc7e863d13546 100644 --- a/tests/mir-opt/matches_reduce_branches.match_i128_u128.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_i128_u128.MatchBranchSimplification.diff @@ -39,7 +39,7 @@ - bb6: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as u128 (IntToInt); ++ _0 = copy _3 as u128 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff index 5a71bef93416d..e9143ef1636e6 100644 --- a/tests/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff @@ -46,7 +46,7 @@ - bb4: { + StorageLive(_7); + _7 = move _6; -+ _5 = Ne(_7, const false); ++ _5 = Ne(copy _7, const false); + StorageDead(_7); + StorageLive(_8); + _8 = move _5; @@ -66,7 +66,7 @@ - } - - bb7: { -+ _4 = Ne(_8, const false); ++ _4 = Ne(copy _8, const false); + StorageDead(_8); + StorageLive(_9); + _9 = move _4; @@ -86,7 +86,7 @@ - } - - bb10: { -+ _3 = Ne(_9, const false); ++ _3 = Ne(copy _9, const false); + StorageDead(_9); + StorageLive(_10); + _10 = move _3; @@ -104,10 +104,10 @@ - } - - bb12: { -+ _1 = Ne(_10, const false); ++ _1 = Ne(copy _10, const false); + StorageDead(_10); StorageDead(_2); - _0 = _1; + _0 = copy _1; StorageDead(_1); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_sext_i8_i16.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_sext_i8_i16.MatchBranchSimplification.diff index 7f8c2ab8d3748..dbd26adc20f93 100644 --- a/tests/mir-opt/matches_reduce_branches.match_sext_i8_i16.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_sext_i8_i16.MatchBranchSimplification.diff @@ -44,7 +44,7 @@ - bb7: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as i16 (IntToInt); ++ _0 = copy _3 as i16 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_sext_i8_u16.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_sext_i8_u16.MatchBranchSimplification.diff index 86d0d0ba6cf57..f273d5388350e 100644 --- a/tests/mir-opt/matches_reduce_branches.match_sext_i8_u16.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_sext_i8_u16.MatchBranchSimplification.diff @@ -44,7 +44,7 @@ - bb7: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as u16 (IntToInt); ++ _0 = copy _3 as u16 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_trunc_i16_i8.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_trunc_i16_i8.MatchBranchSimplification.diff index d3d27be207019..6170cf13c0021 100644 --- a/tests/mir-opt/matches_reduce_branches.match_trunc_i16_i8.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_trunc_i16_i8.MatchBranchSimplification.diff @@ -69,7 +69,7 @@ - bb12: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as i8 (IntToInt); ++ _0 = copy _3 as i8 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_trunc_i16_u8.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_trunc_i16_u8.MatchBranchSimplification.diff index 5fe899148ebc5..c18719ebb55eb 100644 --- a/tests/mir-opt/matches_reduce_branches.match_trunc_i16_u8.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_trunc_i16_u8.MatchBranchSimplification.diff @@ -69,7 +69,7 @@ - bb12: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as u8 (IntToInt); ++ _0 = copy _3 as u8 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_trunc_u16_i8.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_trunc_u16_i8.MatchBranchSimplification.diff index 85f97a13cac94..401049026f27b 100644 --- a/tests/mir-opt/matches_reduce_branches.match_trunc_u16_i8.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_trunc_u16_i8.MatchBranchSimplification.diff @@ -59,7 +59,7 @@ - bb10: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as i8 (IntToInt); ++ _0 = copy _3 as i8 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_trunc_u16_u8.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_trunc_u16_u8.MatchBranchSimplification.diff index 768d838eaa6fc..d4dafbd886fcb 100644 --- a/tests/mir-opt/matches_reduce_branches.match_trunc_u16_u8.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_trunc_u16_u8.MatchBranchSimplification.diff @@ -59,7 +59,7 @@ - bb10: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as u8 (IntToInt); ++ _0 = copy _3 as u8 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i8.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i8.MatchBranchSimplification.diff index d63eed7c019a4..5ab6f5eac84aa 100644 --- a/tests/mir-opt/matches_reduce_branches.match_u8_i8.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_u8_i8.MatchBranchSimplification.diff @@ -39,7 +39,7 @@ - bb6: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as i8 (IntToInt); ++ _0 = copy _3 as i8 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i8_2.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i8_2.MatchBranchSimplification.diff index 98dee1835a827..f14b3af9660aa 100644 --- a/tests/mir-opt/matches_reduce_branches.match_u8_i8_2.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_u8_i8_2.MatchBranchSimplification.diff @@ -35,8 +35,8 @@ - _3 = const -1_i8; + StorageLive(_8); + _8 = move _5; -+ _2 = _8 as i8 (IntToInt); -+ _3 = _8 as i8 (IntToInt); ++ _2 = copy _8 as i8 (IntToInt); ++ _3 = copy _8 as i8 (IntToInt); _4 = (); - goto -> bb6; - } @@ -66,9 +66,9 @@ + StorageDead(_8); StorageDead(_4); StorageLive(_6); - _6 = _2; + _6 = copy _2; StorageLive(_7); - _7 = _3; + _7 = copy _3; _0 = (move _6, move _7); StorageDead(_7); StorageDead(_6); diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i8_2_failed.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i8_2_failed.MatchBranchSimplification.diff index 901dda5861775..92e1a7dbc7d61 100644 --- a/tests/mir-opt/matches_reduce_branches.match_u8_i8_2_failed.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_u8_i8_2_failed.MatchBranchSimplification.diff @@ -60,9 +60,9 @@ bb6: { StorageDead(_4); StorageLive(_6); - _6 = _2; + _6 = copy _2; StorageLive(_7); - _7 = _3; + _7 = copy _3; _0 = (move _6, move _7); StorageDead(_7); StorageDead(_6); diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_1.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_1.MatchBranchSimplification.diff index 9ebf2cf27cbf7..a1d58424ecd1a 100644 --- a/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_1.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_1.MatchBranchSimplification.diff @@ -7,7 +7,7 @@ bb0: { _2 = discriminant(_1); - switchInt(_2) -> [0: bb1, 127: bb2, 128: bb3, 255: bb4, otherwise: bb5]; + switchInt(copy _2) -> [0: bb1, 127: bb2, 128: bb3, 255: bb4, otherwise: bb5]; } bb1: { diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_2.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_2.MatchBranchSimplification.diff index 554856777eb6e..6c4ade1b6ca96 100644 --- a/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_2.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_2.MatchBranchSimplification.diff @@ -7,7 +7,7 @@ bb0: { _2 = discriminant(_1); - switchInt(_2) -> [0: bb1, 127: bb2, 128: bb3, 255: bb4, otherwise: bb5]; + switchInt(copy _2) -> [0: bb1, 127: bb2, 128: bb3, 255: bb4, otherwise: bb5]; } bb1: { diff --git a/tests/mir-opt/matches_reduce_branches.match_zext_u8_i16.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_zext_u8_i16.MatchBranchSimplification.diff index e00a604fe25da..fdf83d91bbd38 100644 --- a/tests/mir-opt/matches_reduce_branches.match_zext_u8_i16.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_zext_u8_i16.MatchBranchSimplification.diff @@ -39,7 +39,7 @@ - bb6: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as i16 (IntToInt); ++ _0 = copy _3 as i16 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_zext_u8_u16.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_zext_u8_u16.MatchBranchSimplification.diff index befb9118907b4..a888d247275fd 100644 --- a/tests/mir-opt/matches_reduce_branches.match_zext_u8_u16.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_zext_u8_u16.MatchBranchSimplification.diff @@ -39,7 +39,7 @@ - bb6: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as u16 (IntToInt); ++ _0 = copy _3 as u16 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff b/tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff index 11a18f58e3a1f..99985b28382f5 100644 --- a/tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff @@ -29,7 +29,7 @@ - bb4: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as u8 (IntToInt); ++ _0 = copy _3 as u8 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff b/tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff index 809badc41ba71..0fc5032691fed 100644 --- a/tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff @@ -29,7 +29,7 @@ - bb4: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as i8 (IntToInt); ++ _0 = copy _3 as i8 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir index ad456600b0ab6..d09a422d4080e 100644 --- a/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir +++ b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir @@ -50,15 +50,15 @@ fn main() -> () { StorageLive(_3); _3 = const ConstValue(Scalar(0x00000000): usize); _4 = Len(_1); - _5 = Lt(_3, _4); - assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb7]; + _5 = Lt(copy _3, copy _4); + assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind: bb7]; } bb1: { _2 = &'?2 _1[_3]; FakeRead(ForLet(None), _2); StorageLive(_6); - _6 = _2; + _6 = copy _2; FakeRead(ForLet(None), _6); StorageLive(_7); _7 = const ConstValue(Scalar(0x01): bool); @@ -68,7 +68,7 @@ fn main() -> () { bb2: { StorageLive(_8); StorageLive(_9); - _9 = (*_6); + _9 = copy (*_6); _8 = ConstValue(ZeroSized: fn(usize) -> bool {use_x})(move _9) -> [return: bb3, unwind: bb7]; } diff --git a/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir index a15d47cd66fef..4abb5b0b93b11 100644 --- a/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir +++ b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir @@ -50,15 +50,15 @@ fn main() -> () { StorageLive(_3); _3 = const ConstValue(Scalar(0x0000000000000000): usize); _4 = Len(_1); - _5 = Lt(_3, _4); - assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb7]; + _5 = Lt(copy _3, copy _4); + assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind: bb7]; } bb1: { _2 = &'?2 _1[_3]; FakeRead(ForLet(None), _2); StorageLive(_6); - _6 = _2; + _6 = copy _2; FakeRead(ForLet(None), _6); StorageLive(_7); _7 = const ConstValue(Scalar(0x01): bool); @@ -68,7 +68,7 @@ fn main() -> () { bb2: { StorageLive(_8); StorageLive(_9); - _9 = (*_6); + _9 = copy (*_6); _8 = ConstValue(ZeroSized: fn(usize) -> bool {use_x})(move _9) -> [return: bb3, unwind: bb7]; } diff --git a/tests/mir-opt/nrvo_miscompile_111005.wrong.RenameReturnPlace.diff b/tests/mir-opt/nrvo_miscompile_111005.wrong.RenameReturnPlace.diff index 260b472daa92a..d248c76f261b6 100644 --- a/tests/mir-opt/nrvo_miscompile_111005.wrong.RenameReturnPlace.diff +++ b/tests/mir-opt/nrvo_miscompile_111005.wrong.RenameReturnPlace.diff @@ -6,10 +6,10 @@ let mut _2: char; bb0: { -- _2 = _1; -- _0 = _2; +- _2 = copy _1; +- _0 = copy _2; - _2 = const 'b'; -+ _0 = _1; ++ _0 = copy _1; + _0 = const 'b'; return; } diff --git a/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-abort.diff b/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-abort.diff index f7bc5559ab7b4..6dce3ec5303d7 100644 --- a/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-abort.diff +++ b/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-abort.diff @@ -20,7 +20,7 @@ + _0 = [const 0_u8; 1024]; StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); StorageLive(_6); - _6 = &mut _2; @@ -34,7 +34,7 @@ StorageDead(_4); StorageDead(_6); StorageDead(_3); -- _0 = _2; +- _0 = copy _2; - StorageDead(_2); return; } diff --git a/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-unwind.diff b/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-unwind.diff index 3df8e567f1fe0..54cbe2871f15a 100644 --- a/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-unwind.diff +++ b/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-unwind.diff @@ -20,7 +20,7 @@ + _0 = [const 0_u8; 1024]; StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); StorageLive(_6); - _6 = &mut _2; @@ -34,7 +34,7 @@ StorageDead(_4); StorageDead(_6); StorageDead(_3); -- _0 = _2; +- _0 = copy _2; - StorageDead(_2); return; } diff --git a/tests/mir-opt/or_pattern.shortcut_second_or.SimplifyCfg-initial.after.mir b/tests/mir-opt/or_pattern.shortcut_second_or.SimplifyCfg-initial.after.mir index 6c76a72b77577..c5d7a6a1d9965 100644 --- a/tests/mir-opt/or_pattern.shortcut_second_or.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/or_pattern.shortcut_second_or.SimplifyCfg-initial.after.mir @@ -18,15 +18,15 @@ fn shortcut_second_or() -> () { _1 = (move _2, const 0_i32); StorageDead(_2); PlaceMention(_1); - switchInt(((_1.0: (i32, i32)).0: i32)) -> [0: bb2, otherwise: bb1]; + switchInt(copy ((_1.0: (i32, i32)).0: i32)) -> [0: bb2, otherwise: bb1]; } bb1: { - switchInt(((_1.0: (i32, i32)).1: i32)) -> [1: bb4, otherwise: bb3]; + switchInt(copy ((_1.0: (i32, i32)).1: i32)) -> [1: bb4, otherwise: bb3]; } bb2: { - switchInt((_1.1: i32)) -> [2: bb5, 3: bb6, otherwise: bb3]; + switchInt(copy (_1.1: i32)) -> [2: bb5, 3: bb6, otherwise: bb3]; } bb3: { @@ -35,7 +35,7 @@ fn shortcut_second_or() -> () { } bb4: { - switchInt((_1.1: i32)) -> [2: bb7, 3: bb8, otherwise: bb3]; + switchInt(copy (_1.1: i32)) -> [2: bb7, 3: bb8, otherwise: bb3]; } bb5: { @@ -56,33 +56,33 @@ fn shortcut_second_or() -> () { bb9: { StorageLive(_3); - _3 = (_1.0: (i32, i32)); + _3 = copy (_1.0: (i32, i32)); StorageLive(_4); - _4 = (_1.1: i32); + _4 = copy (_1.1: i32); goto -> bb13; } bb10: { StorageLive(_3); - _3 = (_1.0: (i32, i32)); + _3 = copy (_1.0: (i32, i32)); StorageLive(_4); - _4 = (_1.1: i32); + _4 = copy (_1.1: i32); goto -> bb13; } bb11: { StorageLive(_3); - _3 = (_1.0: (i32, i32)); + _3 = copy (_1.0: (i32, i32)); StorageLive(_4); - _4 = (_1.1: i32); + _4 = copy (_1.1: i32); goto -> bb13; } bb12: { StorageLive(_3); - _3 = (_1.0: (i32, i32)); + _3 = copy (_1.0: (i32, i32)); StorageLive(_4); - _4 = (_1.1: i32); + _4 = copy (_1.1: i32); goto -> bb13; } diff --git a/tests/mir-opt/or_pattern.single_switchint.SimplifyCfg-initial.after.mir b/tests/mir-opt/or_pattern.single_switchint.SimplifyCfg-initial.after.mir index 8b0ef7b29d7be..889ff6f9f5e2b 100644 --- a/tests/mir-opt/or_pattern.single_switchint.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/or_pattern.single_switchint.SimplifyCfg-initial.after.mir @@ -10,15 +10,15 @@ fn single_switchint() -> () { StorageLive(_2); _2 = (const 1_i32, const true); PlaceMention(_2); - switchInt((_2.0: i32)) -> [1: bb2, 2: bb4, otherwise: bb1]; + switchInt(copy (_2.0: i32)) -> [1: bb2, 2: bb4, otherwise: bb1]; } bb1: { - switchInt((_2.0: i32)) -> [3: bb8, 4: bb8, otherwise: bb7]; + switchInt(copy (_2.0: i32)) -> [3: bb8, 4: bb8, otherwise: bb7]; } bb2: { - switchInt((_2.1: bool)) -> [0: bb6, otherwise: bb3]; + switchInt(copy (_2.1: bool)) -> [0: bb6, otherwise: bb3]; } bb3: { @@ -26,7 +26,7 @@ fn single_switchint() -> () { } bb4: { - switchInt((_2.1: bool)) -> [0: bb5, otherwise: bb6]; + switchInt(copy (_2.1: bool)) -> [0: bb5, otherwise: bb6]; } bb5: { diff --git a/tests/mir-opt/pre-codegen/chained_comparison.bitand.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/chained_comparison.bitand.PreCodegen.after.mir index 99ca659c637b1..9b77bdb7cf616 100644 --- a/tests/mir-opt/pre-codegen/chained_comparison.bitand.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/chained_comparison.bitand.PreCodegen.after.mir @@ -29,17 +29,17 @@ fn bitand(_1: &Blueprint, _2: &Blueprint) -> bool { StorageLive(_9); StorageLive(_5); StorageLive(_3); - _3 = ((*_1).0: u32); + _3 = copy ((*_1).0: u32); StorageLive(_4); - _4 = ((*_2).0: u32); + _4 = copy ((*_2).0: u32); _5 = Eq(move _3, move _4); StorageDead(_4); StorageDead(_3); StorageLive(_8); StorageLive(_6); - _6 = ((*_1).1: u32); + _6 = copy ((*_1).1: u32); StorageLive(_7); - _7 = ((*_2).1: u32); + _7 = copy ((*_2).1: u32); _8 = Eq(move _6, move _7); StorageDead(_7); StorageDead(_6); @@ -48,9 +48,9 @@ fn bitand(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_5); StorageLive(_12); StorageLive(_10); - _10 = ((*_1).2: u32); + _10 = copy ((*_1).2: u32); StorageLive(_11); - _11 = ((*_2).2: u32); + _11 = copy ((*_2).2: u32); _12 = Eq(move _10, move _11); StorageDead(_11); StorageDead(_10); @@ -59,9 +59,9 @@ fn bitand(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_9); StorageLive(_16); StorageLive(_14); - _14 = ((*_1).3: u32); + _14 = copy ((*_1).3: u32); StorageLive(_15); - _15 = ((*_2).3: u32); + _15 = copy ((*_2).3: u32); _16 = Eq(move _14, move _15); StorageDead(_15); StorageDead(_14); @@ -70,9 +70,9 @@ fn bitand(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_13); StorageLive(_20); StorageLive(_18); - _18 = ((*_1).4: u32); + _18 = copy ((*_1).4: u32); StorageLive(_19); - _19 = ((*_2).4: u32); + _19 = copy ((*_2).4: u32); _20 = Eq(move _18, move _19); StorageDead(_19); StorageDead(_18); diff --git a/tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir index 838e30fa35ebb..9b3e28ab5b8ea 100644 --- a/tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir @@ -22,9 +22,9 @@ fn naive(_1: &Blueprint, _2: &Blueprint) -> bool { bb0: { StorageLive(_5); StorageLive(_3); - _3 = ((*_1).0: u32); + _3 = copy ((*_1).0: u32); StorageLive(_4); - _4 = ((*_2).0: u32); + _4 = copy ((*_2).0: u32); _5 = Eq(move _3, move _4); switchInt(move _5) -> [0: bb1, otherwise: bb2]; } @@ -40,9 +40,9 @@ fn naive(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_3); StorageLive(_8); StorageLive(_6); - _6 = ((*_1).1: u32); + _6 = copy ((*_1).1: u32); StorageLive(_7); - _7 = ((*_2).1: u32); + _7 = copy ((*_2).1: u32); _8 = Eq(move _6, move _7); switchInt(move _8) -> [0: bb3, otherwise: bb4]; } @@ -58,9 +58,9 @@ fn naive(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_6); StorageLive(_11); StorageLive(_9); - _9 = ((*_1).2: u32); + _9 = copy ((*_1).2: u32); StorageLive(_10); - _10 = ((*_2).2: u32); + _10 = copy ((*_2).2: u32); _11 = Eq(move _9, move _10); switchInt(move _11) -> [0: bb5, otherwise: bb6]; } @@ -76,9 +76,9 @@ fn naive(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_9); StorageLive(_14); StorageLive(_12); - _12 = ((*_1).3: u32); + _12 = copy ((*_1).3: u32); StorageLive(_13); - _13 = ((*_2).3: u32); + _13 = copy ((*_2).3: u32); _14 = Eq(move _12, move _13); switchInt(move _14) -> [0: bb7, otherwise: bb9]; } @@ -98,9 +98,9 @@ fn naive(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_13); StorageDead(_12); StorageLive(_15); - _15 = ((*_1).4: u32); + _15 = copy ((*_1).4: u32); StorageLive(_16); - _16 = ((*_2).4: u32); + _16 = copy ((*_2).4: u32); _0 = Eq(move _15, move _16); StorageDead(_16); StorageDead(_15); diff --git a/tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir index 8452fa12f31de..72d52701d112d 100644 --- a/tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir @@ -23,9 +23,9 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool { bb0: { StorageLive(_5); StorageLive(_3); - _3 = ((*_1).0: u32); + _3 = copy ((*_1).0: u32); StorageLive(_4); - _4 = ((*_2).0: u32); + _4 = copy ((*_2).0: u32); _5 = Ne(move _3, move _4); switchInt(move _5) -> [0: bb1, otherwise: bb10]; } @@ -36,9 +36,9 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_5); StorageLive(_8); StorageLive(_6); - _6 = ((*_1).1: u32); + _6 = copy ((*_1).1: u32); StorageLive(_7); - _7 = ((*_2).1: u32); + _7 = copy ((*_2).1: u32); _8 = Ne(move _6, move _7); switchInt(move _8) -> [0: bb2, otherwise: bb9]; } @@ -49,9 +49,9 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_8); StorageLive(_11); StorageLive(_9); - _9 = ((*_1).2: u32); + _9 = copy ((*_1).2: u32); StorageLive(_10); - _10 = ((*_2).2: u32); + _10 = copy ((*_2).2: u32); _11 = Ne(move _9, move _10); switchInt(move _11) -> [0: bb3, otherwise: bb8]; } @@ -62,9 +62,9 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_11); StorageLive(_14); StorageLive(_12); - _12 = ((*_1).3: u32); + _12 = copy ((*_1).3: u32); StorageLive(_13); - _13 = ((*_2).3: u32); + _13 = copy ((*_2).3: u32); _14 = Ne(move _12, move _13); switchInt(move _14) -> [0: bb4, otherwise: bb7]; } @@ -75,9 +75,9 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_14); StorageLive(_17); StorageLive(_15); - _15 = ((*_1).4: u32); + _15 = copy ((*_1).4: u32); StorageLive(_16); - _16 = ((*_2).4: u32); + _16 = copy ((*_2).4: u32); _17 = Ne(move _15, move _16); switchInt(move _17) -> [0: bb5, otherwise: bb6]; } diff --git a/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-abort.mir index 4edf0d2c47c05..a9dd8886577dd 100644 --- a/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-abort.mir @@ -17,7 +17,7 @@ fn checked_shl(_1: u32, _2: u32) -> Option { bb0: { StorageLive(_3); - _3 = Lt(_2, const core::num::::BITS); + _3 = Lt(copy _2, const core::num::::BITS); switchInt(move _3) -> [0: bb1, otherwise: bb2]; } @@ -28,7 +28,7 @@ fn checked_shl(_1: u32, _2: u32) -> Option { bb2: { StorageLive(_4); - _4 = ShlUnchecked(_1, _2); + _4 = ShlUnchecked(copy _1, copy _2); _0 = Option::::Some(move _4); StorageDead(_4); goto -> bb3; diff --git a/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-unwind.mir index 4edf0d2c47c05..a9dd8886577dd 100644 --- a/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-unwind.mir @@ -17,7 +17,7 @@ fn checked_shl(_1: u32, _2: u32) -> Option { bb0: { StorageLive(_3); - _3 = Lt(_2, const core::num::::BITS); + _3 = Lt(copy _2, const core::num::::BITS); switchInt(move _3) -> [0: bb1, otherwise: bb2]; } @@ -28,7 +28,7 @@ fn checked_shl(_1: u32, _2: u32) -> Option { bb2: { StorageLive(_4); - _4 = ShlUnchecked(_1, _2); + _4 = ShlUnchecked(copy _1, copy _2); _0 = Option::::Some(move _4); StorageDead(_4); goto -> bb3; diff --git a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir index 69c11ebcacced..935e67fc3c0a9 100644 --- a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir @@ -32,18 +32,18 @@ fn step_forward(_1: u16, _2: usize) -> u16 { bb0: { StorageLive(_4); StorageLive(_3); - _3 = Gt(_2, const 65535_usize); + _3 = Gt(copy _2, const 65535_usize); switchInt(move _3) -> [0: bb1, otherwise: bb5]; } bb1: { - _4 = _2 as u16 (IntToInt); + _4 = copy _2 as u16 (IntToInt); StorageDead(_3); StorageLive(_7); StorageLive(_6); StorageLive(_5); - _5 = AddWithOverflow(_1, _4); - _6 = (_5.1: bool); + _5 = AddWithOverflow(copy _1, copy _4); + _6 = copy (_5.1: bool); _7 = unlikely(move _6) -> [return: bb2, unwind unreachable]; } @@ -76,8 +76,8 @@ fn step_forward(_1: u16, _2: usize) -> u16 { bb7: { StorageLive(_8); - _8 = _2 as u16 (IntToInt); - _0 = Add(_1, _8); + _8 = copy _2 as u16 (IntToInt); + _0 = Add(copy _1, copy _8); StorageDead(_8); StorageDead(_4); return; diff --git a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir index e6ea6c510019c..bf1ffd1ef328d 100644 --- a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir @@ -32,18 +32,18 @@ fn step_forward(_1: u16, _2: usize) -> u16 { bb0: { StorageLive(_4); StorageLive(_3); - _3 = Gt(_2, const 65535_usize); + _3 = Gt(copy _2, const 65535_usize); switchInt(move _3) -> [0: bb1, otherwise: bb5]; } bb1: { - _4 = _2 as u16 (IntToInt); + _4 = copy _2 as u16 (IntToInt); StorageDead(_3); StorageLive(_7); StorageLive(_6); StorageLive(_5); - _5 = AddWithOverflow(_1, _4); - _6 = (_5.1: bool); + _5 = AddWithOverflow(copy _1, copy _4); + _6 = copy (_5.1: bool); _7 = unlikely(move _6) -> [return: bb2, unwind unreachable]; } @@ -76,8 +76,8 @@ fn step_forward(_1: u16, _2: usize) -> u16 { bb7: { StorageLive(_8); - _8 = _2 as u16 (IntToInt); - _0 = Add(_1, _8); + _8 = copy _2 as u16 (IntToInt); + _0 = Add(copy _1, copy _8); StorageDead(_8); StorageDead(_4); return; diff --git a/tests/mir-opt/pre-codegen/derived_ord.{impl#0}-partial_cmp.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/derived_ord.{impl#0}-partial_cmp.PreCodegen.after.mir index 47f10451b057c..5f4ec1de2701f 100644 --- a/tests/mir-opt/pre-codegen/derived_ord.{impl#0}-partial_cmp.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/derived_ord.{impl#0}-partial_cmp.PreCodegen.after.mir @@ -22,13 +22,13 @@ fn ::partial_cmp(_1: &MultiField, _2: &M bb0: { StorageLive(_3); - _3 = ((*_1).0: char); + _3 = copy ((*_1).0: char); StorageLive(_4); - _4 = ((*_2).0: char); + _4 = copy ((*_2).0: char); _5 = Cmp(move _3, move _4); StorageDead(_4); StorageDead(_3); - _6 = Option::::Some(_5); + _6 = Option::::Some(copy _5); _7 = discriminant(_5); switchInt(move _7) -> [0: bb1, otherwise: bb2]; } @@ -36,9 +36,9 @@ fn ::partial_cmp(_1: &MultiField, _2: &M bb1: { StorageLive(_10); StorageLive(_8); - _8 = ((*_1).1: i16); + _8 = copy ((*_1).1: i16); StorageLive(_9); - _9 = ((*_2).1: i16); + _9 = copy ((*_2).1: i16); _10 = Cmp(move _8, move _9); StorageDead(_9); StorageDead(_8); @@ -48,7 +48,7 @@ fn ::partial_cmp(_1: &MultiField, _2: &M } bb2: { - _0 = _6; + _0 = copy _6; goto -> bb3; } diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff index 30c122ddea03b..6cac8b109eea6 100644 --- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff @@ -73,12 +73,12 @@ StorageLive(_6); StorageLive(_7); _9 = const main::promoted[0]; - _7 = _9; + _7 = copy _9; StorageLive(_8); -- _8 = _1; +- _8 = copy _1; - _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb4, unwind unreachable]; + _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}; -+ _6 = std::alloc::Global::alloc_impl(_9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb4, unwind unreachable]; ++ _6 = std::alloc::Global::alloc_impl(copy _9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb4, unwind unreachable]; } bb4: { @@ -93,7 +93,7 @@ bb5: { StorageLive(_15); _16 = &_13; - _15 = _16 as &dyn std::fmt::Debug (PointerCoercion(Unsize)); + _15 = copy _16 as &dyn std::fmt::Debug (PointerCoercion(Unsize)); _14 = result::unwrap_failed(const "called `Result::unwrap()` on an `Err` value", move _15) -> unwind unreachable; } @@ -104,14 +104,14 @@ StorageDead(_6); - StorageLive(_17); + nop; - _17 = (_5.0: *const [u8]); + _17 = copy (_5.0: *const [u8]); - _4 = move _17 as *mut [u8] (PtrToPtr); - StorageDead(_17); -+ _4 = _17 as *mut [u8] (PtrToPtr); ++ _4 = copy _17 as *mut [u8] (PtrToPtr); + nop; StorageDead(_5); - _3 = move _4 as *mut u8 (PtrToPtr); -+ _3 = _17 as *mut u8 (PtrToPtr); ++ _3 = copy _17 as *mut u8 (PtrToPtr); StorageDead(_4); StorageDead(_3); - StorageDead(_1); diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff index 93449462c3d08..5fcece2280d48 100644 --- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff @@ -47,14 +47,14 @@ StorageDead(_6); - StorageLive(_12); + nop; - _12 = (_5.0: *const [u8]); + _12 = copy (_5.0: *const [u8]); - _4 = move _12 as *mut [u8] (PtrToPtr); - StorageDead(_12); -+ _4 = _12 as *mut [u8] (PtrToPtr); ++ _4 = copy _12 as *mut [u8] (PtrToPtr); + nop; StorageDead(_5); - _3 = move _4 as *mut u8 (PtrToPtr); -+ _3 = _12 as *mut u8 (PtrToPtr); ++ _3 = copy _12 as *mut u8 (PtrToPtr); StorageDead(_4); StorageDead(_3); - StorageDead(_1); @@ -81,12 +81,12 @@ StorageLive(_6); StorageLive(_7); _9 = const main::promoted[0]; - _7 = _9; + _7 = copy _9; StorageLive(_8); -- _8 = _1; +- _8 = copy _1; - _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb5, unwind continue]; + _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}; -+ _6 = std::alloc::Global::alloc_impl(_9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb5, unwind continue]; ++ _6 = std::alloc::Global::alloc_impl(copy _9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb5, unwind continue]; } bb5: { diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff index 44435956ec418..10fde25e3178b 100644 --- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff @@ -73,12 +73,12 @@ StorageLive(_6); StorageLive(_7); _9 = const main::promoted[0]; - _7 = _9; + _7 = copy _9; StorageLive(_8); -- _8 = _1; +- _8 = copy _1; - _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb4, unwind unreachable]; + _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}; -+ _6 = std::alloc::Global::alloc_impl(_9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb4, unwind unreachable]; ++ _6 = std::alloc::Global::alloc_impl(copy _9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb4, unwind unreachable]; } bb4: { @@ -93,7 +93,7 @@ bb5: { StorageLive(_15); _16 = &_13; - _15 = _16 as &dyn std::fmt::Debug (PointerCoercion(Unsize)); + _15 = copy _16 as &dyn std::fmt::Debug (PointerCoercion(Unsize)); _14 = result::unwrap_failed(const "called `Result::unwrap()` on an `Err` value", move _15) -> unwind unreachable; } @@ -104,14 +104,14 @@ StorageDead(_6); - StorageLive(_17); + nop; - _17 = (_5.0: *const [u8]); + _17 = copy (_5.0: *const [u8]); - _4 = move _17 as *mut [u8] (PtrToPtr); - StorageDead(_17); -+ _4 = _17 as *mut [u8] (PtrToPtr); ++ _4 = copy _17 as *mut [u8] (PtrToPtr); + nop; StorageDead(_5); - _3 = move _4 as *mut u8 (PtrToPtr); -+ _3 = _17 as *mut u8 (PtrToPtr); ++ _3 = copy _17 as *mut u8 (PtrToPtr); StorageDead(_4); StorageDead(_3); - StorageDead(_1); 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 c958480a9c71b..0821ea272bf50 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 @@ -47,14 +47,14 @@ StorageDead(_6); - StorageLive(_12); + nop; - _12 = (_5.0: *const [u8]); + _12 = copy (_5.0: *const [u8]); - _4 = move _12 as *mut [u8] (PtrToPtr); - StorageDead(_12); -+ _4 = _12 as *mut [u8] (PtrToPtr); ++ _4 = copy _12 as *mut [u8] (PtrToPtr); + nop; StorageDead(_5); - _3 = move _4 as *mut u8 (PtrToPtr); -+ _3 = _12 as *mut u8 (PtrToPtr); ++ _3 = copy _12 as *mut u8 (PtrToPtr); StorageDead(_4); StorageDead(_3); - StorageDead(_1); @@ -81,12 +81,12 @@ StorageLive(_6); StorageLive(_7); _9 = const main::promoted[0]; - _7 = _9; + _7 = copy _9; StorageLive(_8); -- _8 = _1; +- _8 = copy _1; - _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb5, unwind continue]; + _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}; -+ _6 = std::alloc::Global::alloc_impl(_9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb5, unwind continue]; ++ _6 = std::alloc::Global::alloc_impl(copy _9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb5, unwind continue]; } bb5: { diff --git a/tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir index 8d182069adc99..75e8cb1d8618c 100644 --- a/tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir @@ -32,7 +32,7 @@ fn filter_mapped(_1: impl Iterator, _2: impl Fn(T) -> Option) -> () bb1: { StorageLive(_4); - _4 = _3; + _4 = copy _3; goto -> bb2; } diff --git a/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir index cdb7eea74fba0..be69bbf10e77f 100644 --- a/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir @@ -41,9 +41,9 @@ fn int_range(_1: usize, _2: usize) -> () { } bb0: { - _3 = std::ops::Range:: { start: _1, end: _2 }; + _3 = std::ops::Range:: { start: copy _1, end: copy _2 }; StorageLive(_4); - _4 = _3; + _4 = copy _3; goto -> bb1; } @@ -57,9 +57,9 @@ fn int_range(_1: usize, _2: usize) -> () { StorageLive(_7); _7 = &(_4.1: usize); StorageLive(_8); - _8 = (_4.0: usize); + _8 = copy (_4.0: usize); StorageLive(_9); - _9 = (_4.1: usize); + _9 = copy (_4.1: usize); _10 = Lt(move _8, move _9); StorageDead(_9); StorageDead(_8); @@ -79,18 +79,18 @@ fn int_range(_1: usize, _2: usize) -> () { bb3: { StorageDead(_7); StorageDead(_6); - _11 = (_4.0: usize); + _11 = copy (_4.0: usize); StorageLive(_12); - _12 = ::forward_unchecked(_11, const 1_usize) -> [return: bb4, unwind continue]; + _12 = ::forward_unchecked(copy _11, const 1_usize) -> [return: bb4, unwind continue]; } bb4: { (_4.0: usize) = move _12; StorageDead(_12); - _13 = Option::::Some(_11); + _13 = Option::::Some(copy _11); StorageDead(_10); StorageDead(_11); - _14 = ((_13 as Some).0: usize); + _14 = copy ((_13 as Some).0: usize); _15 = opaque::(move _14) -> [return: bb5, unwind continue]; } diff --git a/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir index 51d41e9ff051a..4977f39ccefe8 100644 --- a/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir @@ -43,7 +43,7 @@ fn mapped(_1: impl Iterator, _2: impl Fn(T) -> U) -> () { bb1: { StorageLive(_4); - _4 = _3; + _4 = copy _3; goto -> bb2; } @@ -84,7 +84,7 @@ fn mapped(_1: impl Iterator, _2: impl Fn(T) -> U) -> () { _10 = move ((_7 as Some).0: T); StorageLive(_12); StorageLive(_11); - _11 = (_10,); + _11 = (copy _10,); _12 = <&mut impl Fn(T) -> U as FnOnce<(T,)>>::call_once(move _8, move _11) -> [return: bb7, unwind: bb10]; } diff --git a/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.panic-abort.mir index 3ca24e152a4e0..c10f3c429627a 100644 --- a/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.panic-abort.mir @@ -9,8 +9,8 @@ fn manual_replace(_1: &mut u32, _2: u32) -> u32 { } bb0: { - _0 = (*_1); - (*_1) = _2; + _0 = copy (*_1); + (*_1) = copy _2; return; } } diff --git a/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.panic-unwind.mir index 3ca24e152a4e0..c10f3c429627a 100644 --- a/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.panic-unwind.mir @@ -9,8 +9,8 @@ fn manual_replace(_1: &mut u32, _2: u32) -> u32 { } bb0: { - _0 = (*_1); - (*_1) = _2; + _0 = copy (*_1); + (*_1) = copy _2; return; } } diff --git a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-abort.mir index a3dc54f73c8d0..ed494f6e74cf3 100644 --- a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-abort.mir @@ -14,8 +14,8 @@ fn mem_replace(_1: &mut u32, _2: u32) -> u32 { } bb0: { - _0 = (*_1); - (*_1) = _2; + _0 = copy (*_1); + (*_1) = copy _2; return; } } diff --git a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-unwind.mir index a3dc54f73c8d0..ed494f6e74cf3 100644 --- a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-unwind.mir @@ -14,8 +14,8 @@ fn mem_replace(_1: &mut u32, _2: u32) -> u32 { } bb0: { - _0 = (*_1); - (*_1) = _2; + _0 = copy (*_1); + (*_1) = copy _2; return; } } diff --git a/tests/mir-opt/pre-codegen/no_inlined_clone.{impl#0}-clone.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/no_inlined_clone.{impl#0}-clone.PreCodegen.after.mir index 71898daa1bfa2..62a9cd9131f0b 100644 --- a/tests/mir-opt/pre-codegen/no_inlined_clone.{impl#0}-clone.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/no_inlined_clone.{impl#0}-clone.PreCodegen.after.mir @@ -7,7 +7,7 @@ fn ::clone(_1: &Foo) -> Foo { bb0: { StorageLive(_2); - _2 = ((*_1).0: i32); + _2 = copy ((*_1).0: i32); _0 = Foo { a: move _2 }; StorageDead(_2); return; diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-abort.diff index 45b8d89c0f4fa..6575610727b99 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-abort.diff @@ -39,21 +39,21 @@ StorageLive(_5); _5 = const 3_usize; _6 = const 6_usize; -- _7 = Lt(_5, _6); -- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind unreachable]; +- _7 = Lt(copy _5, copy _6); +- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, copy _5) -> [success: bb2, unwind unreachable]; + _7 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 6_usize, const 3_usize) -> [success: bb2, unwind unreachable]; } bb2: { -- _3 = _4[_5]; +- _3 = copy _4[_5]; + _3 = const 3_i32; StorageDead(_5); StorageDead(_4); StorageLive(_8); StorageLive(_9); _9 = const 42_u32; -- _8 = _9; +- _8 = copy _9; + _8 = const 42_u32; StorageDead(_9); StorageDead(_8); diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-unwind.diff index e6ee1e6f9a348..1a4ed5767fece 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-unwind.diff @@ -39,21 +39,21 @@ StorageLive(_5); _5 = const 3_usize; _6 = const 6_usize; -- _7 = Lt(_5, _6); -- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind continue]; +- _7 = Lt(copy _5, copy _6); +- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, copy _5) -> [success: bb2, unwind continue]; + _7 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 6_usize, const 3_usize) -> [success: bb2, unwind continue]; } bb2: { -- _3 = _4[_5]; +- _3 = copy _4[_5]; + _3 = const 3_i32; StorageDead(_5); StorageDead(_4); StorageLive(_8); StorageLive(_9); _9 = const 42_u32; -- _8 = _9; +- _8 = copy _9; + _8 = const 42_u32; StorageDead(_9); StorageDead(_8); diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-abort.diff index 45b8d89c0f4fa..6575610727b99 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-abort.diff @@ -39,21 +39,21 @@ StorageLive(_5); _5 = const 3_usize; _6 = const 6_usize; -- _7 = Lt(_5, _6); -- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind unreachable]; +- _7 = Lt(copy _5, copy _6); +- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, copy _5) -> [success: bb2, unwind unreachable]; + _7 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 6_usize, const 3_usize) -> [success: bb2, unwind unreachable]; } bb2: { -- _3 = _4[_5]; +- _3 = copy _4[_5]; + _3 = const 3_i32; StorageDead(_5); StorageDead(_4); StorageLive(_8); StorageLive(_9); _9 = const 42_u32; -- _8 = _9; +- _8 = copy _9; + _8 = const 42_u32; StorageDead(_9); StorageDead(_8); diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-unwind.diff index e6ee1e6f9a348..1a4ed5767fece 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-unwind.diff @@ -39,21 +39,21 @@ StorageLive(_5); _5 = const 3_usize; _6 = const 6_usize; -- _7 = Lt(_5, _6); -- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind continue]; +- _7 = Lt(copy _5, copy _6); +- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, copy _5) -> [success: bb2, unwind continue]; + _7 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 6_usize, const 3_usize) -> [success: bb2, unwind continue]; } bb2: { -- _3 = _4[_5]; +- _3 = copy _4[_5]; + _3 = const 3_i32; StorageDead(_5); StorageDead(_4); StorageLive(_8); StorageLive(_9); _9 = const 42_u32; -- _8 = _9; +- _8 = copy _9; + _8 = const 42_u32; StorageDead(_9); StorageDead(_8); diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff index c01a12eaa4f2c..e2420a341e0ab 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff @@ -38,18 +38,18 @@ StorageLive(_5); _5 = const 3_usize; _6 = const 6_usize; - _7 = Lt(_5, _6); - assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind unreachable]; + _7 = Lt(copy _5, copy _6); + assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, copy _5) -> [success: bb2, unwind unreachable]; } bb2: { - _3 = _4[_5]; + _3 = copy _4[_5]; StorageDead(_5); StorageDead(_4); StorageLive(_8); - StorageLive(_9); - _9 = Point { x: const 12_u32, y: const 42_u32 }; -- _8 = (_9.1: u32); +- _8 = copy (_9.1: u32); - StorageDead(_9); + StorageLive(_10); + StorageLive(_11); @@ -57,7 +57,7 @@ + _10 = const 12_u32; + _11 = const 42_u32; + nop; -+ _8 = _11; ++ _8 = copy _11; + StorageDead(_10); + StorageDead(_11); + nop; diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff index 64028e4437be3..a2fb3b979e622 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff @@ -38,18 +38,18 @@ StorageLive(_5); _5 = const 3_usize; _6 = const 6_usize; - _7 = Lt(_5, _6); - assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind continue]; + _7 = Lt(copy _5, copy _6); + assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, copy _5) -> [success: bb2, unwind continue]; } bb2: { - _3 = _4[_5]; + _3 = copy _4[_5]; StorageDead(_5); StorageDead(_4); StorageLive(_8); - StorageLive(_9); - _9 = Point { x: const 12_u32, y: const 42_u32 }; -- _8 = (_9.1: u32); +- _8 = copy (_9.1: u32); - StorageDead(_9); + StorageLive(_10); + StorageLive(_11); @@ -57,7 +57,7 @@ + _10 = const 12_u32; + _11 = const 42_u32; + nop; -+ _8 = _11; ++ _8 = copy _11; + StorageDead(_10); + StorageDead(_11); + nop; diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff index c01a12eaa4f2c..e2420a341e0ab 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff @@ -38,18 +38,18 @@ StorageLive(_5); _5 = const 3_usize; _6 = const 6_usize; - _7 = Lt(_5, _6); - assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind unreachable]; + _7 = Lt(copy _5, copy _6); + assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, copy _5) -> [success: bb2, unwind unreachable]; } bb2: { - _3 = _4[_5]; + _3 = copy _4[_5]; StorageDead(_5); StorageDead(_4); StorageLive(_8); - StorageLive(_9); - _9 = Point { x: const 12_u32, y: const 42_u32 }; -- _8 = (_9.1: u32); +- _8 = copy (_9.1: u32); - StorageDead(_9); + StorageLive(_10); + StorageLive(_11); @@ -57,7 +57,7 @@ + _10 = const 12_u32; + _11 = const 42_u32; + nop; -+ _8 = _11; ++ _8 = copy _11; + StorageDead(_10); + StorageDead(_11); + nop; diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff index 64028e4437be3..a2fb3b979e622 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff @@ -38,18 +38,18 @@ StorageLive(_5); _5 = const 3_usize; _6 = const 6_usize; - _7 = Lt(_5, _6); - assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind continue]; + _7 = Lt(copy _5, copy _6); + assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, copy _5) -> [success: bb2, unwind continue]; } bb2: { - _3 = _4[_5]; + _3 = copy _4[_5]; StorageDead(_5); StorageDead(_4); StorageLive(_8); - StorageLive(_9); - _9 = Point { x: const 12_u32, y: const 42_u32 }; -- _8 = (_9.1: u32); +- _8 = copy (_9.1: u32); - StorageDead(_9); + StorageLive(_10); + StorageLive(_11); @@ -57,7 +57,7 @@ + _10 = const 12_u32; + _11 = const 42_u32; + nop; -+ _8 = _11; ++ _8 = copy _11; + StorageDead(_10); + StorageDead(_11); + nop; diff --git a/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_fat.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_fat.PreCodegen.after.panic-abort.mir index 2f6139712ffc1..5faa1e210cf4f 100644 --- a/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_fat.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_fat.PreCodegen.after.panic-abort.mir @@ -23,12 +23,12 @@ fn demo_byte_add_fat(_1: *const [u32], _2: usize) -> *const [u32] { bb0: { StorageLive(_4); StorageLive(_3); - _3 = _1 as *const u8 (PtrToPtr); - _4 = Offset(_3, _2); + _3 = copy _1 as *const u8 (PtrToPtr); + _4 = Offset(copy _3, copy _2); StorageDead(_3); StorageLive(_5); - _5 = PtrMetadata(_1); - _0 = *const [u32] from (_4, _5); + _5 = PtrMetadata(copy _1); + _0 = *const [u32] from (copy _4, copy _5); StorageDead(_5); StorageDead(_4); return; diff --git a/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_fat.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_fat.PreCodegen.after.panic-unwind.mir index 2f6139712ffc1..5faa1e210cf4f 100644 --- a/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_fat.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_fat.PreCodegen.after.panic-unwind.mir @@ -23,12 +23,12 @@ fn demo_byte_add_fat(_1: *const [u32], _2: usize) -> *const [u32] { bb0: { StorageLive(_4); StorageLive(_3); - _3 = _1 as *const u8 (PtrToPtr); - _4 = Offset(_3, _2); + _3 = copy _1 as *const u8 (PtrToPtr); + _4 = Offset(copy _3, copy _2); StorageDead(_3); StorageLive(_5); - _5 = PtrMetadata(_1); - _0 = *const [u32] from (_4, _5); + _5 = PtrMetadata(copy _1); + _0 = *const [u32] from (copy _4, copy _5); StorageDead(_5); StorageDead(_4); return; diff --git a/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_thin.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_thin.PreCodegen.after.panic-abort.mir index 8d47e63eff2ac..9429785045a29 100644 --- a/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_thin.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_thin.PreCodegen.after.panic-abort.mir @@ -22,10 +22,10 @@ fn demo_byte_add_thin(_1: *const u32, _2: usize) -> *const u32 { bb0: { StorageLive(_4); StorageLive(_3); - _3 = _1 as *const u8 (PtrToPtr); - _4 = Offset(_3, _2); + _3 = copy _1 as *const u8 (PtrToPtr); + _4 = Offset(copy _3, copy _2); StorageDead(_3); - _0 = _4 as *const u32 (PtrToPtr); + _0 = copy _4 as *const u32 (PtrToPtr); StorageDead(_4); return; } diff --git a/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_thin.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_thin.PreCodegen.after.panic-unwind.mir index 8d47e63eff2ac..9429785045a29 100644 --- a/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_thin.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_thin.PreCodegen.after.panic-unwind.mir @@ -22,10 +22,10 @@ fn demo_byte_add_thin(_1: *const u32, _2: usize) -> *const u32 { bb0: { StorageLive(_4); StorageLive(_3); - _3 = _1 as *const u8 (PtrToPtr); - _4 = Offset(_3, _2); + _3 = copy _1 as *const u8 (PtrToPtr); + _4 = Offset(copy _3, copy _2); StorageDead(_3); - _0 = _4 as *const u32 (PtrToPtr); + _0 = copy _4 as *const u32 (PtrToPtr); StorageDead(_4); return; } diff --git a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir index 96b4962854de9..5d33c33d73fe9 100644 --- a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir @@ -35,7 +35,7 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { bb0: { StorageLive(_4); - _4 = _1; + _4 = copy _1; goto -> bb1; } @@ -44,8 +44,8 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { StorageLive(_7); StorageLive(_6); StorageLive(_5); - _5 = _4; - _6 = Lt(move _5, _2); + _5 = copy _4; + _6 = Lt(move _5, copy _2); StorageDead(_5); switchInt(move _6) -> [0: bb2, otherwise: bb4]; } @@ -63,22 +63,22 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { } bb4: { - _7 = _4; + _7 = copy _4; StorageLive(_8); - _8 = ::forward_unchecked(_7, const 1_usize) -> [return: bb5, unwind unreachable]; + _8 = ::forward_unchecked(copy _7, const 1_usize) -> [return: bb5, unwind unreachable]; } bb5: { _4 = move _8; StorageDead(_8); - _9 = Option::::Some(_7); + _9 = Option::::Some(copy _7); StorageDead(_6); StorageDead(_7); - _10 = ((_9 as Some).0: u32); + _10 = copy ((_9 as Some).0: u32); StorageLive(_11); _11 = &_3; StorageLive(_12); - _12 = (_10,); + _12 = (copy _10,); _13 = >::call(move _11, move _12) -> [return: bb6, unwind unreachable]; } diff --git a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir index ce8e2bd083ed4..ded30a1552035 100644 --- a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir @@ -35,7 +35,7 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { bb0: { StorageLive(_4); - _4 = _1; + _4 = copy _1; goto -> bb1; } @@ -44,8 +44,8 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { StorageLive(_7); StorageLive(_6); StorageLive(_5); - _5 = _4; - _6 = Lt(move _5, _2); + _5 = copy _4; + _6 = Lt(move _5, copy _2); StorageDead(_5); switchInt(move _6) -> [0: bb2, otherwise: bb4]; } @@ -63,22 +63,22 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { } bb4: { - _7 = _4; + _7 = copy _4; StorageLive(_8); - _8 = ::forward_unchecked(_7, const 1_usize) -> [return: bb5, unwind: bb7]; + _8 = ::forward_unchecked(copy _7, const 1_usize) -> [return: bb5, unwind: bb7]; } bb5: { _4 = move _8; StorageDead(_8); - _9 = Option::::Some(_7); + _9 = Option::::Some(copy _7); StorageDead(_6); StorageDead(_7); - _10 = ((_9 as Some).0: u32); + _10 = copy ((_9 as Some).0: u32); StorageLive(_11); _11 = &_3; StorageLive(_12); - _12 = (_10,); + _12 = (copy _10,); _13 = >::call(move _11, move _12) -> [return: bb6, unwind: bb7]; } diff --git a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir index a7fe52d8390e9..60c0b8afa5343 100644 --- a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir @@ -28,9 +28,9 @@ fn inclusive_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { } bb0: { - _4 = RangeInclusive:: { start: _1, end: _2, exhausted: const false }; + _4 = RangeInclusive:: { start: copy _1, end: copy _2, exhausted: const false }; StorageLive(_5); - _5 = _4; + _5 = copy _4; goto -> bb1; } @@ -56,11 +56,11 @@ fn inclusive_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { } bb5: { - _9 = ((_7 as Some).0: u32); + _9 = copy ((_7 as Some).0: u32); StorageLive(_10); _10 = &_3; StorageLive(_11); - _11 = (_9,); + _11 = (copy _9,); _12 = >::call(move _10, move _11) -> [return: bb6, unwind unreachable]; } diff --git a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir index 3e2bbcd3c916f..7145da58ce18c 100644 --- a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir @@ -28,9 +28,9 @@ fn inclusive_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { } bb0: { - _4 = RangeInclusive:: { start: _1, end: _2, exhausted: const false }; + _4 = RangeInclusive:: { start: copy _1, end: copy _2, exhausted: const false }; StorageLive(_5); - _5 = _4; + _5 = copy _4; goto -> bb1; } @@ -56,11 +56,11 @@ fn inclusive_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { } bb5: { - _9 = ((_7 as Some).0: u32); + _9 = copy ((_7 as Some).0: u32); StorageLive(_10); _10 = &_3; StorageLive(_11); - _11 = (_9,); + _11 = (copy _9,); _12 = >::call(move _10, move _11) -> [return: bb6, unwind: bb8]; } diff --git a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir index 2ac7e880ccb58..2621ec6753187 100644 --- a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir @@ -21,9 +21,9 @@ fn range_iter_next(_1: &mut std::ops::Range) -> Option { StorageLive(_5); StorageLive(_4); StorageLive(_2); - _2 = ((*_1).0: u32); + _2 = copy ((*_1).0: u32); StorageLive(_3); - _3 = ((*_1).1: u32); + _3 = copy ((*_1).1: u32); _4 = Lt(move _2, move _3); StorageDead(_3); StorageDead(_2); @@ -36,15 +36,15 @@ fn range_iter_next(_1: &mut std::ops::Range) -> Option { } bb2: { - _5 = ((*_1).0: u32); + _5 = copy ((*_1).0: u32); StorageLive(_6); - _6 = ::forward_unchecked(_5, const 1_usize) -> [return: bb3, unwind unreachable]; + _6 = ::forward_unchecked(copy _5, const 1_usize) -> [return: bb3, unwind unreachable]; } bb3: { ((*_1).0: u32) = move _6; StorageDead(_6); - _0 = Option::::Some(_5); + _0 = Option::::Some(copy _5); goto -> bb4; } diff --git a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir index 60bf644fce6be..338fb4b952329 100644 --- a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir @@ -21,9 +21,9 @@ fn range_iter_next(_1: &mut std::ops::Range) -> Option { StorageLive(_5); StorageLive(_4); StorageLive(_2); - _2 = ((*_1).0: u32); + _2 = copy ((*_1).0: u32); StorageLive(_3); - _3 = ((*_1).1: u32); + _3 = copy ((*_1).1: u32); _4 = Lt(move _2, move _3); StorageDead(_3); StorageDead(_2); @@ -36,15 +36,15 @@ fn range_iter_next(_1: &mut std::ops::Range) -> Option { } bb2: { - _5 = ((*_1).0: u32); + _5 = copy ((*_1).0: u32); StorageLive(_6); - _6 = ::forward_unchecked(_5, const 1_usize) -> [return: bb3, unwind continue]; + _6 = ::forward_unchecked(copy _5, const 1_usize) -> [return: bb3, unwind continue]; } bb3: { ((*_1).0: u32) = move _6; StorageDead(_6); - _0 = Option::::Some(_5); + _0 = Option::::Some(copy _5); goto -> bb4; } diff --git a/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir index 030f9c3b93e0c..cbfc58194cc1f 100644 --- a/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir @@ -25,9 +25,9 @@ fn ezmap(_1: Option) -> Option { } bb2: { - _3 = ((_1 as Some).0: i32); + _3 = copy ((_1 as Some).0: i32); StorageLive(_4); - _4 = Add(_3, const 1_i32); + _4 = Add(copy _3, const 1_i32); _0 = Option::::Some(move _4); StorageDead(_4); goto -> bb3; diff --git a/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir index e382f744723eb..cbdd194afd3ab 100644 --- a/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir @@ -68,7 +68,7 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2 } bb0: { - _3 = (*_2); + _3 = copy (*_2); _4 = &((*_3).0: usize); _5 = &((*_3).1: usize); _6 = &((*_3).2: usize); @@ -78,11 +78,11 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2 _8 = &_4; StorageLive(_10); StorageLive(_9); - _9 = _6; + _9 = copy _6; _10 = &_9; - _11 = ((*_3).0: usize); - _12 = ((*_3).2: usize); - _13 = Le(_11, _12); + _11 = copy ((*_3).0: usize); + _12 = copy ((*_3).2: usize); + _13 = Le(copy _11, copy _12); switchInt(move _13) -> [0: bb1, otherwise: bb2]; } @@ -102,12 +102,12 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2 _14 = &_7; StorageLive(_16); StorageLive(_15); - _15 = _5; + _15 = copy _5; _16 = &_15; StorageLive(_17); - _17 = ((*_3).3: usize); + _17 = copy ((*_3).3: usize); StorageLive(_18); - _18 = ((*_3).1: usize); + _18 = copy ((*_3).1: usize); _19 = Le(move _17, move _18); StorageDead(_18); StorageDead(_17); @@ -127,9 +127,9 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2 _20 = &_6; StorageLive(_22); StorageLive(_21); - _21 = _4; + _21 = copy _4; _22 = &_21; - _23 = Le(_12, _11); + _23 = Le(copy _12, copy _11); switchInt(move _23) -> [0: bb5, otherwise: bb6]; } @@ -149,12 +149,12 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2 _24 = &_5; StorageLive(_26); StorageLive(_25); - _25 = _7; + _25 = copy _7; _26 = &_25; StorageLive(_27); - _27 = ((*_3).1: usize); + _27 = copy ((*_3).1: usize); StorageLive(_28); - _28 = ((*_3).3: usize); + _28 = copy ((*_3).3: usize); _0 = Le(move _27, move _28); StorageDead(_28); StorageDead(_27); diff --git a/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir index d9e118d879a6a..bc7a31d52199b 100644 --- a/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir @@ -18,25 +18,25 @@ fn variant_b::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:11:25: 11:41}, } bb0: { - _3 = (*_2); - _4 = ((*_3).0: usize); - _5 = ((*_3).1: usize); - _6 = ((*_3).2: usize); - _7 = ((*_3).3: usize); + _3 = copy (*_2); + _4 = copy ((*_3).0: usize); + _5 = copy ((*_3).1: usize); + _6 = copy ((*_3).2: usize); + _7 = copy ((*_3).3: usize); StorageLive(_8); - _8 = Le(_4, _6); + _8 = Le(copy _4, copy _6); switchInt(move _8) -> [0: bb2, otherwise: bb1]; } bb1: { StorageLive(_9); - _9 = Le(_7, _5); + _9 = Le(copy _7, copy _5); switchInt(move _9) -> [0: bb2, otherwise: bb6]; } bb2: { StorageLive(_10); - _10 = Le(_6, _4); + _10 = Le(copy _6, copy _4); switchInt(move _10) -> [0: bb3, otherwise: bb4]; } @@ -46,7 +46,7 @@ fn variant_b::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:11:25: 11:41}, } bb4: { - _0 = Le(_5, _7); + _0 = Le(copy _5, copy _7); goto -> bb5; } diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir index 58e9b45a4a0f1..ec67193bc7948 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir @@ -23,8 +23,8 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> { StorageLive(_8); StorageLive(_4); StorageLive(_3); - _3 = PtrMetadata(_1); - _4 = Lt(_2, move _3); + _3 = PtrMetadata(copy _1); + _4 = Lt(copy _2, move _3); switchInt(move _4) -> [0: bb1, otherwise: bb2]; } @@ -40,12 +40,12 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> { StorageLive(_5); _5 = &raw mut (*_1); StorageLive(_6); - _6 = _5 as *mut u32 (PtrToPtr); - _7 = Offset(_6, _2); + _6 = copy _5 as *mut u32 (PtrToPtr); + _7 = Offset(copy _6, copy _2); StorageDead(_6); StorageDead(_5); _8 = &mut (*_7); - _0 = Option::<&mut u32>::Some(_8); + _0 = Option::<&mut u32>::Some(copy _8); StorageDead(_7); goto -> bb3; } 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 58e9b45a4a0f1..ec67193bc7948 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 @@ -23,8 +23,8 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> { StorageLive(_8); StorageLive(_4); StorageLive(_3); - _3 = PtrMetadata(_1); - _4 = Lt(_2, move _3); + _3 = PtrMetadata(copy _1); + _4 = Lt(copy _2, move _3); switchInt(move _4) -> [0: bb1, otherwise: bb2]; } @@ -40,12 +40,12 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> { StorageLive(_5); _5 = &raw mut (*_1); StorageLive(_6); - _6 = _5 as *mut u32 (PtrToPtr); - _7 = Offset(_6, _2); + _6 = copy _5 as *mut u32 (PtrToPtr); + _7 = Offset(copy _6, copy _2); StorageDead(_6); StorageDead(_5); _8 = &mut (*_7); - _0 = Option::<&mut u32>::Some(_8); + _0 = Option::<&mut u32>::Some(copy _8); StorageDead(_7); goto -> bb3; } diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir index ee80726a675c8..220e881f86645 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir @@ -40,19 +40,19 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range) -> _5 = &raw mut (*_1); StorageLive(_8); StorageLive(_6); - _6 = PtrMetadata(_1); - _7 = as SliceIndex<[T]>>::get_unchecked_mut::precondition_check(_3, _4, move _6) -> [return: bb1, unwind unreachable]; + _6 = PtrMetadata(copy _1); + _7 = as SliceIndex<[T]>>::get_unchecked_mut::precondition_check(copy _3, copy _4, move _6) -> [return: bb1, unwind unreachable]; } bb1: { StorageDead(_6); - _8 = SubUnchecked(_4, _3); + _8 = SubUnchecked(copy _4, copy _3); StorageLive(_10); StorageLive(_9); - _9 = _5 as *mut u32 (PtrToPtr); - _10 = Offset(_9, _3); + _9 = copy _5 as *mut u32 (PtrToPtr); + _10 = Offset(copy _9, copy _3); StorageDead(_9); - _11 = *mut [u32] from (_10, _8); + _11 = *mut [u32] from (copy _10, copy _8); StorageDead(_10); StorageDead(_8); StorageDead(_5); diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir index ee80726a675c8..220e881f86645 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir @@ -40,19 +40,19 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range) -> _5 = &raw mut (*_1); StorageLive(_8); StorageLive(_6); - _6 = PtrMetadata(_1); - _7 = as SliceIndex<[T]>>::get_unchecked_mut::precondition_check(_3, _4, move _6) -> [return: bb1, unwind unreachable]; + _6 = PtrMetadata(copy _1); + _7 = as SliceIndex<[T]>>::get_unchecked_mut::precondition_check(copy _3, copy _4, move _6) -> [return: bb1, unwind unreachable]; } bb1: { StorageDead(_6); - _8 = SubUnchecked(_4, _3); + _8 = SubUnchecked(copy _4, copy _3); StorageLive(_10); StorageLive(_9); - _9 = _5 as *mut u32 (PtrToPtr); - _10 = Offset(_9, _3); + _9 = copy _5 as *mut u32 (PtrToPtr); + _10 = Offset(copy _9, copy _3); StorageDead(_9); - _11 = *mut [u32] from (_10, _8); + _11 = *mut [u32] from (copy _10, copy _8); StorageDead(_10); StorageDead(_8); StorageDead(_5); diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-abort.mir index 210f9d6a12403..cc1034229fc39 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-abort.mir @@ -9,12 +9,12 @@ fn slice_index_usize(_1: &[u32], _2: usize) -> u32 { bb0: { _3 = Len((*_1)); - _4 = Lt(_2, _3); - assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, _2) -> [success: bb1, unwind unreachable]; + _4 = Lt(copy _2, copy _3); + assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, copy _2) -> [success: bb1, unwind unreachable]; } bb1: { - _0 = (*_1)[_2]; + _0 = copy (*_1)[_2]; return; } } diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-unwind.mir index d576520a8d56b..358226fb5294d 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-unwind.mir @@ -9,12 +9,12 @@ fn slice_index_usize(_1: &[u32], _2: usize) -> u32 { bb0: { _3 = Len((*_1)); - _4 = Lt(_2, _3); - assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, _2) -> [success: bb1, unwind continue]; + _4 = Lt(copy _2, copy _3); + assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, copy _2) -> [success: bb1, unwind continue]; } bb1: { - _0 = (*_1)[_2]; + _0 = copy (*_1)[_2]; return; } } diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_ptr_get_unchecked_range.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_ptr_get_unchecked_range.PreCodegen.after.panic-abort.mir index c61bebe6cc3c0..1e0df94b67fb1 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_ptr_get_unchecked_range.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_ptr_get_unchecked_range.PreCodegen.after.panic-abort.mir @@ -35,19 +35,19 @@ fn slice_ptr_get_unchecked_range(_1: *const [u32], _2: std::ops::Range) - _4 = move (_2.1: usize); StorageLive(_7); StorageLive(_5); - _5 = PtrMetadata(_1); - _6 = as SliceIndex<[T]>>::get_unchecked::precondition_check(_3, _4, move _5) -> [return: bb1, unwind unreachable]; + _5 = PtrMetadata(copy _1); + _6 = as SliceIndex<[T]>>::get_unchecked::precondition_check(copy _3, copy _4, move _5) -> [return: bb1, unwind unreachable]; } bb1: { StorageDead(_5); - _7 = SubUnchecked(_4, _3); + _7 = SubUnchecked(copy _4, copy _3); StorageLive(_9); StorageLive(_8); - _8 = _1 as *const u32 (PtrToPtr); - _9 = Offset(_8, _3); + _8 = copy _1 as *const u32 (PtrToPtr); + _9 = Offset(copy _8, copy _3); StorageDead(_8); - _0 = *const [u32] from (_9, _7); + _0 = *const [u32] from (copy _9, copy _7); StorageDead(_9); StorageDead(_7); return; diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_ptr_get_unchecked_range.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_ptr_get_unchecked_range.PreCodegen.after.panic-unwind.mir index c61bebe6cc3c0..1e0df94b67fb1 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_ptr_get_unchecked_range.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_ptr_get_unchecked_range.PreCodegen.after.panic-unwind.mir @@ -35,19 +35,19 @@ fn slice_ptr_get_unchecked_range(_1: *const [u32], _2: std::ops::Range) - _4 = move (_2.1: usize); StorageLive(_7); StorageLive(_5); - _5 = PtrMetadata(_1); - _6 = as SliceIndex<[T]>>::get_unchecked::precondition_check(_3, _4, move _5) -> [return: bb1, unwind unreachable]; + _5 = PtrMetadata(copy _1); + _6 = as SliceIndex<[T]>>::get_unchecked::precondition_check(copy _3, copy _4, move _5) -> [return: bb1, unwind unreachable]; } bb1: { StorageDead(_5); - _7 = SubUnchecked(_4, _3); + _7 = SubUnchecked(copy _4, copy _3); StorageLive(_9); StorageLive(_8); - _8 = _1 as *const u32 (PtrToPtr); - _9 = Offset(_8, _3); + _8 = copy _1 as *const u32 (PtrToPtr); + _9 = Offset(copy _8, copy _3); StorageDead(_8); - _0 = *const [u32] from (_9, _7); + _0 = *const [u32] from (copy _9, copy _7); StorageDead(_9); StorageDead(_7); return; diff --git a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir index 953e7550479da..3aa483ed1aefa 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir @@ -31,7 +31,7 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } scope 19 { scope 20 { - scope 26 (inlined as FromResidual>::from_residual) { + scope 26 (inlined as FromResidual>>::from_residual) { } } } @@ -90,10 +90,10 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { StorageLive(_6); StorageLive(_4); StorageLive(_5); - _3 = PtrMetadata(_1); + _3 = PtrMetadata(copy _1); _4 = &raw const (*_1); - _5 = _4 as *const T (PtrToPtr); - _6 = NonNull:: { pointer: _5 }; + _5 = copy _4 as *const T (PtrToPtr); + _6 = NonNull:: { pointer: copy _5 }; StorageLive(_9); switchInt(const ::IS_ZST) -> [0: bb1, otherwise: bb2]; } @@ -101,8 +101,8 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { bb1: { StorageLive(_8); StorageLive(_7); - _7 = _4 as *mut T (PtrToPtr); - _8 = Offset(_7, _3); + _7 = copy _4 as *mut T (PtrToPtr); + _8 = Offset(copy _7, copy _3); StorageDead(_7); _9 = move _8 as *const T (PtrToPtr); StorageDead(_8); @@ -110,24 +110,24 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb2: { - _9 = _3 as *const T (Transmute); + _9 = copy _3 as *const T (Transmute); goto -> bb3; } bb3: { StorageLive(_10); - _10 = _9; - _11 = std::slice::Iter::<'_, T> { ptr: _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; + _10 = copy _9; + _11 = std::slice::Iter::<'_, T> { ptr: copy _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; StorageDead(_10); StorageDead(_9); StorageDead(_5); StorageDead(_4); StorageDead(_6); StorageDead(_3); - _12 = Enumerate::> { iter: _11, count: const 0_usize }; + _12 = Enumerate::> { iter: copy _11, count: const 0_usize }; StorageDead(_11); StorageLive(_13); - _13 = _12; + _13 = copy _12; goto -> bb4; } @@ -166,25 +166,25 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { _17 = move ((_15 as Some).0: &T); StorageDead(_16); StorageDead(_15); - _18 = (_13.1: usize); - _19 = AddWithOverflow((_13.1: usize), const 1_usize); - assert(!move (_19.1: bool), "attempt to compute `{} + {}`, which would overflow", (_13.1: usize), const 1_usize) -> [success: bb9, unwind unreachable]; + _18 = copy (_13.1: usize); + _19 = AddWithOverflow(copy (_13.1: usize), const 1_usize); + assert(!move (_19.1: bool), "attempt to compute `{} + {}`, which would overflow", copy (_13.1: usize), const 1_usize) -> [success: bb9, unwind unreachable]; } bb9: { (_13.1: usize) = move (_19.0: usize); StorageLive(_20); - _20 = (_18, _17); + _20 = (copy _18, copy _17); _21 = Option::<(usize, &T)>::Some(move _20); StorageDead(_20); StorageDead(_19); StorageDead(_18); - _22 = (((_21 as Some).0: (usize, &T)).0: usize); - _23 = (((_21 as Some).0: (usize, &T)).1: &T); + _22 = copy (((_21 as Some).0: (usize, &T)).0: usize); + _23 = copy (((_21 as Some).0: (usize, &T)).1: &T); StorageLive(_24); _24 = &_2; StorageLive(_25); - _25 = (_22, _23); + _25 = (copy _22, copy _23); _26 = >::call(move _24, move _25) -> [return: bb10, unwind unreachable]; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir index 4c766c6497a2e..4cc0aa0ed788d 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir @@ -65,10 +65,10 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { StorageLive(_6); StorageLive(_4); StorageLive(_5); - _3 = PtrMetadata(_1); + _3 = PtrMetadata(copy _1); _4 = &raw const (*_1); - _5 = _4 as *const T (PtrToPtr); - _6 = NonNull:: { pointer: _5 }; + _5 = copy _4 as *const T (PtrToPtr); + _6 = NonNull:: { pointer: copy _5 }; StorageLive(_9); switchInt(const ::IS_ZST) -> [0: bb1, otherwise: bb2]; } @@ -76,8 +76,8 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { bb1: { StorageLive(_8); StorageLive(_7); - _7 = _4 as *mut T (PtrToPtr); - _8 = Offset(_7, _3); + _7 = copy _4 as *mut T (PtrToPtr); + _8 = Offset(copy _7, copy _3); StorageDead(_7); _9 = move _8 as *const T (PtrToPtr); StorageDead(_8); @@ -85,24 +85,24 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb2: { - _9 = _3 as *const T (Transmute); + _9 = copy _3 as *const T (Transmute); goto -> bb3; } bb3: { StorageLive(_10); - _10 = _9; - _11 = std::slice::Iter::<'_, T> { ptr: _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; + _10 = copy _9; + _11 = std::slice::Iter::<'_, T> { ptr: copy _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; StorageDead(_10); StorageDead(_9); StorageDead(_5); StorageDead(_4); StorageDead(_6); StorageDead(_3); - _12 = Enumerate::> { iter: _11, count: const 0_usize }; + _12 = Enumerate::> { iter: copy _11, count: const 0_usize }; StorageDead(_11); StorageLive(_13); - _13 = _12; + _13 = copy _12; goto -> bb4; } @@ -128,12 +128,12 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb8: { - _17 = (((_15 as Some).0: (usize, &T)).0: usize); - _18 = (((_15 as Some).0: (usize, &T)).1: &T); + _17 = copy (((_15 as Some).0: (usize, &T)).0: usize); + _18 = copy (((_15 as Some).0: (usize, &T)).1: &T); StorageLive(_19); _19 = &_2; StorageLive(_20); - _20 = (_17, _18); + _20 = (copy _17, copy _18); _21 = >::call(move _19, move _20) -> [return: bb9, unwind: bb11]; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir index 03de9fd938ec4..507afa63c6884 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir @@ -57,10 +57,10 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { StorageLive(_6); StorageLive(_4); StorageLive(_5); - _3 = PtrMetadata(_1); + _3 = PtrMetadata(copy _1); _4 = &raw const (*_1); - _5 = _4 as *const T (PtrToPtr); - _6 = NonNull:: { pointer: _5 }; + _5 = copy _4 as *const T (PtrToPtr); + _6 = NonNull:: { pointer: copy _5 }; StorageLive(_9); switchInt(const ::IS_ZST) -> [0: bb1, otherwise: bb2]; } @@ -68,8 +68,8 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { bb1: { StorageLive(_8); StorageLive(_7); - _7 = _4 as *mut T (PtrToPtr); - _8 = Offset(_7, _3); + _7 = copy _4 as *mut T (PtrToPtr); + _8 = Offset(copy _7, copy _3); StorageDead(_7); _9 = move _8 as *const T (PtrToPtr); StorageDead(_8); @@ -77,14 +77,14 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb2: { - _9 = _3 as *const T (Transmute); + _9 = copy _3 as *const T (Transmute); goto -> bb3; } bb3: { StorageLive(_10); - _10 = _9; - _11 = std::slice::Iter::<'_, T> { ptr: _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; + _10 = copy _9; + _11 = std::slice::Iter::<'_, T> { ptr: copy _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; StorageDead(_10); StorageDead(_9); StorageDead(_5); @@ -92,7 +92,7 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { StorageDead(_6); StorageDead(_3); StorageLive(_12); - _12 = _11; + _12 = copy _11; goto -> bb4; } @@ -118,11 +118,11 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb8: { - _16 = ((_14 as Some).0: &T); + _16 = copy ((_14 as Some).0: &T); StorageLive(_17); _17 = &_2; StorageLive(_18); - _18 = (_16,); + _18 = (copy _16,); _19 = >::call(move _17, move _18) -> [return: bb9, unwind unreachable]; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir index c7c722274f24e..a25f12edc28e9 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir @@ -57,10 +57,10 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { StorageLive(_6); StorageLive(_4); StorageLive(_5); - _3 = PtrMetadata(_1); + _3 = PtrMetadata(copy _1); _4 = &raw const (*_1); - _5 = _4 as *const T (PtrToPtr); - _6 = NonNull:: { pointer: _5 }; + _5 = copy _4 as *const T (PtrToPtr); + _6 = NonNull:: { pointer: copy _5 }; StorageLive(_9); switchInt(const ::IS_ZST) -> [0: bb1, otherwise: bb2]; } @@ -68,8 +68,8 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { bb1: { StorageLive(_8); StorageLive(_7); - _7 = _4 as *mut T (PtrToPtr); - _8 = Offset(_7, _3); + _7 = copy _4 as *mut T (PtrToPtr); + _8 = Offset(copy _7, copy _3); StorageDead(_7); _9 = move _8 as *const T (PtrToPtr); StorageDead(_8); @@ -77,14 +77,14 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb2: { - _9 = _3 as *const T (Transmute); + _9 = copy _3 as *const T (Transmute); goto -> bb3; } bb3: { StorageLive(_10); - _10 = _9; - _11 = std::slice::Iter::<'_, T> { ptr: _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; + _10 = copy _9; + _11 = std::slice::Iter::<'_, T> { ptr: copy _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; StorageDead(_10); StorageDead(_9); StorageDead(_5); @@ -92,7 +92,7 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { StorageDead(_6); StorageDead(_3); StorageLive(_12); - _12 = _11; + _12 = copy _11; goto -> bb4; } @@ -118,11 +118,11 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb8: { - _16 = ((_14 as Some).0: &T); + _16 = copy ((_14 as Some).0: &T); StorageLive(_17); _17 = &_2; StorageLive(_18); - _18 = (_16,); + _18 = (copy _16,); _19 = >::call(move _17, move _18) -> [return: bb9, unwind: bb11]; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir index cea2fcbcdc0b2..ecac03ad0f9d9 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir @@ -40,7 +40,7 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb0: { - _3 = PtrMetadata(_1); + _3 = PtrMetadata(copy _1); StorageLive(_4); _4 = const 0_usize; goto -> bb1; @@ -51,8 +51,8 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { StorageLive(_7); StorageLive(_6); StorageLive(_5); - _5 = _4; - _6 = Lt(move _5, _3); + _5 = copy _4; + _6 = Lt(move _5, copy _3); StorageDead(_5); switchInt(move _6) -> [0: bb2, otherwise: bb4]; } @@ -70,21 +70,21 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb4: { - _7 = _4; + _7 = copy _4; StorageLive(_8); - _8 = ::forward_unchecked(_7, const 1_usize) -> [return: bb5, unwind unreachable]; + _8 = ::forward_unchecked(copy _7, const 1_usize) -> [return: bb5, unwind unreachable]; } bb5: { _4 = move _8; StorageDead(_8); - _9 = Option::::Some(_7); + _9 = Option::::Some(copy _7); StorageDead(_6); StorageDead(_7); - _10 = ((_9 as Some).0: usize); + _10 = copy ((_9 as Some).0: usize); _11 = Len((*_1)); - _12 = Lt(_10, _11); - assert(move _12, "index out of bounds: the length is {} but the index is {}", move _11, _10) -> [success: bb6, unwind unreachable]; + _12 = Lt(copy _10, copy _11); + assert(move _12, "index out of bounds: the length is {} but the index is {}", move _11, copy _10) -> [success: bb6, unwind unreachable]; } bb6: { @@ -92,7 +92,7 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { StorageLive(_14); _14 = &_2; StorageLive(_15); - _15 = (_10, _13); + _15 = (copy _10, copy _13); _16 = >::call(move _14, move _15) -> [return: bb7, unwind unreachable]; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir index bd658a770ea91..1032473b9b2a2 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir @@ -40,7 +40,7 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb0: { - _3 = PtrMetadata(_1); + _3 = PtrMetadata(copy _1); StorageLive(_4); _4 = const 0_usize; goto -> bb1; @@ -51,8 +51,8 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { StorageLive(_7); StorageLive(_6); StorageLive(_5); - _5 = _4; - _6 = Lt(move _5, _3); + _5 = copy _4; + _6 = Lt(move _5, copy _3); StorageDead(_5); switchInt(move _6) -> [0: bb2, otherwise: bb4]; } @@ -70,21 +70,21 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb4: { - _7 = _4; + _7 = copy _4; StorageLive(_8); - _8 = ::forward_unchecked(_7, const 1_usize) -> [return: bb5, unwind: bb8]; + _8 = ::forward_unchecked(copy _7, const 1_usize) -> [return: bb5, unwind: bb8]; } bb5: { _4 = move _8; StorageDead(_8); - _9 = Option::::Some(_7); + _9 = Option::::Some(copy _7); StorageDead(_6); StorageDead(_7); - _10 = ((_9 as Some).0: usize); + _10 = copy ((_9 as Some).0: usize); _11 = Len((*_1)); - _12 = Lt(_10, _11); - assert(move _12, "index out of bounds: the length is {} but the index is {}", move _11, _10) -> [success: bb6, unwind: bb8]; + _12 = Lt(copy _10, copy _11); + assert(move _12, "index out of bounds: the length is {} but the index is {}", move _11, copy _10) -> [success: bb6, unwind: bb8]; } bb6: { @@ -92,7 +92,7 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { StorageLive(_14); _14 = &_2; StorageLive(_15); - _15 = (_10, _13); + _15 = (copy _10, copy _13); _16 = >::call(move _14, move _15) -> [return: bb7, unwind: bb8]; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir index fbb887fe76a59..1b397a4e4cdde 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir @@ -65,10 +65,10 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { StorageLive(_6); StorageLive(_4); StorageLive(_5); - _3 = PtrMetadata(_1); + _3 = PtrMetadata(copy _1); _4 = &raw const (*_1); - _5 = _4 as *const T (PtrToPtr); - _6 = NonNull:: { pointer: _5 }; + _5 = copy _4 as *const T (PtrToPtr); + _6 = NonNull:: { pointer: copy _5 }; StorageLive(_9); switchInt(const ::IS_ZST) -> [0: bb1, otherwise: bb2]; } @@ -76,8 +76,8 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { bb1: { StorageLive(_8); StorageLive(_7); - _7 = _4 as *mut T (PtrToPtr); - _8 = Offset(_7, _3); + _7 = copy _4 as *mut T (PtrToPtr); + _8 = Offset(copy _7, copy _3); StorageDead(_7); _9 = move _8 as *const T (PtrToPtr); StorageDead(_8); @@ -85,24 +85,24 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb2: { - _9 = _3 as *const T (Transmute); + _9 = copy _3 as *const T (Transmute); goto -> bb3; } bb3: { StorageLive(_10); - _10 = _9; - _11 = std::slice::Iter::<'_, T> { ptr: _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; + _10 = copy _9; + _11 = std::slice::Iter::<'_, T> { ptr: copy _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; StorageDead(_10); StorageDead(_9); StorageDead(_5); StorageDead(_4); StorageDead(_6); StorageDead(_3); - _12 = Rev::> { iter: _11 }; + _12 = Rev::> { iter: copy _11 }; StorageDead(_11); StorageLive(_13); - _13 = _12; + _13 = copy _12; goto -> bb4; } @@ -130,11 +130,11 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb8: { - _17 = ((_15 as Some).0: &T); + _17 = copy ((_15 as Some).0: &T); StorageLive(_18); _18 = &_2; StorageLive(_19); - _19 = (_17,); + _19 = (copy _17,); _20 = >::call(move _18, move _19) -> [return: bb9, unwind unreachable]; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir index db9409f72ab1a..77689dd9b513e 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir @@ -65,10 +65,10 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { StorageLive(_6); StorageLive(_4); StorageLive(_5); - _3 = PtrMetadata(_1); + _3 = PtrMetadata(copy _1); _4 = &raw const (*_1); - _5 = _4 as *const T (PtrToPtr); - _6 = NonNull:: { pointer: _5 }; + _5 = copy _4 as *const T (PtrToPtr); + _6 = NonNull:: { pointer: copy _5 }; StorageLive(_9); switchInt(const ::IS_ZST) -> [0: bb1, otherwise: bb2]; } @@ -76,8 +76,8 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { bb1: { StorageLive(_8); StorageLive(_7); - _7 = _4 as *mut T (PtrToPtr); - _8 = Offset(_7, _3); + _7 = copy _4 as *mut T (PtrToPtr); + _8 = Offset(copy _7, copy _3); StorageDead(_7); _9 = move _8 as *const T (PtrToPtr); StorageDead(_8); @@ -85,24 +85,24 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb2: { - _9 = _3 as *const T (Transmute); + _9 = copy _3 as *const T (Transmute); goto -> bb3; } bb3: { StorageLive(_10); - _10 = _9; - _11 = std::slice::Iter::<'_, T> { ptr: _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; + _10 = copy _9; + _11 = std::slice::Iter::<'_, T> { ptr: copy _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; StorageDead(_10); StorageDead(_9); StorageDead(_5); StorageDead(_4); StorageDead(_6); StorageDead(_3); - _12 = Rev::> { iter: _11 }; + _12 = Rev::> { iter: copy _11 }; StorageDead(_11); StorageLive(_13); - _13 = _12; + _13 = copy _12; goto -> bb4; } @@ -130,11 +130,11 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb8: { - _17 = ((_15 as Some).0: &T); + _17 = copy ((_15 as Some).0: &T); StorageLive(_18); _18 = &_2; StorageLive(_19); - _19 = (_17,); + _19 = (copy _17,); _20 = >::call(move _18, move _19) -> [return: bb9, unwind: bb11]; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_generic_is_empty.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_generic_is_empty.PreCodegen.after.panic-abort.mir index 96e71c298e003..f8b0e749bfc03 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_generic_is_empty.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_generic_is_empty.PreCodegen.after.panic-abort.mir @@ -43,27 +43,27 @@ fn slice_iter_generic_is_empty(_1: &std::slice::Iter<'_, T>) -> bool { StorageLive(_3); StorageLive(_2); _2 = &raw const ((*_1).1: *const T); - _3 = _2 as *const std::ptr::NonNull (PtrToPtr); + _3 = copy _2 as *const std::ptr::NonNull (PtrToPtr); StorageDead(_2); - _4 = (*_3); + _4 = copy (*_3); StorageDead(_3); StorageLive(_6); StorageLive(_7); StorageLive(_5); - _5 = ((*_1).0: std::ptr::NonNull); - _6 = (_5.0: *const T); + _5 = copy ((*_1).0: std::ptr::NonNull); + _6 = copy (_5.0: *const T); StorageDead(_5); - _7 = (_4.0: *const T); - _0 = Eq(_6, _7); + _7 = copy (_4.0: *const T); + _0 = Eq(copy _6, copy _7); StorageDead(_7); StorageDead(_6); goto -> bb3; } bb2: { - _8 = ((*_1).1: *const T); - _9 = _8 as usize (Transmute); - _0 = Eq(_9, const 0_usize); + _8 = copy ((*_1).1: *const T); + _9 = copy _8 as usize (Transmute); + _0 = Eq(copy _9, const 0_usize); goto -> bb3; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_generic_is_empty.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_generic_is_empty.PreCodegen.after.panic-unwind.mir index 96e71c298e003..f8b0e749bfc03 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_generic_is_empty.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_generic_is_empty.PreCodegen.after.panic-unwind.mir @@ -43,27 +43,27 @@ fn slice_iter_generic_is_empty(_1: &std::slice::Iter<'_, T>) -> bool { StorageLive(_3); StorageLive(_2); _2 = &raw const ((*_1).1: *const T); - _3 = _2 as *const std::ptr::NonNull (PtrToPtr); + _3 = copy _2 as *const std::ptr::NonNull (PtrToPtr); StorageDead(_2); - _4 = (*_3); + _4 = copy (*_3); StorageDead(_3); StorageLive(_6); StorageLive(_7); StorageLive(_5); - _5 = ((*_1).0: std::ptr::NonNull); - _6 = (_5.0: *const T); + _5 = copy ((*_1).0: std::ptr::NonNull); + _6 = copy (_5.0: *const T); StorageDead(_5); - _7 = (_4.0: *const T); - _0 = Eq(_6, _7); + _7 = copy (_4.0: *const T); + _0 = Eq(copy _6, copy _7); StorageDead(_7); StorageDead(_6); goto -> bb3; } bb2: { - _8 = ((*_1).1: *const T); - _9 = _8 as usize (Transmute); - _0 = Eq(_9, const 0_usize); + _8 = copy ((*_1).1: *const T); + _9 = copy _8 as usize (Transmute); + _0 = Eq(copy _9, const 0_usize); goto -> bb3; } diff --git a/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir index c76e5315db9f6..fe4e2deab8706 100644 --- a/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir @@ -10,7 +10,7 @@ fn outer(_1: u8) -> u8 { bb0: { _2 = &_1; // scope 0 at $DIR/spans.rs:11:11: 11:13 - _0 = _1; // scope 1 at $DIR/spans.rs:15:5: 15:7 + _0 = copy _1; // scope 1 at $DIR/spans.rs:15:5: 15:7 return; // scope 0 at $DIR/spans.rs:12:2: 12:2 } } diff --git a/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir index c76e5315db9f6..fe4e2deab8706 100644 --- a/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir @@ -10,7 +10,7 @@ fn outer(_1: u8) -> u8 { bb0: { _2 = &_1; // scope 0 at $DIR/spans.rs:11:11: 11:13 - _0 = _1; // scope 1 at $DIR/spans.rs:15:5: 15:7 + _0 = copy _1; // scope 1 at $DIR/spans.rs:15:5: 15:7 return; // scope 0 at $DIR/spans.rs:12:2: 12:2 } } diff --git a/tests/mir-opt/pre-codegen/try_identity.new.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/try_identity.new.PreCodegen.after.mir index 16d6d9719b641..baa01e28a9410 100644 --- a/tests/mir-opt/pre-codegen/try_identity.new.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/try_identity.new.PreCodegen.after.mir @@ -30,18 +30,18 @@ fn new(_1: Result) -> Result { bb1: { _3 = move ((_1 as Ok).0: T); - _4 = ControlFlow::::Continue(_3); + _4 = ControlFlow::::Continue(copy _3); _5 = move ((_4 as Continue).0: T); - _0 = Result::::Ok(_5); + _0 = Result::::Ok(copy _5); StorageDead(_4); goto -> bb3; } bb2: { _6 = move ((_1 as Err).0: E); - _4 = ControlFlow::::Break(_6); + _4 = ControlFlow::::Break(copy _6); _7 = move ((_4 as Break).0: E); - _0 = Result::::Err(_7); + _0 = Result::::Err(copy _7); StorageDead(_4); goto -> bb3; } diff --git a/tests/mir-opt/pre-codegen/try_identity.old.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/try_identity.old.PreCodegen.after.mir index d6883ac9fda08..ac485f485b1cc 100644 --- a/tests/mir-opt/pre-codegen/try_identity.old.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/try_identity.old.PreCodegen.after.mir @@ -20,13 +20,13 @@ fn old(_1: Result) -> Result { bb1: { _3 = move ((_1 as Ok).0: T); - _0 = Result::::Ok(_3); + _0 = Result::::Ok(copy _3); goto -> bb3; } bb2: { _4 = move ((_1 as Err).0: E); - _0 = Result::::Err(_4); + _0 = Result::::Err(copy _4); goto -> bb3; } diff --git a/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-abort.mir index 0fe4fd3707221..ce1e4a0abd61f 100644 --- a/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-abort.mir @@ -78,17 +78,17 @@ fn vec_deref_to_slice(_1: &Vec) -> &[u8] { _3 = &(((*_1).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner); StorageLive(_6); StorageLive(_4); - _4 = (((((*_1).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique).0: std::ptr::NonNull); - _5 = (_4.0: *const u8); - _6 = NonNull:: { pointer: _5 }; + _4 = copy (((((*_1).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique).0: std::ptr::NonNull); + _5 = copy (_4.0: *const u8); + _6 = NonNull:: { pointer: copy _5 }; StorageDead(_4); StorageDead(_6); StorageDead(_3); StorageDead(_2); StorageLive(_7); - _7 = ((*_1).1: usize); + _7 = copy ((*_1).1: usize); StorageLive(_8); - _8 = *const [u8] from (_5, _7); + _8 = *const [u8] from (copy _5, copy _7); _0 = &(*_8); StorageDead(_8); StorageDead(_7); diff --git a/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-unwind.mir index 0fe4fd3707221..ce1e4a0abd61f 100644 --- a/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-unwind.mir @@ -78,17 +78,17 @@ fn vec_deref_to_slice(_1: &Vec) -> &[u8] { _3 = &(((*_1).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner); StorageLive(_6); StorageLive(_4); - _4 = (((((*_1).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique).0: std::ptr::NonNull); - _5 = (_4.0: *const u8); - _6 = NonNull:: { pointer: _5 }; + _4 = copy (((((*_1).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique).0: std::ptr::NonNull); + _5 = copy (_4.0: *const u8); + _6 = NonNull:: { pointer: copy _5 }; StorageDead(_4); StorageDead(_6); StorageDead(_3); StorageDead(_2); StorageLive(_7); - _7 = ((*_1).1: usize); + _7 = copy ((*_1).1: usize); StorageLive(_8); - _8 = *const [u8] from (_5, _7); + _8 = *const [u8] from (copy _5, copy _7); _0 = &(*_8); StorageDead(_8); StorageDead(_7); diff --git a/tests/mir-opt/reference_prop.dominate_storage.ReferencePropagation.diff b/tests/mir-opt/reference_prop.dominate_storage.ReferencePropagation.diff index 012efa9693ec3..4715f5110ebb8 100644 --- a/tests/mir-opt/reference_prop.dominate_storage.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.dominate_storage.ReferencePropagation.diff @@ -21,15 +21,15 @@ } bb2: { - _5 = (*_2); - _0 = opaque::(_5) -> [return: bb3, unwind continue]; + _5 = copy (*_2); + _0 = opaque::(copy _5) -> [return: bb3, unwind continue]; } bb3: { StorageDead(_1); StorageLive(_1); _6 = const true; - switchInt(_6) -> [0: bb3, otherwise: bb1]; + switchInt(copy _6) -> [0: bb3, otherwise: bb1]; } } diff --git a/tests/mir-opt/reference_prop.maybe_dead.ReferencePropagation.diff b/tests/mir-opt/reference_prop.maybe_dead.ReferencePropagation.diff index c6bd6c2121092..b1de380d84d44 100644 --- a/tests/mir-opt/reference_prop.maybe_dead.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.maybe_dead.ReferencePropagation.diff @@ -19,25 +19,25 @@ _4 = &_2; _5 = &mut _3; (*_5) = const 7_i32; -- _6 = (*_4); -+ _6 = _2; - switchInt(_1) -> [1: bb1, otherwise: bb2]; +- _6 = copy (*_4); ++ _6 = copy _2; + switchInt(copy _1) -> [1: bb1, otherwise: bb2]; } bb1: { StorageDead(_2); StorageDead(_3); - _0 = opaque::(_6) -> [return: bb2, unwind continue]; + _0 = opaque::(copy _6) -> [return: bb2, unwind continue]; } bb2: { - _7 = (*_4); - _0 = opaque::(_7) -> [return: bb3, unwind continue]; + _7 = copy (*_4); + _0 = opaque::(copy _7) -> [return: bb3, unwind continue]; } bb3: { - _8 = (*_5); - _0 = opaque::(_8) -> [return: bb4, unwind continue]; + _8 = copy (*_5); + _0 = opaque::(copy _8) -> [return: bb4, unwind continue]; } bb4: { diff --git a/tests/mir-opt/reference_prop.multiple_storage.ReferencePropagation.diff b/tests/mir-opt/reference_prop.multiple_storage.ReferencePropagation.diff index 0fd74155aa30a..2368edea5bac4 100644 --- a/tests/mir-opt/reference_prop.multiple_storage.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.multiple_storage.ReferencePropagation.diff @@ -13,8 +13,8 @@ _2 = &_1; StorageDead(_1); StorageLive(_1); - _3 = (*_2); - _0 = opaque::(_3) -> [return: bb1, unwind continue]; + _3 = copy (*_2); + _0 = opaque::(copy _3) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/reference_prop.mut_raw_then_mut_shr.ReferencePropagation.diff b/tests/mir-opt/reference_prop.mut_raw_then_mut_shr.ReferencePropagation.diff index 859097d3966a5..90fd91764cb94 100644 --- a/tests/mir-opt/reference_prop.mut_raw_then_mut_shr.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.mut_raw_then_mut_shr.ReferencePropagation.diff @@ -41,23 +41,23 @@ - StorageLive(_5); - _5 = &mut (*_2); - _4 = &raw mut (*_5); -- _3 = _4; +- _3 = copy _4; - StorageDead(_5); - StorageDead(_4); - StorageLive(_6); - _6 = &(*_2); StorageLive(_7); -- _7 = (*_6); +- _7 = copy (*_6); - StorageLive(_8); - (*_3) = const 4_i32; - _8 = const (); - StorageDead(_8); -+ _7 = _1; ++ _7 = copy _1; + _1 = const 4_i32; StorageLive(_9); - _9 = _7; + _9 = copy _7; StorageLive(_10); - _10 = _1; + _10 = copy _1; _0 = (move _9, move _10); StorageDead(_10); StorageDead(_9); diff --git a/tests/mir-opt/reference_prop.read_through_raw.ReferencePropagation.diff b/tests/mir-opt/reference_prop.read_through_raw.ReferencePropagation.diff index 371b0e468b1db..064711925e020 100644 --- a/tests/mir-opt/reference_prop.read_through_raw.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.read_through_raw.ReferencePropagation.diff @@ -13,10 +13,10 @@ - _3 = &mut (*_2); - _4 = &raw mut (*_2); - _5 = &raw mut (*_3); -- _0 = (*_4); -- _0 = (*_5); -+ _0 = (*_1); -+ _0 = (*_1); +- _0 = copy (*_4); +- _0 = copy (*_5); ++ _0 = copy (*_1); ++ _0 = copy (*_1); return; } } diff --git a/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff b/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff index 0dfe8781c186f..3c6a9a9614c32 100644 --- a/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff @@ -191,8 +191,8 @@ StorageLive(_5); _5 = &_4; StorageLive(_6); -- _6 = (*_5); -+ _6 = _4; +- _6 = copy (*_5); ++ _6 = copy _4; StorageLive(_7); StorageLive(_8); _8 = (); @@ -223,7 +223,7 @@ StorageDead(_13); - StorageDead(_14); StorageLive(_15); - _15 = (*_12); + _15 = copy (*_12); StorageLive(_16); StorageLive(_17); _17 = (); @@ -247,11 +247,11 @@ StorageLive(_21); _21 = &_20; StorageLive(_22); -- _22 = (*_20); -+ _22 = _19; +- _22 = copy (*_20); ++ _22 = copy _19; StorageLive(_23); StorageLive(_24); - _24 = _21; + _24 = copy _21; _23 = opaque::<&&usize>(move _24) -> [return: bb3, unwind continue]; } @@ -272,10 +272,10 @@ StorageLive(_28); _28 = &raw mut _27; StorageLive(_29); - _29 = (*_27); + _29 = copy (*_27); StorageLive(_30); StorageLive(_31); - _31 = _28; + _31 = copy _28; _30 = opaque::<*mut &usize>(move _31) -> [return: bb4, unwind continue]; } @@ -294,11 +294,11 @@ StorageLive(_34); _34 = &_33; StorageLive(_35); -- _35 = (*_34); -+ _35 = _33; +- _35 = copy (*_34); ++ _35 = copy _33; StorageLive(_36); StorageLive(_37); - _37 = _34; + _37 = copy _34; _36 = opaque::<&usize>(move _37) -> [return: bb5, unwind continue]; } @@ -316,18 +316,18 @@ StorageLive(_40); _40 = &_39; StorageLive(_41); -- _41 = (*_40); -+ _41 = _39; +- _41 = copy (*_40); ++ _41 = copy _39; StorageLive(_42); - _42 = _40; + _42 = copy _40; StorageLive(_43); -- _43 = (*_42); -+ _43 = _39; +- _43 = copy (*_42); ++ _43 = copy _39; StorageLive(_44); - _44 = _42; + _44 = copy _42; StorageLive(_45); StorageLive(_46); - _46 = _44; + _46 = copy _44; _45 = opaque::<&usize>(move _46) -> [return: bb6, unwind continue]; } @@ -346,8 +346,8 @@ - StorageLive(_48); - _48 = &(*_1); StorageLive(_49); -- _49 = (*_48); -+ _49 = (*_1); +- _49 = copy (*_48); ++ _49 = copy (*_1); StorageLive(_50); StorageLive(_51); _51 = (); @@ -373,7 +373,7 @@ StorageDead(_54); - StorageDead(_55); StorageLive(_56); - _56 = (*_53); + _56 = copy (*_53); StorageLive(_57); StorageLive(_58); _58 = (); @@ -395,8 +395,8 @@ StorageLive(_62); _62 = &_61; StorageLive(_63); -- _63 = (*_61); -+ _63 = _60; +- _63 = copy (*_61); ++ _63 = copy _60; StorageLive(_64); StorageLive(_65); _65 = (); @@ -419,7 +419,7 @@ StorageLive(_68); _68 = &mut _67; StorageLive(_69); - _69 = (*_67); + _69 = copy (*_67); StorageLive(_70); StorageLive(_71); _71 = (); 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 21486a8616aab..75fe99de93810 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 @@ -208,8 +208,8 @@ StorageLive(_5); _5 = &raw const _4; StorageLive(_6); -- _6 = (*_5); -+ _6 = _4; +- _6 = copy (*_5); ++ _6 = copy _4; StorageLive(_7); StorageLive(_8); _8 = (); @@ -236,7 +236,7 @@ _12 = move _13; StorageDead(_13); StorageLive(_14); - _14 = (*_12); + _14 = copy (*_12); StorageLive(_15); StorageLive(_16); _16 = (); @@ -260,11 +260,11 @@ StorageLive(_20); _20 = &_19; StorageLive(_21); -- _21 = (*_19); -+ _21 = _18; +- _21 = copy (*_19); ++ _21 = copy _18; StorageLive(_22); StorageLive(_23); - _23 = _20; + _23 = copy _20; _22 = opaque::<&*const usize>(move _23) -> [return: bb3, unwind continue]; } @@ -285,10 +285,10 @@ StorageLive(_27); _27 = &raw mut _26; StorageLive(_28); - _28 = (*_26); + _28 = copy (*_26); StorageLive(_29); StorageLive(_30); - _30 = _27; + _30 = copy _27; _29 = opaque::<*mut *const usize>(move _30) -> [return: bb4, unwind continue]; } @@ -307,11 +307,11 @@ StorageLive(_33); _33 = &raw const _32; StorageLive(_34); -- _34 = (*_33); -+ _34 = _32; +- _34 = copy (*_33); ++ _34 = copy _32; StorageLive(_35); StorageLive(_36); - _36 = _33; + _36 = copy _33; _35 = opaque::<*const usize>(move _36) -> [return: bb5, unwind continue]; } @@ -329,18 +329,18 @@ StorageLive(_39); _39 = &raw const _38; StorageLive(_40); -- _40 = (*_39); -+ _40 = _38; +- _40 = copy (*_39); ++ _40 = copy _38; StorageLive(_41); - _41 = _39; + _41 = copy _39; StorageLive(_42); -- _42 = (*_41); -+ _42 = _38; +- _42 = copy (*_41); ++ _42 = copy _38; StorageLive(_43); - _43 = _41; + _43 = copy _41; StorageLive(_44); StorageLive(_45); - _45 = _43; + _45 = copy _43; _44 = opaque::<*const usize>(move _45) -> [return: bb6, unwind continue]; } @@ -359,8 +359,8 @@ - StorageLive(_47); - _47 = &raw const (*_1); StorageLive(_48); -- _48 = (*_47); -+ _48 = (*_1); +- _48 = copy (*_47); ++ _48 = copy (*_1); StorageLive(_49); StorageLive(_50); _50 = (); @@ -382,7 +382,7 @@ _2 = move _53; StorageDead(_53); StorageLive(_54); - _54 = (*_52); + _54 = copy (*_52); StorageLive(_55); StorageLive(_56); _56 = (); @@ -405,8 +405,8 @@ - _60 = &raw const (*_59); + _60 = &raw const _58; StorageLive(_61); -- _61 = (*_60); -+ _61 = _58; +- _61 = copy (*_60); ++ _61 = copy _58; StorageLive(_62); StorageLive(_63); _63 = (); @@ -430,8 +430,8 @@ StorageLive(_67); _67 = &_66; StorageLive(_68); -- _68 = (*_66); -+ _68 = _65; +- _68 = copy (*_66); ++ _68 = copy _65; StorageLive(_69); StorageLive(_70); _70 = (); @@ -454,7 +454,7 @@ StorageLive(_73); _73 = &mut _72; StorageLive(_74); - _74 = (*_72); + _74 = copy (*_72); StorageLive(_75); StorageLive(_76); _76 = (); 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 7c7f424bba2bd..f35b4974d6eba 100644 --- a/tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff @@ -191,8 +191,8 @@ StorageLive(_5); _5 = &mut _4; StorageLive(_6); -- _6 = (*_5); -+ _6 = _4; +- _6 = copy (*_5); ++ _6 = copy _4; StorageLive(_7); StorageLive(_8); _8 = (); @@ -223,7 +223,7 @@ StorageDead(_13); - StorageDead(_14); StorageLive(_15); - _15 = (*_12); + _15 = copy (*_12); StorageLive(_16); StorageLive(_17); _17 = (); @@ -247,10 +247,10 @@ StorageLive(_21); _21 = &_20; StorageLive(_22); - _22 = (*_20); + _22 = copy (*_20); StorageLive(_23); StorageLive(_24); - _24 = _21; + _24 = copy _21; _23 = opaque::<&&mut usize>(move _24) -> [return: bb3, unwind continue]; } @@ -271,10 +271,10 @@ StorageLive(_28); _28 = &raw mut _27; StorageLive(_29); - _29 = (*_27); + _29 = copy (*_27); StorageLive(_30); StorageLive(_31); - _31 = _28; + _31 = copy _28; _30 = opaque::<*mut &mut usize>(move _31) -> [return: bb4, unwind continue]; } @@ -293,7 +293,7 @@ StorageLive(_34); _34 = &mut _33; StorageLive(_35); - _35 = (*_34); + _35 = copy (*_34); StorageLive(_36); StorageLive(_37); _37 = move _34; @@ -314,11 +314,11 @@ StorageLive(_40); _40 = &mut _39; StorageLive(_41); - _41 = (*_40); + _41 = copy (*_40); StorageLive(_42); _42 = move _40; StorageLive(_43); - _43 = (*_42); + _43 = copy (*_42); StorageLive(_44); _44 = move _42; StorageLive(_45); @@ -342,8 +342,8 @@ - StorageLive(_48); - _48 = &mut (*_1); StorageLive(_49); -- _49 = (*_48); -+ _49 = (*_1); +- _49 = copy (*_48); ++ _49 = copy (*_1); StorageLive(_50); StorageLive(_51); _51 = (); @@ -369,7 +369,7 @@ StorageDead(_54); - StorageDead(_55); StorageLive(_56); - _56 = (*_53); + _56 = copy (*_53); StorageLive(_57); StorageLive(_58); _58 = (); @@ -391,7 +391,7 @@ StorageLive(_62); _62 = &_61; StorageLive(_63); - _63 = (*_61); + _63 = copy (*_61); StorageLive(_64); StorageLive(_65); _65 = (); @@ -414,7 +414,7 @@ StorageLive(_68); _68 = &mut _67; StorageLive(_69); - _69 = (*_67); + _69 = copy (*_67); StorageLive(_70); StorageLive(_71); _71 = (); 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 5629d04f1b192..21b322b721876 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 @@ -189,8 +189,8 @@ StorageLive(_5); _5 = &raw mut _4; StorageLive(_6); -- _6 = (*_5); -+ _6 = _4; +- _6 = copy (*_5); ++ _6 = copy _4; StorageLive(_7); StorageLive(_8); _8 = (); @@ -217,7 +217,7 @@ _12 = move _13; StorageDead(_13); StorageLive(_14); - _14 = (*_12); + _14 = copy (*_12); StorageLive(_15); StorageLive(_16); _16 = (); @@ -241,10 +241,10 @@ StorageLive(_20); _20 = &_19; StorageLive(_21); - _21 = (*_19); + _21 = copy (*_19); StorageLive(_22); StorageLive(_23); - _23 = _20; + _23 = copy _20; _22 = opaque::<&*mut usize>(move _23) -> [return: bb3, unwind continue]; } @@ -265,10 +265,10 @@ StorageLive(_27); _27 = &raw mut _26; StorageLive(_28); - _28 = (*_26); + _28 = copy (*_26); StorageLive(_29); StorageLive(_30); - _30 = _27; + _30 = copy _27; _29 = opaque::<*mut *mut usize>(move _30) -> [return: bb4, unwind continue]; } @@ -287,10 +287,10 @@ StorageLive(_33); _33 = &raw mut _32; StorageLive(_34); - _34 = (*_33); + _34 = copy (*_33); StorageLive(_35); StorageLive(_36); - _36 = _33; + _36 = copy _33; _35 = opaque::<*mut usize>(move _36) -> [return: bb5, unwind continue]; } @@ -308,16 +308,16 @@ StorageLive(_39); _39 = &raw mut _38; StorageLive(_40); - _40 = (*_39); + _40 = copy (*_39); StorageLive(_41); - _41 = _39; + _41 = copy _39; StorageLive(_42); - _42 = (*_41); + _42 = copy (*_41); StorageLive(_43); - _43 = _41; + _43 = copy _41; StorageLive(_44); StorageLive(_45); - _45 = _43; + _45 = copy _43; _44 = opaque::<*mut usize>(move _45) -> [return: bb6, unwind continue]; } @@ -336,8 +336,8 @@ - StorageLive(_47); - _47 = &raw mut (*_1); StorageLive(_48); -- _48 = (*_47); -+ _48 = (*_1); +- _48 = copy (*_47); ++ _48 = copy (*_1); StorageLive(_49); StorageLive(_50); _50 = (); @@ -359,7 +359,7 @@ _2 = move _53; StorageDead(_53); StorageLive(_54); - _54 = (*_52); + _54 = copy (*_52); StorageLive(_55); StorageLive(_56); _56 = (); @@ -381,7 +381,7 @@ StorageLive(_60); _60 = &_59; StorageLive(_61); - _61 = (*_59); + _61 = copy (*_59); StorageLive(_62); StorageLive(_63); _63 = (); @@ -404,7 +404,7 @@ StorageLive(_66); _66 = &mut _65; StorageLive(_67); - _67 = (*_65); + _67 = copy (*_65); StorageLive(_68); StorageLive(_69); _69 = (); diff --git a/tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff b/tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff index a5427cea1f8e1..d2ba9db2b897b 100644 --- a/tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff @@ -29,20 +29,20 @@ _3 = &raw mut _2; StorageLive(_4); StorageLive(_5); - _5 = (*_3); + _5 = copy (*_3); _4 = opaque::(move _5) -> [return: bb1, unwind continue]; } bb1: { StorageDead(_5); StorageDead(_4); -- _1 = _3; +- _1 = copy _3; - StorageDead(_3); StorageDead(_2); StorageLive(_6); StorageLive(_7); -- _7 = (*_1); -+ _7 = (*_3); +- _7 = copy (*_1); ++ _7 = copy (*_3); _6 = opaque::(move _7) -> [return: bb2, unwind continue]; } diff --git a/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-abort.diff b/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-abort.diff index d76d65a18a7b4..8c6c5e0d99349 100644 --- a/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-abort.diff +++ b/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-abort.diff @@ -24,7 +24,7 @@ } bb2: { - switchInt((*(*((_1 as Some).0: &&i32)))) -> [0: bb3, otherwise: bb1]; + switchInt(copy (*(*((_1 as Some).0: &&i32)))) -> [0: bb3, otherwise: bb1]; } bb3: { @@ -42,7 +42,7 @@ + nop; + nop; StorageLive(_8); - _8 = _2; + _8 = copy _2; switchInt(move _8) -> [0: bb6, otherwise: bb5]; } diff --git a/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-unwind.diff b/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-unwind.diff index d76d65a18a7b4..8c6c5e0d99349 100644 --- a/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-unwind.diff +++ b/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-unwind.diff @@ -24,7 +24,7 @@ } bb2: { - switchInt((*(*((_1 as Some).0: &&i32)))) -> [0: bb3, otherwise: bb1]; + switchInt(copy (*(*((_1 as Some).0: &&i32)))) -> [0: bb3, otherwise: bb1]; } bb3: { @@ -42,7 +42,7 @@ + nop; + nop; StorageLive(_8); - _8 = _2; + _8 = copy _2; switchInt(move _8) -> [0: bb6, otherwise: bb5]; } diff --git a/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-abort.diff b/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-abort.diff index 14762b9c40f46..38cdbf5684bf2 100644 --- a/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-abort.diff +++ b/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-abort.diff @@ -64,10 +64,10 @@ bb5: { - StorageLive(_12); - _12 = ((_7 as Some).0: i32); + _12 = copy ((_7 as Some).0: i32); - StorageLive(_13); - _13 = _12; - _1 = Add(_1, move _13); + _13 = copy _12; + _1 = Add(copy _1, move _13); - StorageDead(_13); _6 = const (); - StorageDead(_12); diff --git a/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-unwind.diff b/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-unwind.diff index 24797424b5c8a..2b5aaa95fe1a4 100644 --- a/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-unwind.diff +++ b/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-unwind.diff @@ -64,10 +64,10 @@ bb5: { - StorageLive(_12); - _12 = ((_7 as Some).0: i32); + _12 = copy ((_7 as Some).0: i32); - StorageLive(_13); - _13 = _12; - _1 = Add(_1, move _13); + _13 = copy _12; + _1 = Add(copy _1, move _13); - StorageDead(_13); _6 = const (); - StorageDead(_12); diff --git a/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-abort.diff b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-abort.diff index 5afeb8620a176..01eb6d4901f76 100644 --- a/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-abort.diff +++ b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-abort.diff @@ -12,7 +12,7 @@ bb0: { - nop; StorageLive(_3); - _3 = _1; + _3 = copy _1; - drop(_3) -> [return: bb1, unwind unreachable]; - } - diff --git a/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-unwind.diff b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-unwind.diff index b9919ddea568a..c2c3cb76e8328 100644 --- a/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-unwind.diff +++ b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-unwind.diff @@ -12,7 +12,7 @@ bb0: { - nop; StorageLive(_3); - _3 = _1; + _3 = copy _1; - drop(_3) -> [return: bb1, unwind continue]; - } - diff --git a/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-abort.diff b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-abort.diff index b89432dd6d626..a82ede6196ed3 100644 --- a/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-abort.diff +++ b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-abort.diff @@ -12,7 +12,7 @@ bb0: { - nop; StorageLive(_3); - _3 = _1; + _3 = copy _1; - drop(_3) -> [return: bb1, unwind unreachable]; - } - diff --git a/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-unwind.diff b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-unwind.diff index 48d0260533223..6e7c9ead740f0 100644 --- a/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-unwind.diff +++ b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-unwind.diff @@ -12,7 +12,7 @@ bb0: { - nop; StorageLive(_3); - _3 = _1; + _3 = copy _1; - drop(_3) -> [return: bb1, unwind continue]; - } - diff --git a/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-abort.mir b/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-abort.mir index 6dba667dd1557..ae7b2cc0b6fc7 100644 --- a/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-abort.mir +++ b/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -70,7 +70,7 @@ fn array_casts() -> () { StorageLive(_5); StorageLive(_6); StorageLive(_7); - _7 = _2; + _7 = copy _2; _6 = std::ptr::mut_ptr::::add(move _7, const 1_usize) -> [return: bb1, unwind unreachable]; } @@ -96,13 +96,13 @@ fn array_casts() -> () { StorageLive(_15); StorageLive(_16); StorageLive(_17); - _17 = _9; + _17 = copy _9; _16 = std::ptr::const_ptr::::add(move _17, const 1_usize) -> [return: bb2, unwind unreachable]; } bb2: { StorageDead(_17); - _15 = (*_16); + _15 = copy (*_16); _14 = &_15; StorageLive(_18); _34 = const array_casts::promoted[0]; @@ -113,16 +113,16 @@ fn array_casts() -> () { StorageDead(_18); StorageDead(_14); StorageLive(_20); - _20 = (_13.0: &usize); + _20 = copy (_13.0: &usize); Retag(_20); StorageLive(_21); - _21 = (_13.1: &usize); + _21 = copy (_13.1: &usize); Retag(_21); StorageLive(_22); StorageLive(_23); - _23 = (*_20); + _23 = copy (*_20); StorageLive(_24); - _24 = (*_21); + _24 = copy (*_21); _22 = Eq(move _23, move _24); switchInt(move _22) -> [0: bb4, otherwise: bb3]; } diff --git a/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-unwind.mir b/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index fa812002e26cb..789bc34263849 100644 --- a/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-unwind.mir +++ b/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -70,7 +70,7 @@ fn array_casts() -> () { StorageLive(_5); StorageLive(_6); StorageLive(_7); - _7 = _2; + _7 = copy _2; _6 = std::ptr::mut_ptr::::add(move _7, const 1_usize) -> [return: bb1, unwind continue]; } @@ -96,13 +96,13 @@ fn array_casts() -> () { StorageLive(_15); StorageLive(_16); StorageLive(_17); - _17 = _9; + _17 = copy _9; _16 = std::ptr::const_ptr::::add(move _17, const 1_usize) -> [return: bb2, unwind continue]; } bb2: { StorageDead(_17); - _15 = (*_16); + _15 = copy (*_16); _14 = &_15; StorageLive(_18); _34 = const array_casts::promoted[0]; @@ -113,16 +113,16 @@ fn array_casts() -> () { StorageDead(_18); StorageDead(_14); StorageLive(_20); - _20 = (_13.0: &usize); + _20 = copy (_13.0: &usize); Retag(_20); StorageLive(_21); - _21 = (_13.1: &usize); + _21 = copy (_13.1: &usize); Retag(_21); StorageLive(_22); StorageLive(_23); - _23 = (*_20); + _23 = copy (*_20); StorageLive(_24); - _24 = (*_21); + _24 = copy (*_21); _22 = Eq(move _23, move _24); switchInt(move _22) -> [0: bb4, otherwise: bb3]; } diff --git a/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-abort.mir b/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-abort.mir index 0e568f6a5685f..ca02e7b49cccd 100644 --- a/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-abort.mir +++ b/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -9,7 +9,7 @@ fn box_to_raw_mut(_1: &mut Box) -> *mut i32 { bb0: { Retag([fn entry] _1); _2 = deref_copy (*_1); - _3 = (((_2.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const i32); + _3 = copy (((_2.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const i32); _0 = &raw mut (*_3); Retag([raw] _0); return; diff --git a/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-unwind.mir b/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index 0e568f6a5685f..ca02e7b49cccd 100644 --- a/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-unwind.mir +++ b/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -9,7 +9,7 @@ fn box_to_raw_mut(_1: &mut Box) -> *mut i32 { bb0: { Retag([fn entry] _1); _2 = deref_copy (*_1); - _3 = (((_2.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const i32); + _3 = copy (((_2.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const i32); _0 = &raw mut (*_3); Retag([raw] _0); return; diff --git a/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-abort.mir b/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-abort.mir index 2620929e896be..63b32ceb5c059 100644 --- a/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-abort.mir +++ b/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -12,7 +12,7 @@ fn main::{closure#0}(_1: &{closure@main::{closure#0}}, _2: &i32) -> &i32 { Retag([fn entry] _1); Retag([fn entry] _2); StorageLive(_3); - _3 = _2; + _3 = copy _2; Retag(_3); _0 = &(*_2); StorageDead(_3); diff --git a/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-unwind.mir b/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index 2620929e896be..63b32ceb5c059 100644 --- a/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-unwind.mir +++ b/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -12,7 +12,7 @@ fn main::{closure#0}(_1: &{closure@main::{closure#0}}, _2: &i32) -> &i32 { Retag([fn entry] _1); Retag([fn entry] _2); StorageLive(_3); - _3 = _2; + _3 = copy _2; Retag(_3); _0 = &(*_2); StorageDead(_3); diff --git a/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir b/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir index a35af43cefd60..d0f454e456934 100644 --- a/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir +++ b/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -93,7 +93,7 @@ fn main() -> () { StorageLive(_11); StorageLive(_12); _12 = &raw mut (*_10); - _11 = _12; + _11 = copy _12; StorageDead(_12); _2 = const (); StorageDead(_11); @@ -109,7 +109,7 @@ fn main() -> () { StorageDead(_14); StorageLive(_15); StorageLive(_16); - _16 = _13; + _16 = copy _13; StorageLive(_17); StorageLive(_18); _18 = &_1; @@ -150,7 +150,7 @@ fn main() -> () { StorageLive(_25); StorageLive(_26); _26 = &raw const (*_15); - _25 = _26; + _25 = copy _26; StorageDead(_26); StorageLive(_27); _27 = array_casts() -> [return: bb6, unwind unreachable]; diff --git a/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir b/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index 2495719ec1c6c..685277d7a5328 100644 --- a/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir +++ b/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -93,7 +93,7 @@ fn main() -> () { StorageLive(_11); StorageLive(_12); _12 = &raw mut (*_10); - _11 = _12; + _11 = copy _12; StorageDead(_12); _2 = const (); StorageDead(_11); @@ -109,7 +109,7 @@ fn main() -> () { StorageDead(_14); StorageLive(_15); StorageLive(_16); - _16 = _13; + _16 = copy _13; StorageLive(_17); StorageLive(_18); _18 = &_1; @@ -150,7 +150,7 @@ fn main() -> () { StorageLive(_25); StorageLive(_26); _26 = &raw const (*_15); - _25 = _26; + _25 = copy _26; StorageDead(_26); StorageLive(_27); _27 = array_casts() -> [return: bb6, unwind continue]; diff --git a/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-abort.mir b/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-abort.mir index 4f90413e38bfe..b873c5aabbfc3 100644 --- a/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-abort.mir +++ b/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -8,7 +8,7 @@ fn ::foo_shr(_1: &Test, _2: &i32) -> &i32 { bb0: { Retag([fn entry] _1); Retag([fn entry] _2); - _0 = _2; + _0 = copy _2; Retag(_0); return; } diff --git a/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-unwind.mir b/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index 4f90413e38bfe..b873c5aabbfc3 100644 --- a/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-unwind.mir +++ b/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -8,7 +8,7 @@ fn ::foo_shr(_1: &Test, _2: &i32) -> &i32 { bb0: { Retag([fn entry] _1); Retag([fn entry] _2); - _0 = _2; + _0 = copy _2; Retag(_0); return; } diff --git a/tests/mir-opt/separate_const_switch.identity.JumpThreading.diff b/tests/mir-opt/separate_const_switch.identity.JumpThreading.diff index 8dd904c7d7b99..ce9d812701a8f 100644 --- a/tests/mir-opt/separate_const_switch.identity.JumpThreading.diff +++ b/tests/mir-opt/separate_const_switch.identity.JumpThreading.diff @@ -50,16 +50,16 @@ } bb2: { - _5 = ((_2 as Continue).0: i32); - _0 = Result::::Ok(_5); + _5 = copy ((_2 as Continue).0: i32); + _0 = Result::::Ok(copy _5); StorageDead(_2); return; } bb3: { - _4 = ((_2 as Break).0: std::result::Result); - _10 = ((_4 as Err).0: i32); - _0 = Result::::Err(_10); + _4 = copy ((_2 as Break).0: std::result::Result); + _10 = copy ((_4 as Err).0: i32); + _0 = Result::::Err(copy _10); StorageDead(_2); return; } @@ -74,9 +74,9 @@ } bb5: { - _8 = ((_1 as Err).0: i32); + _8 = copy ((_1 as Err).0: i32); StorageLive(_9); - _9 = Result::::Err(_8); + _9 = Result::::Err(copy _8); _2 = ControlFlow::, i32>::Break(move _9); StorageDead(_9); - goto -> bb4; @@ -84,8 +84,8 @@ } bb6: { - _7 = ((_1 as Ok).0: i32); - _2 = ControlFlow::, i32>::Continue(_7); + _7 = copy ((_1 as Ok).0: i32); + _2 = ControlFlow::, i32>::Continue(copy _7); goto -> bb4; + } + diff --git a/tests/mir-opt/separate_const_switch.too_complex.JumpThreading.diff b/tests/mir-opt/separate_const_switch.too_complex.JumpThreading.diff index f749586299221..c88c63e0c1334 100644 --- a/tests/mir-opt/separate_const_switch.too_complex.JumpThreading.diff +++ b/tests/mir-opt/separate_const_switch.too_complex.JumpThreading.diff @@ -35,15 +35,15 @@ } bb2: { - _5 = ((_1 as Err).0: usize); - _2 = ControlFlow::::Break(_5); + _5 = copy ((_1 as Err).0: usize); + _2 = ControlFlow::::Break(copy _5); - goto -> bb4; + goto -> bb8; } bb3: { - _4 = ((_1 as Ok).0: i32); - _2 = ControlFlow::::Continue(_4); + _4 = copy ((_1 as Ok).0: i32); + _2 = ControlFlow::::Continue(copy _4); goto -> bb4; } @@ -55,15 +55,15 @@ bb5: { StorageLive(_8); - _8 = ((_2 as Break).0: usize); + _8 = copy ((_2 as Break).0: usize); _0 = const Option::::None; StorageDead(_8); goto -> bb7; } bb6: { - _7 = ((_2 as Continue).0: i32); - _0 = Option::::Some(_7); + _7 = copy ((_2 as Continue).0: i32); + _0 = Option::::Some(copy _7); goto -> bb7; } diff --git a/tests/mir-opt/set_no_discriminant.f.JumpThreading.diff b/tests/mir-opt/set_no_discriminant.f.JumpThreading.diff index bc28e81c9a88b..3d9852aef657e 100644 --- a/tests/mir-opt/set_no_discriminant.f.JumpThreading.diff +++ b/tests/mir-opt/set_no_discriminant.f.JumpThreading.diff @@ -10,7 +10,7 @@ _2 = E::::A; discriminant(_2) = 1; _1 = discriminant(_2); - switchInt(_1) -> [0: bb1, otherwise: bb2]; + switchInt(copy _1) -> [0: bb1, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/set_no_discriminant.generic.JumpThreading.diff b/tests/mir-opt/set_no_discriminant.generic.JumpThreading.diff index 78bfeef3c6492..c7af16383161e 100644 --- a/tests/mir-opt/set_no_discriminant.generic.JumpThreading.diff +++ b/tests/mir-opt/set_no_discriminant.generic.JumpThreading.diff @@ -10,7 +10,7 @@ _2 = E::::A; discriminant(_2) = 1; _1 = discriminant(_2); - switchInt(_1) -> [0: bb1, otherwise: bb2]; + switchInt(copy _1) -> [0: bb1, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/simplify_dead_blocks.assert_nonzero_nonmax.SimplifyCfg-after-unreachable-enum-branching.diff b/tests/mir-opt/simplify_dead_blocks.assert_nonzero_nonmax.SimplifyCfg-after-unreachable-enum-branching.diff index 4400cfaef810c..9c8efab5c8437 100644 --- a/tests/mir-opt/simplify_dead_blocks.assert_nonzero_nonmax.SimplifyCfg-after-unreachable-enum-branching.diff +++ b/tests/mir-opt/simplify_dead_blocks.assert_nonzero_nonmax.SimplifyCfg-after-unreachable-enum-branching.diff @@ -5,8 +5,8 @@ let mut _0: u8; bb0: { -- switchInt(_1) -> [0: bb3, 1: bb2, 255: bb3, otherwise: bb4]; -+ switchInt(_1) -> [0: bb2, 1: bb1, 255: bb2, otherwise: bb3]; +- switchInt(copy _1) -> [0: bb3, 1: bb2, 255: bb3, otherwise: bb4]; ++ switchInt(copy _1) -> [0: bb2, 1: bb1, 255: bb2, otherwise: bb3]; } bb1: { @@ -26,7 +26,7 @@ - bb4: { + bb3: { - _0 = _1; + _0 = copy _1; return; } } diff --git a/tests/mir-opt/simplify_locals.expose_provenance.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.expose_provenance.SimplifyLocals-before-const-prop.diff index cc5c642407e9c..420fb4270b2b8 100644 --- a/tests/mir-opt/simplify_locals.expose_provenance.SimplifyLocals-before-const-prop.diff +++ b/tests/mir-opt/simplify_locals.expose_provenance.SimplifyLocals-before-const-prop.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = move _3 as usize (PointerExposeProvenance); StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/simplify_locals.t1.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.t1.SimplifyLocals-before-const-prop.diff index 526ff2f25cfc9..f05a3935d6584 100644 --- a/tests/mir-opt/simplify_locals.t1.SimplifyLocals-before-const-prop.diff +++ b/tests/mir-opt/simplify_locals.t1.SimplifyLocals-before-const-prop.diff @@ -10,7 +10,7 @@ - StorageLive(_1); - StorageLive(_2); - _2 = &/*tls*/ mut X; -- _1 = (*_2); +- _1 = copy (*_2); - StorageDead(_2); - StorageDead(_1); _0 = const (); diff --git a/tests/mir-opt/simplify_locals.t3.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.t3.SimplifyLocals-before-const-prop.diff index 5d45d7ac78159..a57c136e64d34 100644 --- a/tests/mir-opt/simplify_locals.t3.SimplifyLocals-before-const-prop.diff +++ b/tests/mir-opt/simplify_locals.t3.SimplifyLocals-before-const-prop.diff @@ -13,7 +13,7 @@ - StorageLive(_3); - _3 = &/*tls*/ mut X; - _2 = &mut (*_3); -- _1 = (*_2); +- _1 = copy (*_2); - StorageDead(_3); - StorageDead(_2); - StorageDead(_1); diff --git a/tests/mir-opt/simplify_locals.t4.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.t4.SimplifyLocals-before-const-prop.diff index 4f4855dbaaf87..118193fd4fdef 100644 --- a/tests/mir-opt/simplify_locals.t4.SimplifyLocals-before-const-prop.diff +++ b/tests/mir-opt/simplify_locals.t4.SimplifyLocals-before-const-prop.diff @@ -10,7 +10,7 @@ StorageLive(_1); StorageLive(_2); _2 = &/*tls*/ mut X; - _1 = (*_2); + _1 = copy (*_2); _0 = Add(move _1, const 1_u32); StorageDead(_1); StorageDead(_2); diff --git a/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-abort.diff b/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-abort.diff index c520a159f47b2..c363dfcbf70bb 100644 --- a/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-abort.diff +++ b/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-abort.diff @@ -33,7 +33,7 @@ bb2: { StorageLive(_6); - _6 = (((_1.0: std::option::Option) as Some).0: u8); + _6 = copy (((_1.0: std::option::Option) as Some).0: u8); StorageDead(_6); goto -> bb3; } diff --git a/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-unwind.diff b/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-unwind.diff index 686581591fc4e..895b0067d2e63 100644 --- a/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-unwind.diff +++ b/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-unwind.diff @@ -33,7 +33,7 @@ bb2: { StorageLive(_6); - _6 = (((_1.0: std::option::Option) as Some).0: u8); + _6 = copy (((_1.0: std::option::Option) as Some).0: u8); StorageDead(_6); goto -> bb3; } diff --git a/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-abort.diff b/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-abort.diff index 54d254ee37463..58c265c5e6055 100644 --- a/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-abort.diff +++ b/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-abort.diff @@ -51,7 +51,7 @@ - _5 = (move _6, move _7); + StorageLive(_8); + _8 = Temp { x: const 40_u8 }; -+ _7 = (_8.0: u8); ++ _7 = copy (_8.0: u8); + _6 = Add(move _7, const 2_u8); StorageDead(_7); - StorageDead(_6); @@ -67,7 +67,7 @@ - StorageLive(_10); - StorageLive(_11); - _11 = Temp { x: const 40_u8 }; -- _10 = (_11.0: u8); +- _10 = copy (_11.0: u8); - _9 = Add(move _10, const 2_u8); - StorageDead(_10); - _8 = use_u8(move _9) -> [return: bb2, unwind unreachable]; diff --git a/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-unwind.diff b/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-unwind.diff index a5d9bbc49af0a..748e1661c987b 100644 --- a/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-unwind.diff +++ b/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-unwind.diff @@ -51,7 +51,7 @@ - _5 = (move _6, move _7); + StorageLive(_8); + _8 = Temp { x: const 40_u8 }; -+ _7 = (_8.0: u8); ++ _7 = copy (_8.0: u8); + _6 = Add(move _7, const 2_u8); StorageDead(_7); - StorageDead(_6); @@ -67,7 +67,7 @@ - StorageLive(_10); - StorageLive(_11); - _11 = Temp { x: const 40_u8 }; -- _10 = (_11.0: u8); +- _10 = copy (_11.0: u8); - _9 = Add(move _10, const 2_u8); - StorageDead(_10); - _8 = use_u8(move _9) -> [return: bb2, unwind continue]; diff --git a/tests/mir-opt/simplify_match.main.GVN.panic-abort.diff b/tests/mir-opt/simplify_match.main.GVN.panic-abort.diff index 33b36f660cb3a..9e798cbcac0c1 100644 --- a/tests/mir-opt/simplify_match.main.GVN.panic-abort.diff +++ b/tests/mir-opt/simplify_match.main.GVN.panic-abort.diff @@ -14,9 +14,9 @@ - StorageLive(_2); + nop; _2 = const false; -- _1 = _2; +- _1 = copy _2; - StorageDead(_2); -- switchInt(_1) -> [0: bb2, otherwise: bb1]; +- switchInt(copy _1) -> [0: bb2, otherwise: bb1]; + _1 = const false; + nop; + switchInt(const false) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/simplify_match.main.GVN.panic-unwind.diff b/tests/mir-opt/simplify_match.main.GVN.panic-unwind.diff index e5c3adff62369..e243ff45ab0b2 100644 --- a/tests/mir-opt/simplify_match.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/simplify_match.main.GVN.panic-unwind.diff @@ -14,9 +14,9 @@ - StorageLive(_2); + nop; _2 = const false; -- _1 = _2; +- _1 = copy _2; - StorageDead(_2); -- switchInt(_1) -> [0: bb2, otherwise: bb1]; +- switchInt(copy _1) -> [0: bb2, otherwise: bb1]; + _1 = const false; + nop; + switchInt(const false) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/single_use_consts.if_const_debug.SingleUseConsts.panic-abort.diff b/tests/mir-opt/single_use_consts.if_const_debug.SingleUseConsts.panic-abort.diff index ad1a2b300f2a9..0269c2cba202d 100644 --- a/tests/mir-opt/single_use_consts.if_const_debug.SingleUseConsts.panic-abort.diff +++ b/tests/mir-opt/single_use_consts.if_const_debug.SingleUseConsts.panic-abort.diff @@ -22,7 +22,7 @@ bb1: { StorageDead(_2); StorageLive(_3); -- _3 = _1; +- _3 = copy _1; + _3 = const ::ASSOC_BOOL; switchInt(move _3) -> [0: bb3, otherwise: bb2]; } diff --git a/tests/mir-opt/single_use_consts.if_const_debug.SingleUseConsts.panic-unwind.diff b/tests/mir-opt/single_use_consts.if_const_debug.SingleUseConsts.panic-unwind.diff index 827a292e5d024..1285b8b33ba2d 100644 --- a/tests/mir-opt/single_use_consts.if_const_debug.SingleUseConsts.panic-unwind.diff +++ b/tests/mir-opt/single_use_consts.if_const_debug.SingleUseConsts.panic-unwind.diff @@ -22,7 +22,7 @@ bb1: { StorageDead(_2); StorageLive(_3); -- _3 = _1; +- _3 = copy _1; + _3 = const ::ASSOC_BOOL; switchInt(move _3) -> [0: bb3, otherwise: bb2]; } diff --git a/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-abort.diff b/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-abort.diff index 998b89919d1bd..354e0988a0060 100644 --- a/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-abort.diff +++ b/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-abort.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_1); - _1 = const ::ASSOC_INT; -- switchInt(_1) -> [7: bb3, 42: bb2, otherwise: bb1]; +- switchInt(copy _1) -> [7: bb3, 42: bb2, otherwise: bb1]; + nop; + switchInt(const ::ASSOC_INT) -> [7: bb3, 42: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-unwind.diff b/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-unwind.diff index 998b89919d1bd..354e0988a0060 100644 --- a/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-unwind.diff +++ b/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-unwind.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_1); - _1 = const ::ASSOC_INT; -- switchInt(_1) -> [7: bb3, 42: bb2, otherwise: bb1]; +- switchInt(copy _1) -> [7: bb3, 42: bb2, otherwise: bb1]; + nop; + switchInt(const ::ASSOC_INT) -> [7: bb3, 42: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-abort.diff b/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-abort.diff index 30f66ef6b8237..5cf37dc97cbff 100644 --- a/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-abort.diff +++ b/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-abort.diff @@ -20,7 +20,7 @@ bb1: { StorageDead(_2); -- switchInt(_1) -> [7: bb4, 42: bb3, otherwise: bb2]; +- switchInt(copy _1) -> [7: bb4, 42: bb3, otherwise: bb2]; + switchInt(const ::ASSOC_INT) -> [7: bb4, 42: bb3, otherwise: bb2]; } diff --git a/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-unwind.diff b/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-unwind.diff index ed12ad4b93e89..bdcf086e8d962 100644 --- a/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-unwind.diff +++ b/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-unwind.diff @@ -20,7 +20,7 @@ bb1: { StorageDead(_2); -- switchInt(_1) -> [7: bb4, 42: bb3, otherwise: bb2]; +- switchInt(copy _1) -> [7: bb4, 42: bb3, otherwise: bb2]; + switchInt(const ::ASSOC_INT) -> [7: bb4, 42: bb3, otherwise: bb2]; } diff --git a/tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir b/tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir index 3a8b457a7a109..4d1eaa6ffe324 100644 --- a/tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir +++ b/tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir @@ -28,7 +28,7 @@ fn std::ptr::drop_in_place(_1: *mut [String]) -> () { } bb4 (cleanup): { - _5 = Eq(_3, _2); + _5 = Eq(copy _3, copy _2); switchInt(move _5) -> [0: bb3, otherwise: bb2]; } @@ -39,7 +39,7 @@ fn std::ptr::drop_in_place(_1: *mut [String]) -> () { } bb6: { - _7 = Eq(_3, _2); + _7 = Eq(copy _3, copy _2); switchInt(move _7) -> [0: bb5, otherwise: bb1]; } diff --git a/tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff index 819f3f86d145f..478dacc327668 100644 --- a/tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff @@ -75,8 +75,8 @@ - _5 = move (_1.0: std::result::Result, ::Err>); + _5 = move _29; StorageLive(_6); -- _6 = (_1.1: u32); -+ _6 = _30; +- _6 = copy (_1.1: u32); ++ _6 = copy _30; _7 = discriminant(_5); switchInt(move _7) -> [0: bb2, otherwise: bb7]; } @@ -171,7 +171,7 @@ } bb11: { - switchInt(_25) -> [0: bb10, otherwise: bb12]; + switchInt(copy _25) -> [0: bb10, otherwise: bb12]; } bb12: { diff --git a/tests/mir-opt/sroa/structs.constant.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.constant.ScalarReplacementOfAggregates.diff index 5d21e79398238..4da3eb0ed7617 100644 --- a/tests/mir-opt/sroa/structs.constant.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa/structs.constant.ScalarReplacementOfAggregates.diff @@ -29,11 +29,11 @@ + _4 = move (_1.0: usize); + _5 = move (_1.1: u8); StorageLive(_2); -- _2 = (_1.0: usize); -+ _2 = _4; +- _2 = copy (_1.0: usize); ++ _2 = copy _4; StorageLive(_3); -- _3 = (_1.1: u8); -+ _3 = _5; +- _3 = copy (_1.1: u8); ++ _3 = copy _5; _0 = const (); StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/sroa/structs.copies.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.copies.ScalarReplacementOfAggregates.diff index 3621338635ed7..cfc086d65963f 100644 --- a/tests/mir-opt/sroa/structs.copies.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa/structs.copies.ScalarReplacementOfAggregates.diff @@ -43,38 +43,38 @@ bb0: { - StorageLive(_2); -- _2 = _1; +- _2 = copy _1; + StorageLive(_11); + StorageLive(_12); + StorageLive(_13); + StorageLive(_14); + nop; -+ _11 = (_1.0: u8); -+ _12 = (_1.1: ()); -+ _13 = (_1.2: &str); -+ _14 = (_1.3: std::option::Option); ++ _11 = copy (_1.0: u8); ++ _12 = copy (_1.1: ()); ++ _13 = copy (_1.2: &str); ++ _14 = copy (_1.3: std::option::Option); + nop; StorageLive(_3); -- _3 = (_2.0: u8); -+ _3 = _11; +- _3 = copy (_2.0: u8); ++ _3 = copy _11; StorageLive(_4); -- _4 = (_2.2: &str); +- _4 = copy (_2.2: &str); - StorageLive(_5); -- _5 = _2; -+ _4 = _13; +- _5 = copy _2; ++ _4 = copy _13; + StorageLive(_7); + StorageLive(_8); + StorageLive(_9); + StorageLive(_10); + nop; -+ _7 = _11; -+ _8 = _12; -+ _9 = _13; -+ _10 = _14; ++ _7 = copy _11; ++ _8 = copy _12; ++ _9 = copy _13; ++ _10 = copy _14; + nop; StorageLive(_6); -- _6 = (_5.1: ()); -+ _6 = _8; +- _6 = copy (_5.1: ()); ++ _6 = copy _8; _0 = const (); StorageDead(_6); - StorageDead(_5); diff --git a/tests/mir-opt/sroa/structs.enums.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.enums.ScalarReplacementOfAggregates.diff index b5e39e632476c..eda884de822a8 100644 --- a/tests/mir-opt/sroa/structs.enums.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa/structs.enums.ScalarReplacementOfAggregates.diff @@ -15,7 +15,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = Option::::Some(move _3); StorageDead(_3); _4 = discriminant(_2); @@ -24,8 +24,8 @@ bb1: { StorageLive(_5); - _5 = ((_2 as Some).0: usize); - _0 = _5; + _5 = copy ((_2 as Some).0: usize); + _0 = copy _5; StorageDead(_5); goto -> bb3; } diff --git a/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff index a84048365a4ba..77c7c1a901239 100644 --- a/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff @@ -49,18 +49,18 @@ StorageDead(_7); StorageDead(_6); StorageLive(_1); -- _1 = (_5.0: u8); -+ _1 = _8; +- _1 = copy (_5.0: u8); ++ _1 = copy _8; StorageLive(_2); -- _2 = (_5.1: ()); -+ _2 = _9; +- _2 = copy (_5.1: ()); ++ _2 = copy _9; StorageLive(_3); -- _3 = (_5.2: &str); -+ _3 = _10; +- _3 = copy (_5.2: &str); ++ _3 = copy _10; StorageLive(_4); -- _4 = (_5.3: std::option::Option); +- _4 = copy (_5.3: std::option::Option); - StorageDead(_5); -+ _4 = _11; ++ _4 = copy _11; + StorageDead(_8); + StorageDead(_9); + StorageDead(_10); diff --git a/tests/mir-opt/sroa/structs.ref_copies.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.ref_copies.ScalarReplacementOfAggregates.diff index 304bf2fb1a765..abe7cd78878fe 100644 --- a/tests/mir-opt/sroa/structs.ref_copies.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa/structs.ref_copies.ScalarReplacementOfAggregates.diff @@ -27,23 +27,23 @@ bb0: { - StorageLive(_2); -- _2 = (*_1); +- _2 = copy (*_1); + StorageLive(_5); + StorageLive(_6); + StorageLive(_7); + StorageLive(_8); + nop; -+ _5 = ((*_1).0: u8); -+ _6 = ((*_1).1: ()); -+ _7 = ((*_1).2: &str); -+ _8 = ((*_1).3: std::option::Option); ++ _5 = copy ((*_1).0: u8); ++ _6 = copy ((*_1).1: ()); ++ _7 = copy ((*_1).2: &str); ++ _8 = copy ((*_1).3: std::option::Option); + nop; StorageLive(_3); -- _3 = (_2.0: u8); -+ _3 = _5; +- _3 = copy (_2.0: u8); ++ _3 = copy _5; StorageLive(_4); -- _4 = (_2.2: &str); -+ _4 = _7; +- _4 = copy (_2.2: &str); ++ _4 = copy _7; _0 = const (); StorageDead(_4); StorageDead(_3); diff --git a/tests/mir-opt/sroa/structs.structs.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.structs.ScalarReplacementOfAggregates.diff index bf5c3e3bd0302..fe9deabe94078 100644 --- a/tests/mir-opt/sroa/structs.structs.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa/structs.structs.ScalarReplacementOfAggregates.diff @@ -15,15 +15,15 @@ + StorageLive(_5); + nop; StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = U { _foo: const 0_usize, a: move _3 }; + _4 = const 0_usize; + _5 = move _3; + nop; StorageDead(_3); -- _0 = (_2.1: f32); +- _0 = copy (_2.1: f32); - StorageDead(_2); -+ _0 = _5; ++ _0 = copy _5; + StorageDead(_4); + StorageDead(_5); + nop; diff --git a/tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff index 2f8dfcc5d6345..115f163cda9ba 100644 --- a/tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff @@ -10,10 +10,10 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = Repr { f: move _3 }; StorageDead(_3); - _0 = (_2.1: u32); + _0 = copy (_2.1: u32); StorageDead(_2); return; } diff --git a/tests/mir-opt/storage_ranges.main.nll.0.mir b/tests/mir-opt/storage_ranges.main.nll.0.mir index 782efd5acc625..bc2dcfe0a6459 100644 --- a/tests/mir-opt/storage_ranges.main.nll.0.mir +++ b/tests/mir-opt/storage_ranges.main.nll.0.mir @@ -43,7 +43,7 @@ fn main() -> () { StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; _4 = Option::::Some(move _5); StorageDead(_5); _3 = &_4; diff --git a/tests/mir-opt/switch_to_self.test.MatchBranchSimplification.diff b/tests/mir-opt/switch_to_self.test.MatchBranchSimplification.diff index c0b599e060b28..fef708d9962e5 100644 --- a/tests/mir-opt/switch_to_self.test.MatchBranchSimplification.diff +++ b/tests/mir-opt/switch_to_self.test.MatchBranchSimplification.diff @@ -9,11 +9,11 @@ } bb1: { - switchInt(_1) -> [0: bb1, otherwise: bb2]; + switchInt(copy _1) -> [0: bb1, otherwise: bb2]; } bb2: { - switchInt(_1) -> [0: bb1, otherwise: bb2]; + switchInt(copy _1) -> [0: bb1, otherwise: bb2]; } } diff --git a/tests/mir-opt/tail_call_drops.f.ElaborateDrops.panic-abort.diff b/tests/mir-opt/tail_call_drops.f.ElaborateDrops.panic-abort.diff index 44673ea00a966..17c64d4baf0ef 100644 --- a/tests/mir-opt/tail_call_drops.f.ElaborateDrops.panic-abort.diff +++ b/tests/mir-opt/tail_call_drops.f.ElaborateDrops.panic-abort.diff @@ -102,7 +102,7 @@ + } + + bb14 (cleanup): { -+ switchInt(_8) -> [0: bb11, otherwise: bb13]; ++ switchInt(copy _8) -> [0: bb11, otherwise: bb13]; } } diff --git a/tests/mir-opt/tail_call_drops.f.ElaborateDrops.panic-unwind.diff b/tests/mir-opt/tail_call_drops.f.ElaborateDrops.panic-unwind.diff index a6d33a2459543..58d8a87986d6b 100644 --- a/tests/mir-opt/tail_call_drops.f.ElaborateDrops.panic-unwind.diff +++ b/tests/mir-opt/tail_call_drops.f.ElaborateDrops.panic-unwind.diff @@ -103,7 +103,7 @@ + } + + bb14 (cleanup): { -+ switchInt(_8) -> [0: bb11, otherwise: bb13]; ++ switchInt(copy _8) -> [0: bb11, otherwise: bb13]; } } diff --git a/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-abort.diff b/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-abort.diff index c7df2bb2207fb..1a51601bc56f5 100644 --- a/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-abort.diff +++ b/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-abort.diff @@ -178,7 +178,7 @@ + } + + bb31 (cleanup): { -+ switchInt(_12) -> [0: bb26, otherwise: bb30]; ++ switchInt(copy _12) -> [0: bb26, otherwise: bb30]; } } diff --git a/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-unwind.diff b/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-unwind.diff index c7df2bb2207fb..1a51601bc56f5 100644 --- a/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-unwind.diff +++ b/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-unwind.diff @@ -178,7 +178,7 @@ + } + + bb31 (cleanup): { -+ switchInt(_12) -> [0: bb26, otherwise: bb30]; ++ switchInt(copy _12) -> [0: bb26, otherwise: bb30]; } } diff --git a/tests/mir-opt/unnamed-fields/field_access.bar.SimplifyCfg-initial.after.mir b/tests/mir-opt/unnamed-fields/field_access.bar.SimplifyCfg-initial.after.mir index f0311422c17b8..f1904e5d0f44e 100644 --- a/tests/mir-opt/unnamed-fields/field_access.bar.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/unnamed-fields/field_access.bar.SimplifyCfg-initial.after.mir @@ -15,7 +15,7 @@ fn bar(_1: Bar) -> () { bb0: { StorageLive(_2); StorageLive(_3); - _3 = (_1.0: u8); + _3 = copy (_1.0: u8); _2 = access::(move _3) -> [return: bb1, unwind: bb5]; } @@ -24,7 +24,7 @@ fn bar(_1: Bar) -> () { StorageDead(_2); StorageLive(_4); StorageLive(_5); - _5 = ((_1.1: Bar::{anon_adt#0}).0: i8); + _5 = copy ((_1.1: Bar::{anon_adt#0}).0: i8); _4 = access::(move _5) -> [return: bb2, unwind: bb5]; } @@ -33,7 +33,7 @@ fn bar(_1: Bar) -> () { StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = ((_1.1: Bar::{anon_adt#0}).1: bool); + _7 = copy ((_1.1: Bar::{anon_adt#0}).1: bool); _6 = access::(move _7) -> [return: bb3, unwind: bb5]; } @@ -42,7 +42,7 @@ fn bar(_1: Bar) -> () { StorageDead(_6); StorageLive(_8); StorageLive(_9); - _9 = (((_1.2: Bar::{anon_adt#1}).0: Bar::{anon_adt#1}::{anon_adt#0}).0: [u8; 1]); + _9 = copy (((_1.2: Bar::{anon_adt#1}).0: Bar::{anon_adt#1}::{anon_adt#0}).0: [u8; 1]); _8 = access::<[u8; 1]>(move _9) -> [return: bb4, unwind: bb5]; } diff --git a/tests/mir-opt/unnamed-fields/field_access.foo.SimplifyCfg-initial.after.mir b/tests/mir-opt/unnamed-fields/field_access.foo.SimplifyCfg-initial.after.mir index d48a969f06ebd..c279f59001210 100644 --- a/tests/mir-opt/unnamed-fields/field_access.foo.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/unnamed-fields/field_access.foo.SimplifyCfg-initial.after.mir @@ -15,7 +15,7 @@ fn foo(_1: Foo) -> () { bb0: { StorageLive(_2); StorageLive(_3); - _3 = (_1.0: u8); + _3 = copy (_1.0: u8); _2 = access::(move _3) -> [return: bb1, unwind: bb5]; } @@ -24,7 +24,7 @@ fn foo(_1: Foo) -> () { StorageDead(_2); StorageLive(_4); StorageLive(_5); - _5 = ((_1.1: Foo::{anon_adt#0}).0: i8); + _5 = copy ((_1.1: Foo::{anon_adt#0}).0: i8); _4 = access::(move _5) -> [return: bb2, unwind: bb5]; } @@ -33,7 +33,7 @@ fn foo(_1: Foo) -> () { StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = ((_1.1: Foo::{anon_adt#0}).1: bool); + _7 = copy ((_1.1: Foo::{anon_adt#0}).1: bool); _6 = access::(move _7) -> [return: bb3, unwind: bb5]; } @@ -42,7 +42,7 @@ fn foo(_1: Foo) -> () { StorageDead(_6); StorageLive(_8); StorageLive(_9); - _9 = (((_1.2: Foo::{anon_adt#1}).0: Foo::{anon_adt#1}::{anon_adt#0}).0: [u8; 1]); + _9 = copy (((_1.2: Foo::{anon_adt#1}).0: Foo::{anon_adt#1}::{anon_adt#0}).0: [u8; 1]); _8 = access::<[u8; 1]>(move _9) -> [return: bb4, unwind: bb5]; } diff --git a/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-abort.diff b/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-abort.diff index 1e1ddfae0eb9e..17ddce0cdf8d4 100644 --- a/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-abort.diff +++ b/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-abort.diff @@ -20,7 +20,7 @@ bb1: { _2 = discriminant(_1); - switchInt(move _2) -> [1: bb3, otherwise: bb2]; -+ _5 = Ne(_2, const 1_isize); ++ _5 = Ne(copy _2, const 1_isize); + assume(move _5); + goto -> bb2; } diff --git a/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-unwind.diff b/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-unwind.diff index 809d24aa15a13..2f78092f5bd24 100644 --- a/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-unwind.diff +++ b/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-unwind.diff @@ -20,7 +20,7 @@ bb1: { _2 = discriminant(_1); - switchInt(move _2) -> [1: bb3, otherwise: bb2]; -+ _5 = Ne(_2, const 1_isize); ++ _5 = Ne(copy _2, const 1_isize); + assume(move _5); + goto -> bb2; } diff --git a/tests/mir-opt/unreachable.if_let.UnreachablePropagation.panic-abort.diff b/tests/mir-opt/unreachable.if_let.UnreachablePropagation.panic-abort.diff index 61959732720e0..2ce37c4422b97 100644 --- a/tests/mir-opt/unreachable.if_let.UnreachablePropagation.panic-abort.diff +++ b/tests/mir-opt/unreachable.if_let.UnreachablePropagation.panic-abort.diff @@ -26,7 +26,7 @@ bb1: { _2 = discriminant(_1); - switchInt(move _2) -> [1: bb2, otherwise: bb6]; -+ _8 = Ne(_2, const 1_isize); ++ _8 = Ne(copy _2, const 1_isize); + assume(move _8); + goto -> bb6; } diff --git a/tests/mir-opt/unreachable.if_let.UnreachablePropagation.panic-unwind.diff b/tests/mir-opt/unreachable.if_let.UnreachablePropagation.panic-unwind.diff index 476e2f5599449..2dfba10c37df0 100644 --- a/tests/mir-opt/unreachable.if_let.UnreachablePropagation.panic-unwind.diff +++ b/tests/mir-opt/unreachable.if_let.UnreachablePropagation.panic-unwind.diff @@ -26,7 +26,7 @@ bb1: { _2 = discriminant(_1); - switchInt(move _2) -> [1: bb2, otherwise: bb6]; -+ _8 = Ne(_2, const 1_isize); ++ _8 = Ne(copy _2, const 1_isize); + assume(move _8); + goto -> bb6; } diff --git a/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-abort.diff b/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-abort.diff index 11d7924e7360e..ba268832ca3cc 100644 --- a/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-abort.diff +++ b/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-abort.diff @@ -35,9 +35,9 @@ _4 = move ((_2 as Some).0: Empty); StorageLive(_5); StorageLive(_6); - _6 = _1; + _6 = copy _1; - switchInt(move _6) -> [0: bb4, otherwise: bb3]; -+ _8 = Ne(_6, const false); ++ _8 = Ne(copy _6, const false); + assume(move _8); + goto -> bb3; } diff --git a/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-unwind.diff b/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-unwind.diff index df6f5609fbfa9..f057f7764704b 100644 --- a/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-unwind.diff +++ b/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-unwind.diff @@ -35,9 +35,9 @@ _4 = move ((_2 as Some).0: Empty); StorageLive(_5); StorageLive(_6); - _6 = _1; + _6 = copy _1; - switchInt(move _6) -> [0: bb4, otherwise: bb3]; -+ _8 = Ne(_6, const false); ++ _8 = Ne(copy _6, const false); + assume(move _8); + goto -> bb3; } diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-abort.diff index 4cd6d3f56833e..17e01f38f4eb1 100644 --- a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-abort.diff @@ -29,7 +29,7 @@ } bb2: { - switchInt(((_2 as A).0: i32)) -> [1: bb6, 2: bb5, otherwise: bb1]; + switchInt(copy ((_2 as A).0: i32)) -> [1: bb6, 2: bb5, otherwise: bb1]; } bb3: { diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff index 4cd6d3f56833e..17e01f38f4eb1 100644 --- a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff @@ -29,7 +29,7 @@ } bb2: { - switchInt(((_2 as A).0: i32)) -> [1: bb6, 2: bb5, otherwise: bb1]; + switchInt(copy ((_2 as A).0: i32)) -> [1: bb6, 2: bb5, otherwise: bb1]; } bb3: { From b9cffa7de071e8deae2b0c6b4780bba25f8ec875 Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Sun, 18 Aug 2024 16:09:03 -0700 Subject: [PATCH 4/4] Exclude the copy blessing from git blame --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 9fd8054a12e46..ec76a1a42ef09 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -25,3 +25,5 @@ b2d2184edea578109a48ec3d8decbee5948e8f35 ec2cc761bc7067712ecc7734502f703fe3b024c8 # format use declarations 84ac80f1921afc243d71fd0caaa4f2838c294102 +# bless mir-opt tests to add `copy` +99cb0c6bc399fb94a0ddde7e9b38e9c00d523bad