diff options
| author | Caio <c410.f3r@gmail.com> | 2021-01-01 15:38:11 -0300 |
|---|---|---|
| committer | Caio <c410.f3r@gmail.com> | 2021-01-07 18:54:12 -0300 |
| commit | f85fc264fecf5ab8b16c152dde8a440055323424 (patch) | |
| tree | 835f4f3a86c2019c5ac18f65c4cfa5de7fd297a4 /src/test | |
| parent | c8915eebeaaef9f7cc1cff6ffd97f578b03c2ac9 (diff) | |
Reintroduce hir::ExprKind::If
Diffstat (limited to 'src/test')
42 files changed, 415 insertions, 451 deletions
diff --git a/src/test/incremental/hashes/if_expressions.rs b/src/test/incremental/hashes/if_expressions.rs index 59af1fc09c2..ca8daae152c 100644 --- a/src/test/incremental/hashes/if_expressions.rs +++ b/src/test/incremental/hashes/if_expressions.rs @@ -94,7 +94,7 @@ pub fn add_else_branch(x: bool) -> u32 { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="hir_owner_nodes")] +#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,typeck")] #[rustc_clean(cfg="cfail3")] pub fn add_else_branch(x: bool) -> u32 { let mut ret = 1; diff --git a/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff b/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff index 0d06c4960b3..64c27039373 100644 --- a/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff +++ b/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff @@ -9,18 +9,12 @@ bb0: { StorageLive(_1); // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 - _1 = const <bool as NeedsDrop>::NEEDS; // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 -- switchInt(_1) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6 +- switchInt(move _1) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6 + _1 = const false; // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 -+ switchInt(const false) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6 ++ switchInt(const false) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6 } bb1: { - _0 = const (); // scope 0 at $DIR/control-flow-simplification.rs:14:6: 14:6 - StorageDead(_1); // scope 0 at $DIR/control-flow-simplification.rs:15:1: 15:2 - return; // scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2 - } - - bb2: { StorageLive(_2); // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL begin_panic::<&str>(const "explicit panic"); // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL // mir::Constant @@ -33,5 +27,11 @@ // + span: $SRC_DIR/std/src/macros.rs:LL:COL // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [16383], len: Size { raw: 14 } }, size: Size { raw: 14 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 }) } } + + bb2: { + _0 = const (); // scope 0 at $DIR/control-flow-simplification.rs:14:6: 14:6 + StorageDead(_1); // scope 0 at $DIR/control-flow-simplification.rs:14:5: 14:6 + return; // scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2 + } } diff --git a/src/test/mir-opt/deaggregator_test_enum_2.test1.Deaggregator.diff b/src/test/mir-opt/deaggregator_test_enum_2.test1.Deaggregator.diff index bf99f7efb4d..6d2dbb820f9 100644 --- a/src/test/mir-opt/deaggregator_test_enum_2.test1.Deaggregator.diff +++ b/src/test/mir-opt/deaggregator_test_enum_2.test1.Deaggregator.diff @@ -12,20 +12,10 @@ bb0: { StorageLive(_3); // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9 _3 = _1; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9 - switchInt(_3) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6 + switchInt(move _3) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6 } bb1: { - StorageLive(_5); // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17 - _5 = _2; // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17 -- _0 = Foo::B(move _5); // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18 -+ ((_0 as B).0: i32) = move _5; // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18 -+ discriminant(_0) = 1; // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18 - StorageDead(_5); // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:17: 13:18 - goto -> bb3; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6 - } - - bb2: { StorageLive(_4); // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17 _4 = _2; // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17 - _0 = Foo::A(move _4); // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18 @@ -35,8 +25,18 @@ goto -> bb3; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6 } + bb2: { + StorageLive(_5); // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17 + _5 = _2; // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17 +- _0 = Foo::B(move _5); // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18 ++ ((_0 as B).0: i32) = move _5; // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18 ++ discriminant(_0) = 1; // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18 + StorageDead(_5); // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:17: 13:18 + goto -> bb3; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6 + } + bb3: { - StorageDead(_3); // scope 0 at $DIR/deaggregator_test_enum_2.rs:15:1: 15:2 + StorageDead(_3); // scope 0 at $DIR/deaggregator_test_enum_2.rs:14:5: 14:6 return; // scope 0 at $DIR/deaggregator_test_enum_2.rs:15:2: 15:2 } } diff --git a/src/test/mir-opt/dest-prop/branch.main.DestinationPropagation.diff b/src/test/mir-opt/dest-prop/branch.main.DestinationPropagation.diff index 9c213eaed3c..e11d24cac8c 100644 --- a/src/test/mir-opt/dest-prop/branch.main.DestinationPropagation.diff +++ b/src/test/mir-opt/dest-prop/branch.main.DestinationPropagation.diff @@ -36,10 +36,16 @@ } bb2: { - switchInt(_3) -> [false: bb3, otherwise: bb4]; // scope 1 at $DIR/branch.rs:15:13: 20:6 + switchInt(move _3) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/branch.rs:15:13: 20:6 } bb3: { +- _2 = _1; // scope 1 at $DIR/branch.rs:16:9: 16:10 ++ nop; // scope 1 at $DIR/branch.rs:16:9: 16:10 + goto -> bb6; // scope 1 at $DIR/branch.rs:15:13: 20:6 + } + + bb4: { StorageLive(_4); // scope 1 at $DIR/branch.rs:18:9: 18:14 _4 = val() -> bb5; // scope 1 at $DIR/branch.rs:18:9: 18:14 // mir::Constant @@ -47,12 +53,6 @@ // + literal: Const { ty: fn() -> i32 {val}, val: Value(Scalar(<ZST>)) } } - bb4: { -- _2 = _1; // scope 1 at $DIR/branch.rs:16:9: 16:10 -+ nop; // scope 1 at $DIR/branch.rs:16:9: 16:10 - goto -> bb6; // scope 1 at $DIR/branch.rs:15:13: 20:6 - } - bb5: { StorageDead(_4); // scope 1 at $DIR/branch.rs:18:14: 18:15 - _2 = _1; // scope 1 at $DIR/branch.rs:19:9: 19:10 @@ -61,7 +61,7 @@ } bb6: { - StorageDead(_3); // scope 1 at $DIR/branch.rs:20:6: 20:7 + StorageDead(_3); // scope 1 at $DIR/branch.rs:20:5: 20:6 _0 = const (); // scope 0 at $DIR/branch.rs:12:11: 21:2 - StorageDead(_2); // scope 1 at $DIR/branch.rs:21:1: 21:2 - StorageDead(_1); // scope 0 at $DIR/branch.rs:21:1: 21:2 diff --git a/src/test/mir-opt/equal_true.opt.InstCombine.diff b/src/test/mir-opt/equal_true.opt.InstCombine.diff index a26776e70d6..1bc4c0f8b37 100644 --- a/src/test/mir-opt/equal_true.opt.InstCombine.diff +++ b/src/test/mir-opt/equal_true.opt.InstCombine.diff @@ -14,21 +14,21 @@ - _2 = Eq(move _3, const true); // scope 0 at $DIR/equal_true.rs:4:8: 4:17 + _2 = move _3; // scope 0 at $DIR/equal_true.rs:4:8: 4:17 StorageDead(_3); // scope 0 at $DIR/equal_true.rs:4:16: 4:17 - switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/equal_true.rs:4:5: 4:34 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/equal_true.rs:4:5: 4:34 } bb1: { - _0 = const 1_i32; // scope 0 at $DIR/equal_true.rs:4:31: 4:32 + _0 = const 0_i32; // scope 0 at $DIR/equal_true.rs:4:20: 4:21 goto -> bb3; // scope 0 at $DIR/equal_true.rs:4:5: 4:34 } bb2: { - _0 = const 0_i32; // scope 0 at $DIR/equal_true.rs:4:20: 4:21 + _0 = const 1_i32; // scope 0 at $DIR/equal_true.rs:4:31: 4:32 goto -> bb3; // scope 0 at $DIR/equal_true.rs:4:5: 4:34 } bb3: { - StorageDead(_2); // scope 0 at $DIR/equal_true.rs:5:1: 5:2 + StorageDead(_2); // scope 0 at $DIR/equal_true.rs:4:33: 4:34 return; // scope 0 at $DIR/equal_true.rs:5:2: 5:2 } } diff --git a/src/test/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff index 993ff660caa..875e5a0a71f 100644 --- a/src/test/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff @@ -9,21 +9,21 @@ bb0: { StorageLive(_2); // scope 0 at $DIR/if-condition-int.rs:17:8: 17:9 _2 = _1; // scope 0 at $DIR/if-condition-int.rs:17:8: 17:9 - switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:17:5: 17:26 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:17:5: 17:26 } bb1: { - _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:17:23: 17:24 + _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:17:12: 17:13 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:17:5: 17:26 } bb2: { - _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:17:12: 17:13 + _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:17:23: 17:24 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:17:5: 17:26 } bb3: { - StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:18:1: 18:2 + StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:17:25: 17:26 return; // scope 0 at $DIR/if-condition-int.rs:18:2: 18:2 } } diff --git a/src/test/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff index 8ae9168c950..2c4952402a4 100644 --- a/src/test/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff @@ -16,21 +16,21 @@ // + span: $DIR/if-condition-int.rs:53:13: 53:18 // + literal: Const { ty: f32, val: Value(Scalar(0xc2280000)) } StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:53:17: 53:18 - switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:53:5: 53:35 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:53:5: 53:35 } bb1: { - _0 = const 1_i32; // scope 0 at $DIR/if-condition-int.rs:53:32: 53:33 + _0 = const 0_i32; // scope 0 at $DIR/if-condition-int.rs:53:21: 53:22 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:53:5: 53:35 } bb2: { - _0 = const 0_i32; // scope 0 at $DIR/if-condition-int.rs:53:21: 53:22 + _0 = const 1_i32; // scope 0 at $DIR/if-condition-int.rs:53:32: 53:33 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:53:5: 53:35 } bb3: { - StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:54:1: 54:2 + StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:53:34: 53:35 return; // scope 0 at $DIR/if-condition-int.rs:54:2: 54:2 } } diff --git a/src/test/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff index ae0960028a8..661591658df 100644 --- a/src/test/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff @@ -13,26 +13,26 @@ _3 = _1; // scope 0 at $DIR/if-condition-int.rs:21:8: 21:9 - _2 = Eq(move _3, const 'x'); // scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 - StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:21:15: 21:16 -- switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:21:5: 21:33 -+ _2 = Eq(_3, const 'x'); // scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 +- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:21:5: 21:33 ++ nop; // scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 + nop; // scope 0 at $DIR/if-condition-int.rs:21:15: 21:16 -+ switchInt(move _3) -> ['x': bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:21:5: 21:33 ++ switchInt(move _3) -> ['x': bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:21:5: 21:33 } bb1: { + StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:21:5: 21:33 - _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:21:30: 21:31 + _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:21:19: 21:20 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:21:5: 21:33 } bb2: { + StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:21:5: 21:33 - _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:21:19: 21:20 + _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:21:30: 21:31 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:21:5: 21:33 } bb3: { - StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:22:1: 22:2 + StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:21:32: 21:33 return; // scope 0 at $DIR/if-condition-int.rs:22:2: 22:2 } } diff --git a/src/test/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff index 8d59e51ac2b..7d0ed7338d7 100644 --- a/src/test/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff @@ -13,26 +13,26 @@ _3 = _1; // scope 0 at $DIR/if-condition-int.rs:25:8: 25:9 - _2 = Eq(move _3, const 42_i8); // scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 - StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:25:14: 25:15 -- switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:25:5: 25:32 -+ _2 = Eq(_3, const 42_i8); // scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 +- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:25:5: 25:32 ++ nop; // scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 + nop; // scope 0 at $DIR/if-condition-int.rs:25:14: 25:15 -+ switchInt(move _3) -> [42_i8: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:25:5: 25:32 ++ switchInt(move _3) -> [42_i8: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:25:5: 25:32 } bb1: { + StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:25:5: 25:32 - _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:25:29: 25:30 + _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:25:18: 25:19 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:25:5: 25:32 } bb2: { + StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:25:5: 25:32 - _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:25:18: 25:19 + _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:25:29: 25:30 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:25:5: 25:32 } bb3: { - StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:26:1: 26:2 + StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:25:31: 25:32 return; // scope 0 at $DIR/if-condition-int.rs:26:2: 26:2 } } diff --git a/src/test/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff index c4975661efe..bf388a141b6 100644 --- a/src/test/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff @@ -15,40 +15,40 @@ _3 = _1; // scope 0 at $DIR/if-condition-int.rs:33:8: 33:9 - _2 = Eq(move _3, const 42_u32); // scope 0 at $DIR/if-condition-int.rs:33:8: 33:15 - StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:33:14: 33:15 -- switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:33:5: 39:6 -+ _2 = Eq(_3, const 42_u32); // scope 0 at $DIR/if-condition-int.rs:33:8: 33:15 +- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:33:5: 39:6 ++ nop; // scope 0 at $DIR/if-condition-int.rs:33:8: 33:15 + nop; // scope 0 at $DIR/if-condition-int.rs:33:14: 33:15 -+ switchInt(move _3) -> [42_u32: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:33:5: 39:6 ++ switchInt(move _3) -> [42_u32: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:33:5: 39:6 } bb1: { + StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:33:5: 39:6 + _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:34:9: 34:10 + goto -> bb6; // scope 0 at $DIR/if-condition-int.rs:33:5: 39:6 + } + + bb2: { ++ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:33:5: 39:6 StorageLive(_4); // scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 StorageLive(_5); // scope 0 at $DIR/if-condition-int.rs:35:15: 35:16 _5 = _1; // scope 0 at $DIR/if-condition-int.rs:35:15: 35:16 - _4 = Ne(move _5, const 21_u32); // scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 - StorageDead(_5); // scope 0 at $DIR/if-condition-int.rs:35:21: 35:22 -- switchInt(_4) -> [false: bb3, otherwise: bb4]; // scope 0 at $DIR/if-condition-int.rs:35:12: 39:6 -+ _4 = Ne(_5, const 21_u32); // scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 +- switchInt(move _4) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/if-condition-int.rs:35:12: 39:6 ++ nop; // scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 + nop; // scope 0 at $DIR/if-condition-int.rs:35:21: 35:22 -+ switchInt(move _5) -> [21_u32: bb3, otherwise: bb4]; // scope 0 at $DIR/if-condition-int.rs:35:12: 39:6 - } - - bb2: { -+ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:33:5: 39:6 - _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:34:9: 34:10 - goto -> bb6; // scope 0 at $DIR/if-condition-int.rs:33:5: 39:6 ++ switchInt(move _5) -> [21_u32: bb4, otherwise: bb3]; // scope 0 at $DIR/if-condition-int.rs:35:12: 39:6 } bb3: { + StorageDead(_5); // scope 0 at $DIR/if-condition-int.rs:35:12: 39:6 - _0 = const 2_u32; // scope 0 at $DIR/if-condition-int.rs:38:9: 38:10 + _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:36:9: 36:10 goto -> bb5; // scope 0 at $DIR/if-condition-int.rs:35:12: 39:6 } bb4: { + StorageDead(_5); // scope 0 at $DIR/if-condition-int.rs:35:12: 39:6 - _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:36:9: 36:10 + _0 = const 2_u32; // scope 0 at $DIR/if-condition-int.rs:38:9: 38:10 goto -> bb5; // scope 0 at $DIR/if-condition-int.rs:35:12: 39:6 } @@ -58,7 +58,7 @@ } bb6: { - StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:40:1: 40:2 + StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:39:5: 39:6 return; // scope 0 at $DIR/if-condition-int.rs:40:2: 40:2 } } diff --git a/src/test/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff index d7f544e44c0..bee2e030b7e 100644 --- a/src/test/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff @@ -13,26 +13,26 @@ _3 = _1; // scope 0 at $DIR/if-condition-int.rs:29:8: 29:9 - _2 = Eq(move _3, const -42_i32); // scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 - StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:29:15: 29:16 -- switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:29:5: 29:33 -+ _2 = Eq(_3, const -42_i32); // scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 +- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:29:5: 29:33 ++ nop; // scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 + nop; // scope 0 at $DIR/if-condition-int.rs:29:15: 29:16 -+ switchInt(move _3) -> [-42_i32: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:29:5: 29:33 ++ switchInt(move _3) -> [-42_i32: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:29:5: 29:33 } bb1: { + StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:29:5: 29:33 - _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:29:30: 29:31 + _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:29:19: 29:20 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:29:5: 29:33 } bb2: { + StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:29:5: 29:33 - _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:29:19: 29:20 + _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:29:30: 29:31 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:29:5: 29:33 } bb3: { - StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:30:1: 30:2 + StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:29:32: 29:33 return; // scope 0 at $DIR/if-condition-int.rs:30:2: 30:2 } } diff --git a/src/test/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff index 51e00e680c2..09a87591be1 100644 --- a/src/test/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff @@ -13,26 +13,26 @@ _3 = _1; // scope 0 at $DIR/if-condition-int.rs:12:8: 12:9 - _2 = Eq(move _3, const 42_u32); // scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 - StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:12:14: 12:15 -- switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:12:5: 12:32 -+ _2 = Eq(_3, const 42_u32); // scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 +- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:12:5: 12:32 ++ nop; // scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 + nop; // scope 0 at $DIR/if-condition-int.rs:12:14: 12:15 -+ switchInt(move _3) -> [42_u32: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:12:5: 12:32 ++ switchInt(move _3) -> [42_u32: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:12:5: 12:32 } bb1: { + StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:12:5: 12:32 - _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:12:29: 12:30 + _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:12:18: 12:19 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:12:5: 12:32 } bb2: { + StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:12:5: 12:32 - _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:12:18: 12:19 + _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:12:29: 12:30 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:12:5: 12:32 } bb3: { - StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:13:1: 13:2 + StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:12:31: 12:32 return; // scope 0 at $DIR/if-condition-int.rs:13:2: 13:2 } } diff --git a/src/test/mir-opt/inline/inline_diverging.g.Inline.diff b/src/test/mir-opt/inline/inline_diverging.g.Inline.diff index 3dc33354a5a..a746baa63eb 100644 --- a/src/test/mir-opt/inline/inline_diverging.g.Inline.diff +++ b/src/test/mir-opt/inline/inline_diverging.g.Inline.diff @@ -19,10 +19,19 @@ _3 = _1; // scope 0 at $DIR/inline-diverging.rs:13:8: 13:9 _2 = Gt(move _3, const 0_i32); // scope 0 at $DIR/inline-diverging.rs:13:8: 13:13 StorageDead(_3); // scope 0 at $DIR/inline-diverging.rs:13:12: 13:13 - switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/inline-diverging.rs:13:5: 17:6 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/inline-diverging.rs:13:5: 17:6 } bb1: { + StorageLive(_4); // scope 0 at $DIR/inline-diverging.rs:14:9: 14:10 + _4 = _1; // scope 0 at $DIR/inline-diverging.rs:14:9: 14:10 + _0 = move _4 as u32 (Misc); // scope 0 at $DIR/inline-diverging.rs:14:9: 14:17 + StorageDead(_4); // scope 0 at $DIR/inline-diverging.rs:14:16: 14:17 + StorageDead(_2); // scope 0 at $DIR/inline-diverging.rs:17:5: 17:6 + return; // scope 0 at $DIR/inline-diverging.rs:18:2: 18:2 + } + + bb2: { StorageLive(_6); // scope 0 at $DIR/inline-diverging.rs:16:9: 16:16 - panic(); // scope 0 at $DIR/inline-diverging.rs:16:9: 16:16 + StorageLive(_7); // scope 0 at $DIR/inline-diverging.rs:16:9: 16:16 @@ -39,14 +48,5 @@ + // + span: $DIR/inline-diverging.rs:16:9: 16:16 + // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [16383], len: Size { raw: 14 } }, size: Size { raw: 14 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 }) } } - - bb2: { - StorageLive(_4); // scope 0 at $DIR/inline-diverging.rs:14:9: 14:10 - _4 = _1; // scope 0 at $DIR/inline-diverging.rs:14:9: 14:10 - _0 = move _4 as u32 (Misc); // scope 0 at $DIR/inline-diverging.rs:14:9: 14:17 - StorageDead(_4); // scope 0 at $DIR/inline-diverging.rs:14:16: 14:17 - StorageDead(_2); // scope 0 at $DIR/inline-diverging.rs:18:1: 18:2 - return; // scope 0 at $DIR/inline-diverging.rs:18:2: 18:2 - } } diff --git a/src/test/mir-opt/inline/inline_generator.main.Inline.diff b/src/test/mir-opt/inline/inline_generator.main.Inline.diff index 99497a6fc79..066ac8d82d3 100644 --- a/src/test/mir-opt/inline/inline_generator.main.Inline.diff +++ b/src/test/mir-opt/inline/inline_generator.main.Inline.diff @@ -90,16 +90,16 @@ + + bb3: { + _8 = move _7; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46 -+ switchInt(_8) -> [false: bb4, otherwise: bb5]; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46 ++ switchInt(move _8) -> [false: bb5, otherwise: bb4]; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46 + } + + bb4: { -+ ((_1 as Yielded).0: i32) = const 13_i32; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46 ++ ((_1 as Yielded).0: i32) = const 7_i32; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46 + goto -> bb6; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46 + } + + bb5: { -+ ((_1 as Yielded).0: i32) = const 7_i32; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46 ++ ((_1 as Yielded).0: i32) = const 13_i32; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46 + goto -> bb6; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46 + } + diff --git a/src/test/mir-opt/inst_combine_deref.do_not_miscompile.InstCombine.diff b/src/test/mir-opt/inst_combine_deref.do_not_miscompile.InstCombine.diff index a8b523d06df..ee8fcdcde40 100644 --- a/src/test/mir-opt/inst_combine_deref.do_not_miscompile.InstCombine.diff +++ b/src/test/mir-opt/inst_combine_deref.do_not_miscompile.InstCombine.diff @@ -53,22 +53,10 @@ StorageDead(_10); // scope 4 at $DIR/inst_combine_deref.rs:60:20: 60:21 _8 = Not(move _9); // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23 StorageDead(_9); // scope 4 at $DIR/inst_combine_deref.rs:60:22: 60:23 - switchInt(_8) -> [false: bb1, otherwise: bb2]; // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23 + switchInt(move _8) -> [false: bb2, otherwise: bb1]; // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23 } bb1: { - _7 = const (); // scope 4 at $DIR/inst_combine_deref.rs:60:23: 60:23 - StorageDead(_8); // scope 4 at $DIR/inst_combine_deref.rs:60:22: 60:23 - StorageDead(_7); // scope 4 at $DIR/inst_combine_deref.rs:60:22: 60:23 - _0 = const (); // scope 0 at $DIR/inst_combine_deref.rs:54:24: 61:2 - StorageDead(_4); // scope 3 at $DIR/inst_combine_deref.rs:61:1: 61:2 - StorageDead(_3); // scope 2 at $DIR/inst_combine_deref.rs:61:1: 61:2 - StorageDead(_2); // scope 1 at $DIR/inst_combine_deref.rs:61:1: 61:2 - StorageDead(_1); // scope 0 at $DIR/inst_combine_deref.rs:61:1: 61:2 - return; // scope 0 at $DIR/inst_combine_deref.rs:61:2: 61:2 - } - - bb2: { StorageLive(_11); // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23 core::panicking::panic(const "assertion failed: *y == 99"); // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23 // mir::Constant @@ -81,5 +69,17 @@ // + span: $DIR/inst_combine_deref.rs:1:1: 1:1 // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [97, 115, 115, 101, 114, 116, 105, 111, 110, 32, 102, 97, 105, 108, 101, 100, 58, 32, 42, 121, 32, 61, 61, 32, 57, 57], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [67108863], len: Size { raw: 26 } }, size: Size { raw: 26 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 26 }) } } + + bb2: { + _7 = const (); // scope 4 at $DIR/inst_combine_deref.rs:60:23: 60:23 + StorageDead(_8); // scope 4 at $DIR/inst_combine_deref.rs:60:22: 60:23 + StorageDead(_7); // scope 4 at $DIR/inst_combine_deref.rs:60:22: 60:23 + _0 = const (); // scope 0 at $DIR/inst_combine_deref.rs:54:24: 61:2 + StorageDead(_4); // scope 3 at $DIR/inst_combine_deref.rs:61:1: 61:2 + StorageDead(_3); // scope 2 at $DIR/inst_combine_deref.rs:61:1: 61:2 + StorageDead(_2); // scope 1 at $DIR/inst_combine_deref.rs:61:1: 61:2 + StorageDead(_1); // scope 0 at $DIR/inst_combine_deref.rs:61:1: 61:2 + return; // scope 0 at $DIR/inst_combine_deref.rs:61:2: 61:2 + } } diff --git a/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir b/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir index 30036e4034a..e9e5a101a64 100644 --- a/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir +++ b/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir @@ -19,19 +19,22 @@ fn main() -> () { } bb1: { - falseUnwind -> [real: bb2, cleanup: bb6]; // scope 1 at $DIR/issue-38669.rs:6:5: 11:6 + falseUnwind -> [real: bb2, cleanup: bb5]; // scope 1 at $DIR/issue-38669.rs:6:5: 11:6 } bb2: { StorageLive(_3); // scope 1 at $DIR/issue-38669.rs:7:9: 9:10 StorageLive(_4); // scope 1 at $DIR/issue-38669.rs:7:12: 7:24 _4 = _1; // scope 1 at $DIR/issue-38669.rs:7:12: 7:24 - FakeRead(ForMatchedPlace, _4); // scope 1 at $DIR/issue-38669.rs:7:12: 7:24 - switchInt(_4) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/issue-38669.rs:7:9: 9:10 + switchInt(move _4) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/issue-38669.rs:7:9: 9:10 } bb3: { - falseEdge -> [real: bb5, imaginary: bb4]; // scope 1 at $DIR/issue-38669.rs:7:9: 9:10 + _0 = const (); // scope 1 at $DIR/issue-38669.rs:8:13: 8:18 + StorageDead(_4); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10 + StorageDead(_3); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10 + StorageDead(_1); // scope 0 at $DIR/issue-38669.rs:12:1: 12:2 + return; // scope 0 at $DIR/issue-38669.rs:12:2: 12:2 } bb4: { @@ -43,15 +46,7 @@ fn main() -> () { goto -> bb1; // scope 1 at $DIR/issue-38669.rs:6:5: 11:6 } - bb5: { - _0 = const (); // scope 1 at $DIR/issue-38669.rs:8:13: 8:18 - StorageDead(_4); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10 - StorageDead(_3); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10 - StorageDead(_1); // scope 0 at $DIR/issue-38669.rs:12:1: 12:2 - return; // scope 0 at $DIR/issue-38669.rs:12:2: 12:2 - } - - bb6 (cleanup): { + bb5 (cleanup): { resume; // scope 0 at $DIR/issue-38669.rs:4:1: 12:2 } } diff --git a/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir b/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir index 5011c2adfa5..4fc7f9daa22 100644 --- a/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir +++ b/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir @@ -33,15 +33,10 @@ fn main() -> () { } bb1: { - switchInt(_2) -> [false: bb2, otherwise: bb3]; // scope 1 at $DIR/issue-41888.rs:8:5: 14:6 + switchInt(move _2) -> [false: bb3, otherwise: bb2]; // scope 1 at $DIR/issue-41888.rs:8:5: 14:6 } bb2: { - _0 = const (); // scope 1 at $DIR/issue-41888.rs:14:6: 14:6 - goto -> bb7; // scope 1 at $DIR/issue-41888.rs:8:5: 14:6 - } - - bb3: { StorageLive(_3); // scope 1 at $DIR/issue-41888.rs:9:13: 9:20 StorageLive(_4); // scope 1 at $DIR/issue-41888.rs:9:18: 9:19 _4 = K; // scope 1 at $DIR/issue-41888.rs:9:18: 9:19 @@ -50,6 +45,11 @@ fn main() -> () { goto -> bb12; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 } + bb3: { + _0 = const (); // scope 1 at $DIR/issue-41888.rs:14:6: 14:6 + goto -> bb7; // scope 1 at $DIR/issue-41888.rs:8:5: 14:6 + } + bb4: { StorageDead(_3); // scope 1 at $DIR/issue-41888.rs:9:19: 9:20 _5 = discriminant(_1); // scope 1 at $DIR/issue-41888.rs:10:16: 10:24 @@ -71,6 +71,7 @@ fn main() -> () { } bb7: { + StorageDead(_2); // scope 1 at $DIR/issue-41888.rs:14:5: 14:6 goto -> bb18; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 } @@ -79,7 +80,6 @@ fn main() -> () { _8 = const false; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 _9 = const false; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 StorageDead(_1); // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 - StorageDead(_2); // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 return; // scope 0 at $DIR/issue-41888.rs:15:2: 15:2 } diff --git a/src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff b/src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff index 4db83c5c683..435b2a1360a 100644 --- a/src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff +++ b/src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff @@ -99,19 +99,10 @@ StorageDead(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _9 = Not(move _10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(_9) -> [false: bb1, otherwise: bb2]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(move _9) -> [false: bb2, otherwise: bb1]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb1: { - StorageDead(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 - StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 - return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 - } - - bb2: { _13 = const main::promoted[0]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // ty::Const // + ty: &[&str; 3] @@ -143,6 +134,15 @@ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } } + bb2: { + StorageDead(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 + StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 + return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 + } + bb3: { (_20.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _24) -> bb4; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant diff --git a/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff b/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff index 4db83c5c683..435b2a1360a 100644 --- a/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff +++ b/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff @@ -99,19 +99,10 @@ StorageDead(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _9 = Not(move _10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(_9) -> [false: bb1, otherwise: bb2]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(move _9) -> [false: bb2, otherwise: bb1]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb1: { - StorageDead(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 - StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 - return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 - } - - bb2: { _13 = const main::promoted[0]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // ty::Const // + ty: &[&str; 3] @@ -143,6 +134,15 @@ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } } + bb2: { + StorageDead(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 + StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 + return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 + } + bb3: { (_20.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _24) -> bb4; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant diff --git a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff index 4e362f3556b..d87cb2af8ba 100644 --- a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff +++ b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff @@ -151,23 +151,10 @@ StorageDead(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _15 = Not(move _16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(_15) -> [false: bb3, otherwise: bb4]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(move _15) -> [false: bb4, otherwise: bb3]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb3: { - _8 = const (); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_13); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 - StorageDead(_6); // scope 1 at $DIR/issue-73223.rs:9:1: 9:2 - StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 - return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 - } - - bb4: { StorageLive(_19); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_21); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -222,6 +209,19 @@ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } } + bb4: { + _8 = const (); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_13); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 + StorageDead(_6); // scope 1 at $DIR/issue-73223.rs:9:1: 9:2 + StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 + return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 + } + bb5: { StorageDead(_45); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_46); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL diff --git a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff index 4e362f3556b..d87cb2af8ba 100644 --- a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff +++ b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff @@ -151,23 +151,10 @@ StorageDead(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _15 = Not(move _16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(_15) -> [false: bb3, otherwise: bb4]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(move _15) -> [false: bb4, otherwise: bb3]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb3: { - _8 = const (); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_13); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 - StorageDead(_6); // scope 1 at $DIR/issue-73223.rs:9:1: 9:2 - StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 - return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 - } - - bb4: { StorageLive(_19); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_21); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -222,6 +209,19 @@ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } } + bb4: { + _8 = const (); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_13); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 + StorageDead(_6); // scope 1 at $DIR/issue-73223.rs:9:1: 9:2 + StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 + return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 + } + bb5: { StorageDead(_45); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_46); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL diff --git a/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir b/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir index 56df50c0893..f109937dbf9 100644 --- a/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir +++ b/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir @@ -16,12 +16,14 @@ fn main() -> () { StorageLive(_1); // scope 0 at $DIR/loop_test.rs:10:5: 12:6 StorageLive(_2); // scope 0 at $DIR/loop_test.rs:10:8: 10:12 _2 = const true; // scope 0 at $DIR/loop_test.rs:10:8: 10:12 - FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/loop_test.rs:10:8: 10:12 - switchInt(_2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/loop_test.rs:10:5: 12:6 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/loop_test.rs:10:5: 12:6 } bb1: { - falseEdge -> [real: bb3, imaginary: bb2]; // scope 0 at $DIR/loop_test.rs:10:5: 12:6 + _0 = const (); // scope 0 at $DIR/loop_test.rs:11:9: 11:15 + StorageDead(_2); // scope 0 at $DIR/loop_test.rs:12:5: 12:6 + StorageDead(_1); // scope 0 at $DIR/loop_test.rs:12:5: 12:6 + return; // scope 0 at $DIR/loop_test.rs:17:2: 17:2 } bb2: { @@ -29,29 +31,22 @@ fn main() -> () { StorageDead(_2); // scope 0 at $DIR/loop_test.rs:12:5: 12:6 StorageDead(_1); // scope 0 at $DIR/loop_test.rs:12:5: 12:6 StorageLive(_4); // scope 0 at $DIR/loop_test.rs:13:5: 16:6 - goto -> bb4; // scope 0 at $DIR/loop_test.rs:13:5: 16:6 + goto -> bb3; // scope 0 at $DIR/loop_test.rs:13:5: 16:6 } bb3: { - _0 = const (); // scope 0 at $DIR/loop_test.rs:11:9: 11:15 - StorageDead(_2); // scope 0 at $DIR/loop_test.rs:12:5: 12:6 - StorageDead(_1); // scope 0 at $DIR/loop_test.rs:12:5: 12:6 - return; // scope 0 at $DIR/loop_test.rs:17:2: 17:2 + falseUnwind -> [real: bb4, cleanup: bb5]; // scope 0 at $DIR/loop_test.rs:13:5: 16:6 } bb4: { - falseUnwind -> [real: bb5, cleanup: bb6]; // scope 0 at $DIR/loop_test.rs:13:5: 16:6 - } - - bb5: { StorageLive(_6); // scope 0 at $DIR/loop_test.rs:14:13: 14:14 _6 = const 1_i32; // scope 0 at $DIR/loop_test.rs:14:17: 14:18 FakeRead(ForLet, _6); // scope 0 at $DIR/loop_test.rs:14:13: 14:14 StorageDead(_6); // scope 0 at $DIR/loop_test.rs:16:5: 16:6 - goto -> bb4; // scope 0 at $DIR/loop_test.rs:1:1: 1:1 + goto -> bb3; // scope 0 at $DIR/loop_test.rs:1:1: 1:1 } - bb6 (cleanup): { + bb5 (cleanup): { resume; // scope 0 at $DIR/loop_test.rs:6:1: 17:2 } } diff --git a/src/test/mir-opt/lower_intrinsics.f_u64.PreCodegen.before.mir b/src/test/mir-opt/lower_intrinsics.f_u64.PreCodegen.before.mir index 654dd8275c9..740a6e0edb0 100644 --- a/src/test/mir-opt/lower_intrinsics.f_u64.PreCodegen.before.mir +++ b/src/test/mir-opt/lower_intrinsics.f_u64.PreCodegen.before.mir @@ -3,24 +3,28 @@ fn f_u64() -> () { let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:34:16: 34:16 scope 1 (inlined f_dispatch::<u64>) { // at $DIR/lower_intrinsics.rs:35:5: 35:21 - debug t => _2; // in scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 - let _1: (); // in scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 - let mut _2: u64; // in scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + debug t => _1; // in scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + let mut _1: u64; // in scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + let _2: (); // in scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + let mut _3: u64; // in scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 scope 2 (inlined std::mem::size_of::<u64>) { // at $DIR/lower_intrinsics.rs:35:5: 35:21 } } bb0: { - _2 = const 0_u64; // scope 0 at $DIR/lower_intrinsics.rs:35:5: 35:21 - StorageLive(_1); // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 - _1 = f_non_zst::<u64>(move _2) -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + _1 = const 0_u64; // scope 0 at $DIR/lower_intrinsics.rs:35:5: 35:21 + StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + StorageLive(_3); // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + _3 = move _1; // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + _2 = f_non_zst::<u64>(move _3) -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 // mir::Constant // + span: $DIR/lower_intrinsics.rs:35:5: 35:21 // + literal: Const { ty: fn(u64) {f_non_zst::<u64>}, val: Value(Scalar(<ZST>)) } } bb1: { - StorageDead(_1); // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + StorageDead(_3); // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + StorageDead(_2); // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 _0 = const (); // scope 0 at $DIR/lower_intrinsics.rs:34:16: 36:2 return; // scope 0 at $DIR/lower_intrinsics.rs:36:2: 36:2 } diff --git a/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff b/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff index 4e7cd77035e..95beab2ec9a 100644 --- a/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff +++ b/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff @@ -47,7 +47,7 @@ } bb3: { -- falseEdge -> [real: bb14, imaginary: bb5]; // scope 0 at $DIR/match-arm-scopes.rs:15:25: 15:38 +- falseEdge -> [real: bb13, imaginary: bb5]; // scope 0 at $DIR/match-arm-scopes.rs:15:25: 15:38 - } - - bb4: { @@ -55,7 +55,7 @@ - } - - bb5: { -- falseEdge -> [real: bb22, imaginary: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:16:9: 16:21 +- falseEdge -> [real: bb20, imaginary: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:16:9: 16:21 - } - - bb6: { @@ -63,14 +63,14 @@ _15 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:32: 16:33 StorageLive(_16); // scope 0 at $DIR/match-arm-scopes.rs:16:35: 16:36 _16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:35: 16:36 -- goto -> bb21; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 +- goto -> bb19; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 + goto -> bb16; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 } - bb7: { + bb4: { _0 = const 1_i32; // scope 1 at $DIR/match-arm-scopes.rs:15:77: 15:78 -- drop(_7) -> [return: bb20, unwind: bb27]; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 +- drop(_7) -> [return: bb18, unwind: bb25]; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 + drop(_7) -> [return: bb15, unwind: bb22]; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 } @@ -85,33 +85,28 @@ StorageLive(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 StorageLive(_10); // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 _10 = _1; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 -- FakeRead(ForMatchedPlace, _10); // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 -- switchInt(_10) -> [false: bb10, otherwise: bb9]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 -+ switchInt(_10) -> [false: bb6, otherwise: bb7]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 +- switchInt(move _10) -> [false: bb10, otherwise: bb9]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 ++ switchInt(move _10) -> [false: bb7, otherwise: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 } - bb9: { -- falseEdge -> [real: bb11, imaginary: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 -- } -- -- bb10: { + bb6: { - _9 = (*_6); // scope 0 at $DIR/match-arm-scopes.rs:15:70: 15:71 + _0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60 StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 -- switchInt(move _9) -> [false: bb13, otherwise: bb12]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 -+ switchInt(move _9) -> [false: bb9, otherwise: bb8]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 + StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 +- goto -> bb23; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 ++ goto -> bb20; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 } -- bb11: { +- bb10: { + bb7: { - _0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60 + _9 = (*_6); // scope 0 at $DIR/match-arm-scopes.rs:15:70: 15:71 StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 - StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 -- goto -> bb25; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 -+ goto -> bb20; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 +- switchInt(move _9) -> [false: bb12, otherwise: bb11]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 ++ switchInt(move _9) -> [false: bb9, otherwise: bb8]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 } -- bb12: { +- bb11: { + bb8: { StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 - FakeRead(ForMatchGuard, _3); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 @@ -126,7 +121,7 @@ + goto -> bb4; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 } -- bb13: { +- bb12: { + bb9: { StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 @@ -135,7 +130,7 @@ + goto -> bb1; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 } -- bb14: { +- bb13: { + bb10: { StorageLive(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:26: 15:27 _6 = &(_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:26: 15:27 @@ -146,33 +141,28 @@ StorageLive(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 StorageLive(_13); // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 _13 = _1; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 -- FakeRead(ForMatchedPlace, _13); // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 -- switchInt(_13) -> [false: bb16, otherwise: bb15]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 -+ switchInt(_13) -> [false: bb11, otherwise: bb12]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 +- switchInt(move _13) -> [false: bb15, otherwise: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 ++ switchInt(move _13) -> [false: bb12, otherwise: bb11]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 } -- bb15: { -- falseEdge -> [real: bb17, imaginary: bb16]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 -- } -- -- bb16: { +- bb14: { + bb11: { - _12 = (*_6); // scope 0 at $DIR/match-arm-scopes.rs:15:70: 15:71 + _0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60 StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 -- switchInt(move _12) -> [false: bb19, otherwise: bb18]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 -+ switchInt(move _12) -> [false: bb14, otherwise: bb13]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 + StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 +- goto -> bb23; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 ++ goto -> bb20; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 } -- bb17: { +- bb15: { + bb12: { - _0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60 + _12 = (*_6); // scope 0 at $DIR/match-arm-scopes.rs:15:70: 15:71 StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 - StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 -- goto -> bb25; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 -+ goto -> bb20; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 +- switchInt(move _12) -> [false: bb17, otherwise: bb16]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 ++ switchInt(move _12) -> [false: bb14, otherwise: bb13]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 } -- bb18: { +- bb16: { + bb13: { StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 - FakeRead(ForMatchGuard, _3); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 @@ -187,7 +177,7 @@ + goto -> bb4; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 } -- bb19: { +- bb17: { + bb14: { StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 @@ -196,67 +186,67 @@ + goto -> bb2; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 } -- bb20: { +- bb18: { + bb15: { StorageDead(_7); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_5); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 -- goto -> bb24; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 +- goto -> bb22; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 + goto -> bb19; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 } -- bb21: { +- bb19: { + bb16: { _0 = const 2_i32; // scope 2 at $DIR/match-arm-scopes.rs:16:41: 16:42 -- drop(_16) -> [return: bb23, unwind: bb27]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42 +- drop(_16) -> [return: bb21, unwind: bb25]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42 + drop(_16) -> [return: bb18, unwind: bb22]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42 } -- bb22: { +- bb20: { + bb17: { StorageLive(_15); // scope 0 at $DIR/match-arm-scopes.rs:16:16: 16:17 _15 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:16: 16:17 StorageLive(_16); // scope 0 at $DIR/match-arm-scopes.rs:16:19: 16:20 _16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:19: 16:20 -- goto -> bb21; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 +- goto -> bb19; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 + goto -> bb16; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 } -- bb23: { +- bb21: { + bb18: { StorageDead(_16); // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42 StorageDead(_15); // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42 -- goto -> bb24; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 +- goto -> bb22; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 + goto -> bb19; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 } -- bb24: { -- drop(_2) -> [return: bb26, unwind: bb28]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 +- bb22: { +- drop(_2) -> [return: bb24, unwind: bb26]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 + bb19: { + goto -> bb26; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 } -- bb25: { +- bb23: { + bb20: { StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 -- drop(_2) -> [return: bb26, unwind: bb28]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 +- drop(_2) -> [return: bb24, unwind: bb26]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 + drop(_2) -> [return: bb21, unwind: bb23]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 } -- bb26: { +- bb24: { + bb21: { return; // scope 0 at $DIR/match-arm-scopes.rs:18:2: 18:2 } -- bb27 (cleanup): { -- drop(_2) -> bb28; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 +- bb25 (cleanup): { +- drop(_2) -> bb26; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 + bb22 (cleanup): { + goto -> bb27; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 } -- bb28 (cleanup): { +- bb26 (cleanup): { + bb23 (cleanup): { resume; // scope 0 at $DIR/match-arm-scopes.rs:13:1: 18:2 + } diff --git a/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.32bit.diff b/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.32bit.diff index d0b1a96b9ae..20240348230 100644 --- a/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.32bit.diff +++ b/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.32bit.diff @@ -30,7 +30,7 @@ } bb3: { - switchInt(_2) -> [false: bb4, otherwise: bb5]; // scope 0 at $DIR/matches_reduce_branches.rs:7:5: 9:6 + switchInt(move _2) -> [false: bb4, otherwise: bb5]; // scope 0 at $DIR/matches_reduce_branches.rs:7:5: 9:6 } bb4: { @@ -39,7 +39,7 @@ } bb5: { - StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:10:1: 10:2 + StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:9:5: 9:6 return; // scope 0 at $DIR/matches_reduce_branches.rs:10:2: 10:2 } } diff --git a/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.64bit.diff b/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.64bit.diff index d0b1a96b9ae..20240348230 100644 --- a/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.64bit.diff +++ b/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.64bit.diff @@ -30,7 +30,7 @@ } bb3: { - switchInt(_2) -> [false: bb4, otherwise: bb5]; // scope 0 at $DIR/matches_reduce_branches.rs:7:5: 9:6 + switchInt(move _2) -> [false: bb4, otherwise: bb5]; // scope 0 at $DIR/matches_reduce_branches.rs:7:5: 9:6 } bb4: { @@ -39,7 +39,7 @@ } bb5: { - StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:10:1: 10:2 + StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:9:5: 9:6 return; // scope 0 at $DIR/matches_reduce_branches.rs:10:2: 10:2 } } diff --git a/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.32bit.diff b/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.32bit.diff index 1f46d3777be..1d895852354 100644 --- a/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.32bit.diff +++ b/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.32bit.diff @@ -25,9 +25,9 @@ StorageLive(_5); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 StorageLive(_6); // scope 0 at $DIR/matches_reduce_branches.rs:40:24: 40:28 _6 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:24: 40:28 -- switchInt(_6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 +- switchInt(move _6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 + StorageLive(_7); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 -+ _7 = _6; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 ++ _7 = move _6; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 + _5 = Ne(_7, const false); // scope 0 at $DIR/matches_reduce_branches.rs:40:42: 40:47 + StorageDead(_7); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 + goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 @@ -45,41 +45,41 @@ bb3: { StorageDead(_6); // scope 0 at $DIR/matches_reduce_branches.rs:40:47: 40:48 -- switchInt(_5) -> [false: bb4, otherwise: bb5]; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 +- switchInt(move _5) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 + StorageLive(_8); // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 -+ _8 = _5; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 ++ _8 = move _5; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 + _4 = Ne(_8, const false); // scope 0 at $DIR/matches_reduce_branches.rs:40:62: 40:67 + StorageDead(_8); // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 + goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 } bb4: { - _4 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:62: 40:67 + _4 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:50: 40:54 goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 } bb5: { - _4 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:50: 40:54 + _4 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:62: 40:67 goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 } bb6: { StorageDead(_5); // scope 0 at $DIR/matches_reduce_branches.rs:40:67: 40:68 -- switchInt(_4) -> [false: bb7, otherwise: bb8]; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 +- switchInt(move _4) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 + StorageLive(_9); // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 -+ _9 = _4; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 ++ _9 = move _4; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 + _3 = Ne(_9, const false); // scope 0 at $DIR/matches_reduce_branches.rs:40:82: 40:87 + StorageDead(_9); // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 + goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 } bb7: { - _3 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:82: 40:87 + _3 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:70: 40:74 goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 } bb8: { - _3 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:70: 40:74 + _3 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:82: 40:87 goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 } diff --git a/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.64bit.diff b/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.64bit.diff index 1f46d3777be..1d895852354 100644 --- a/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.64bit.diff +++ b/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.64bit.diff @@ -25,9 +25,9 @@ StorageLive(_5); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 StorageLive(_6); // scope 0 at $DIR/matches_reduce_branches.rs:40:24: 40:28 _6 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:24: 40:28 -- switchInt(_6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 +- switchInt(move _6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 + StorageLive(_7); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 -+ _7 = _6; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 ++ _7 = move _6; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 + _5 = Ne(_7, const false); // scope 0 at $DIR/matches_reduce_branches.rs:40:42: 40:47 + StorageDead(_7); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 + goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 @@ -45,41 +45,41 @@ bb3: { StorageDead(_6); // scope 0 at $DIR/matches_reduce_branches.rs:40:47: 40:48 -- switchInt(_5) -> [false: bb4, otherwise: bb5]; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 +- switchInt(move _5) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 + StorageLive(_8); // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 -+ _8 = _5; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 ++ _8 = move _5; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 + _4 = Ne(_8, const false); // scope 0 at $DIR/matches_reduce_branches.rs:40:62: 40:67 + StorageDead(_8); // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 + goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 } bb4: { - _4 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:62: 40:67 + _4 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:50: 40:54 goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 } bb5: { - _4 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:50: 40:54 + _4 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:62: 40:67 goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 } bb6: { StorageDead(_5); // scope 0 at $DIR/matches_reduce_branches.rs:40:67: 40:68 -- switchInt(_4) -> [false: bb7, otherwise: bb8]; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 +- switchInt(move _4) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 + StorageLive(_9); // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 -+ _9 = _4; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 ++ _9 = move _4; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 + _3 = Ne(_9, const false); // scope 0 at $DIR/matches_reduce_branches.rs:40:82: 40:87 + StorageDead(_9); // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 + goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 } bb7: { - _3 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:82: 40:87 + _3 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:70: 40:74 goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 } bb8: { - _3 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:70: 40:74 + _3 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:82: 40:87 goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 } diff --git a/src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff b/src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff index 997c021d2ef..fb25cb90021 100644 --- a/src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff +++ b/src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff @@ -9,21 +9,21 @@ bb0: { StorageLive(_2); // scope 0 at $DIR/multiple_return_terminators.rs:5:8: 5:9 _2 = _1; // scope 0 at $DIR/multiple_return_terminators.rs:5:8: 5:9 - switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/multiple_return_terminators.rs:5:5: 9:6 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/multiple_return_terminators.rs:5:5: 9:6 } bb1: { - _0 = const (); // scope 0 at $DIR/multiple_return_terminators.rs:7:12: 9:6 + _0 = const (); // scope 0 at $DIR/multiple_return_terminators.rs:5:10: 7:6 goto -> bb3; // scope 0 at $DIR/multiple_return_terminators.rs:5:5: 9:6 } bb2: { - _0 = const (); // scope 0 at $DIR/multiple_return_terminators.rs:5:10: 7:6 + _0 = const (); // scope 0 at $DIR/multiple_return_terminators.rs:7:12: 9:6 goto -> bb3; // scope 0 at $DIR/multiple_return_terminators.rs:5:5: 9:6 } bb3: { - StorageDead(_2); // scope 0 at $DIR/multiple_return_terminators.rs:10:1: 10:2 + StorageDead(_2); // scope 0 at $DIR/multiple_return_terminators.rs:9:5: 9:6 return; // scope 0 at $DIR/multiple_return_terminators.rs:10:2: 10:2 } } diff --git a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir index d8538a5461e..8c939d5fc3d 100644 --- a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir +++ b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir @@ -5,19 +5,19 @@ | '_#1r | Local | ['_#1r] | | Inferred Region Values -| '_#0r | U0 | {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0], '_#0r, '_#1r} -| '_#1r | U0 | {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0], '_#1r} +| '_#0r | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=1], bb4[0..=3], bb5[0..=2], bb6[0..=5], bb7[0], '_#0r, '_#1r} +| '_#1r | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=1], bb4[0..=3], bb5[0..=2], bb6[0..=5], bb7[0], '_#1r} | '_#2r | U0 | {} -| '_#3r | U0 | {bb1[0..=8], bb2[0], bb4[0..=2]} -| '_#4r | U0 | {bb1[1..=8], bb2[0], bb4[0..=2]} -| '_#5r | U0 | {bb1[4..=8], bb2[0], bb4[0..=2]} +| '_#3r | U0 | {bb1[0..=7], bb2[0..=2]} +| '_#4r | U0 | {bb1[1..=7], bb2[0..=2]} +| '_#5r | U0 | {bb1[4..=7], bb2[0..=2]} | | Inference Constraints -| '_#0r live at {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0]} -| '_#1r live at {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0]} +| '_#0r live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=1], bb4[0..=3], bb5[0..=2], bb6[0..=5], bb7[0]} +| '_#1r live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=1], bb4[0..=3], bb5[0..=2], bb6[0..=5], bb7[0]} | '_#3r live at {bb1[0]} | '_#4r live at {bb1[1..=3]} -| '_#5r live at {bb1[4..=8], bb2[0], bb4[0..=2]} +| '_#5r live at {bb1[4..=7], bb2[0..=2]} | '_#3r: '_#4r due to Assignment at Single(bb1[0]) | '_#4r: '_#5r due to Assignment at Single(bb1[3]) | @@ -52,7 +52,7 @@ fn main() -> () { _3 = const Const(Value(Scalar(0x00000000)): usize); // bb0[5]: scope 1 at $DIR/region-subtyping-basic.rs:18:16: 18:17 _4 = Len(_1); // bb0[6]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 _5 = Lt(_3, _4); // bb0[7]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 - assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb8]; // bb0[8]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 + assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb7]; // bb0[8]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 } bb1: { @@ -63,55 +63,50 @@ fn main() -> () { FakeRead(ForLet, _6); // bb1[4]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 StorageLive(_7); // bb1[5]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 _7 = const Const(Value(Scalar(0x01)): bool); // bb1[6]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 - FakeRead(ForMatchedPlace, _7); // bb1[7]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 - switchInt(_7) -> [Const(Value(Scalar(0x00)): bool): bb3, otherwise: bb2]; // bb1[8]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + switchInt(move _7) -> [Const(Value(Scalar(0x00)): bool): bb3, otherwise: bb2]; // bb1[7]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } bb2: { - falseEdge -> [real: bb4, imaginary: bb3]; // bb2[0]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + StorageLive(_8); // bb2[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 + StorageLive(_9); // bb2[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 + _9 = (*_6); // bb2[2]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 + _8 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(move _9) -> [return: bb4, unwind: bb7]; // bb2[3]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 + // mir::Constant + // + span: $DIR/region-subtyping-basic.rs:21:9: 21:14 + // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) } } bb3: { StorageLive(_10); // bb3[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 - _10 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(const Const(Value(Scalar(0x00000016)): usize)) -> [return: bb6, unwind: bb8]; // bb3[1]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 + _10 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(const Const(Value(Scalar(0x00000016)): usize)) -> [return: bb5, unwind: bb7]; // bb3[1]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 // mir::Constant // + span: $DIR/region-subtyping-basic.rs:23:9: 23:14 // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) } } bb4: { - StorageLive(_8); // bb4[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 - StorageLive(_9); // bb4[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 - _9 = (*_6); // bb4[2]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 - _8 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(move _9) -> [return: bb5, unwind: bb8]; // bb4[3]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 - // mir::Constant - // + span: $DIR/region-subtyping-basic.rs:21:9: 21:14 - // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) } + StorageDead(_9); // bb4[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:17: 21:18 + StorageDead(_8); // bb4[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:18: 21:19 + _0 = const Const(Value(Scalar(<ZST>)): ()); // bb4[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:13: 22:6 + goto -> bb6; // bb4[3]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } bb5: { - StorageDead(_9); // bb5[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:17: 21:18 - StorageDead(_8); // bb5[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:18: 21:19 - _0 = const Const(Value(Scalar(<ZST>)): ()); // bb5[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:13: 22:6 - goto -> bb7; // bb5[3]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + StorageDead(_10); // bb5[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:18: 23:19 + _0 = const Const(Value(Scalar(<ZST>)): ()); // bb5[1]: scope 3 at $DIR/region-subtyping-basic.rs:22:12: 24:6 + goto -> bb6; // bb5[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } bb6: { - StorageDead(_10); // bb6[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:18: 23:19 - _0 = const Const(Value(Scalar(<ZST>)): ()); // bb6[1]: scope 3 at $DIR/region-subtyping-basic.rs:22:12: 24:6 - goto -> bb7; // bb6[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 - } - - bb7: { - StorageDead(_6); // bb7[0]: scope 2 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_3); // bb7[1]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_2); // bb7[2]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_1); // bb7[3]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_7); // bb7[4]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - return; // bb7[5]: scope 0 at $DIR/region-subtyping-basic.rs:25:2: 25:2 + StorageDead(_7); // bb6[0]: scope 3 at $DIR/region-subtyping-basic.rs:24:5: 24:6 + StorageDead(_6); // bb6[1]: scope 2 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_3); // bb6[2]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_2); // bb6[3]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_1); // bb6[4]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + return; // bb6[5]: scope 0 at $DIR/region-subtyping-basic.rs:25:2: 25:2 } - bb8 (cleanup): { - resume; // bb8[0]: scope 0 at $DIR/region-subtyping-basic.rs:16:1: 25:2 + bb7 (cleanup): { + resume; // bb7[0]: scope 0 at $DIR/region-subtyping-basic.rs:16:1: 25:2 } } diff --git a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir index 15aba40f169..00704baa6c1 100644 --- a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir +++ b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir @@ -5,19 +5,19 @@ | '_#1r | Local | ['_#1r] | | Inferred Region Values -| '_#0r | U0 | {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0], '_#0r, '_#1r} -| '_#1r | U0 | {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0], '_#1r} +| '_#0r | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=1], bb4[0..=3], bb5[0..=2], bb6[0..=5], bb7[0], '_#0r, '_#1r} +| '_#1r | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=1], bb4[0..=3], bb5[0..=2], bb6[0..=5], bb7[0], '_#1r} | '_#2r | U0 | {} -| '_#3r | U0 | {bb1[0..=8], bb2[0], bb4[0..=2]} -| '_#4r | U0 | {bb1[1..=8], bb2[0], bb4[0..=2]} -| '_#5r | U0 | {bb1[4..=8], bb2[0], bb4[0..=2]} +| '_#3r | U0 | {bb1[0..=7], bb2[0..=2]} +| '_#4r | U0 | {bb1[1..=7], bb2[0..=2]} +| '_#5r | U0 | {bb1[4..=7], bb2[0..=2]} | | Inference Constraints -| '_#0r live at {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0]} -| '_#1r live at {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0]} +| '_#0r live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=1], bb4[0..=3], bb5[0..=2], bb6[0..=5], bb7[0]} +| '_#1r live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=1], bb4[0..=3], bb5[0..=2], bb6[0..=5], bb7[0]} | '_#3r live at {bb1[0]} | '_#4r live at {bb1[1..=3]} -| '_#5r live at {bb1[4..=8], bb2[0], bb4[0..=2]} +| '_#5r live at {bb1[4..=7], bb2[0..=2]} | '_#3r: '_#4r due to Assignment at Single(bb1[0]) | '_#4r: '_#5r due to Assignment at Single(bb1[3]) | @@ -52,7 +52,7 @@ fn main() -> () { _3 = const Const(Value(Scalar(0x0000000000000000)): usize); // bb0[5]: scope 1 at $DIR/region-subtyping-basic.rs:18:16: 18:17 _4 = Len(_1); // bb0[6]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 _5 = Lt(_3, _4); // bb0[7]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 - assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb8]; // bb0[8]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 + assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb7]; // bb0[8]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 } bb1: { @@ -63,55 +63,50 @@ fn main() -> () { FakeRead(ForLet, _6); // bb1[4]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 StorageLive(_7); // bb1[5]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 _7 = const Const(Value(Scalar(0x01)): bool); // bb1[6]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 - FakeRead(ForMatchedPlace, _7); // bb1[7]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 - switchInt(_7) -> [Const(Value(Scalar(0x00)): bool): bb3, otherwise: bb2]; // bb1[8]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + switchInt(move _7) -> [Const(Value(Scalar(0x00)): bool): bb3, otherwise: bb2]; // bb1[7]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } bb2: { - falseEdge -> [real: bb4, imaginary: bb3]; // bb2[0]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + StorageLive(_8); // bb2[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 + StorageLive(_9); // bb2[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 + _9 = (*_6); // bb2[2]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 + _8 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(move _9) -> [return: bb4, unwind: bb7]; // bb2[3]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 + // mir::Constant + // + span: $DIR/region-subtyping-basic.rs:21:9: 21:14 + // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) } } bb3: { StorageLive(_10); // bb3[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 - _10 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(const Const(Value(Scalar(0x0000000000000016)): usize)) -> [return: bb6, unwind: bb8]; // bb3[1]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 + _10 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(const Const(Value(Scalar(0x0000000000000016)): usize)) -> [return: bb5, unwind: bb7]; // bb3[1]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 // mir::Constant // + span: $DIR/region-subtyping-basic.rs:23:9: 23:14 // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) } } bb4: { - StorageLive(_8); // bb4[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 - StorageLive(_9); // bb4[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 - _9 = (*_6); // bb4[2]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 - _8 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(move _9) -> [return: bb5, unwind: bb8]; // bb4[3]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 - // mir::Constant - // + span: $DIR/region-subtyping-basic.rs:21:9: 21:14 - // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) } + StorageDead(_9); // bb4[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:17: 21:18 + StorageDead(_8); // bb4[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:18: 21:19 + _0 = const Const(Value(Scalar(<ZST>)): ()); // bb4[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:13: 22:6 + goto -> bb6; // bb4[3]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } bb5: { - StorageDead(_9); // bb5[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:17: 21:18 - StorageDead(_8); // bb5[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:18: 21:19 - _0 = const Const(Value(Scalar(<ZST>)): ()); // bb5[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:13: 22:6 - goto -> bb7; // bb5[3]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + StorageDead(_10); // bb5[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:18: 23:19 + _0 = const Const(Value(Scalar(<ZST>)): ()); // bb5[1]: scope 3 at $DIR/region-subtyping-basic.rs:22:12: 24:6 + goto -> bb6; // bb5[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } bb6: { - StorageDead(_10); // bb6[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:18: 23:19 - _0 = const Const(Value(Scalar(<ZST>)): ()); // bb6[1]: scope 3 at $DIR/region-subtyping-basic.rs:22:12: 24:6 - goto -> bb7; // bb6[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 - } - - bb7: { - StorageDead(_6); // bb7[0]: scope 2 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_3); // bb7[1]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_2); // bb7[2]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_1); // bb7[3]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_7); // bb7[4]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - return; // bb7[5]: scope 0 at $DIR/region-subtyping-basic.rs:25:2: 25:2 + StorageDead(_7); // bb6[0]: scope 3 at $DIR/region-subtyping-basic.rs:24:5: 24:6 + StorageDead(_6); // bb6[1]: scope 2 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_3); // bb6[2]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_2); // bb6[3]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_1); // bb6[4]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + return; // bb6[5]: scope 0 at $DIR/region-subtyping-basic.rs:25:2: 25:2 } - bb8 (cleanup): { - resume; // bb8[0]: scope 0 at $DIR/region-subtyping-basic.rs:16:1: 25:2 + bb7 (cleanup): { + resume; // bb7[0]: scope 0 at $DIR/region-subtyping-basic.rs:16:1: 25:2 } } diff --git a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff b/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff index 5588877aec9..52e705fdbeb 100644 --- a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff +++ b/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff @@ -21,31 +21,26 @@ } - bb2: { -- nop; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 -- switchInt(_2) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 +- switchInt(move _2) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 + bb1: { -+ switchInt(_2) -> [false: bb2, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 ++ switchInt(move _2) -> [false: bb3, otherwise: bb2]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 } - bb3: { -- goto -> bb5; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 -- } -- -- bb4: { + bb2: { - _1 = const (); // scope 0 at $DIR/simplify_cfg.rs:9:10: 9:10 - StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 - goto -> bb0; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 + _0 = const (); // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 + StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:9:9: 9:10 + return; // scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2 } -- bb5: { +- bb4: { + bb3: { - _0 = const (); // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 - StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 - return; // scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2 + _1 = const (); // scope 0 at $DIR/simplify_cfg.rs:9:10: 9:10 + StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:9:9: 9:10 + goto -> bb0; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 - } - -- bb6 (cleanup): { +- bb5 (cleanup): { - resume; // scope 0 at $DIR/simplify_cfg.rs:5:1: 11:2 } } diff --git a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff b/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff index e62935225d8..fef3ae2e461 100644 --- a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff +++ b/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff @@ -9,69 +9,63 @@ bb0: { - goto -> bb1; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 -+ falseUnwind -> [real: bb1, cleanup: bb6]; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 ++ falseUnwind -> [real: bb1, cleanup: bb5]; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 } bb1: { -- falseUnwind -> [real: bb2, cleanup: bb11]; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 +- falseUnwind -> [real: bb2, cleanup: bb10]; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 - } - - bb2: { StorageLive(_2); // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 -- _2 = bar() -> [return: bb3, unwind: bb11]; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 -+ _2 = bar() -> [return: bb2, unwind: bb6]; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 +- _2 = bar() -> [return: bb3, unwind: bb10]; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 ++ _2 = bar() -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 // mir::Constant // + span: $DIR/simplify_cfg.rs:7:12: 7:15 // + literal: Const { ty: fn() -> bool {bar}, val: Value(Scalar(<ZST>)) } } - bb3: { +- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 + bb2: { - FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 -- switchInt(_2) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 -+ switchInt(_2) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 ++ switchInt(move _2) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 } - bb4: { -- falseEdge -> [real: bb6, imaginary: bb5]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 + bb3: { -+ falseEdge -> [real: bb5, imaginary: bb4]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 + _0 = const (); // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 +- goto -> bb9; // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 ++ StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:9:9: 9:10 ++ return; // scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2 } - bb5: { + bb4: { _1 = const (); // scope 0 at $DIR/simplify_cfg.rs:9:10: 9:10 -- goto -> bb9; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 -+ StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 -+ goto -> bb0; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 - } - -- bb6: { -+ bb5: { - _0 = const (); // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 -- goto -> bb10; // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 +- goto -> bb8; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 - } - -- bb7: { +- bb6: { - unreachable; // scope 0 at $DIR/simplify_cfg.rs:7:18: 9:10 - } - -- bb8: { -- goto -> bb9; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 +- bb7: { +- goto -> bb8; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 - } - -- bb9: { - StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 +- bb8: { + StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:9:9: 9:10 - goto -> bb1; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 -- } -- -- bb10: { -- StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 - return; // scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2 ++ goto -> bb0; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 } -- bb11 (cleanup): { -+ bb6 (cleanup): { +- bb9: { +- StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:9:9: 9:10 +- return; // scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2 +- } +- +- bb10 (cleanup): { ++ bb5 (cleanup): { resume; // scope 0 at $DIR/simplify_cfg.rs:5:1: 11:2 } } diff --git a/src/test/mir-opt/simplify_if.main.SimplifyBranches-after-const-prop.diff b/src/test/mir-opt/simplify_if.main.SimplifyBranches-after-const-prop.diff index bf3caf505ed..2cd57cb8474 100644 --- a/src/test/mir-opt/simplify_if.main.SimplifyBranches-after-const-prop.diff +++ b/src/test/mir-opt/simplify_if.main.SimplifyBranches-after-const-prop.diff @@ -9,16 +9,11 @@ bb0: { StorageLive(_1); // scope 0 at $DIR/simplify_if.rs:6:8: 6:13 _1 = const false; // scope 0 at $DIR/simplify_if.rs:6:8: 6:13 -- switchInt(const false) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6 -+ goto -> bb1; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6 +- switchInt(const false) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6 ++ goto -> bb2; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6 } bb1: { - _0 = const (); // scope 0 at $DIR/simplify_if.rs:8:6: 8:6 - goto -> bb4; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6 - } - - bb2: { StorageLive(_2); // scope 0 at $DIR/simplify_if.rs:7:9: 7:15 _2 = noop() -> bb3; // scope 0 at $DIR/simplify_if.rs:7:9: 7:15 // mir::Constant @@ -26,6 +21,11 @@ // + literal: Const { ty: fn() {noop}, val: Value(Scalar(<ZST>)) } } + bb2: { + _0 = const (); // scope 0 at $DIR/simplify_if.rs:8:6: 8:6 + goto -> bb4; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6 + } + bb3: { StorageDead(_2); // scope 0 at $DIR/simplify_if.rs:7:15: 7:16 _0 = const (); // scope 0 at $DIR/simplify_if.rs:6:14: 8:6 @@ -33,7 +33,7 @@ } bb4: { - StorageDead(_1); // scope 0 at $DIR/simplify_if.rs:9:1: 9:2 + StorageDead(_1); // scope 0 at $DIR/simplify_if.rs:8:5: 8:6 return; // scope 0 at $DIR/simplify_if.rs:9:2: 9:2 } } diff --git a/src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff b/src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff index 9f7507a5cad..70725e5f14f 100644 --- a/src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff +++ b/src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff @@ -47,21 +47,21 @@ _8 = _6; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13 _7 = Gt(move _8, const 42_u8); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20 StorageDead(_8); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:19: 5:20 - switchInt(_7) -> [false: bb4, otherwise: bb5]; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10 + switchInt(move _7) -> [false: bb5, otherwise: bb4]; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10 } bb4: { - _0 = const (); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:7:10: 7:10 + _0 = const (); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:21: 7:10 goto -> bb6; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10 } bb5: { - _0 = const (); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:21: 7:10 + _0 = const (); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:7:10: 7:10 goto -> bb6; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10 } bb6: { - StorageDead(_7); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:8:5: 8:6 + StorageDead(_7); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:7:9: 7:10 StorageDead(_6); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:8:5: 8:6 goto -> bb7; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:5: 8:6 } diff --git a/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff index 6f44de1e4a4..23a3fbd5f46 100644 --- a/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff +++ b/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff @@ -44,18 +44,18 @@ - StorageLive(_5); // scope 2 at $DIR/unreachable.rs:12:9: 16:10 - StorageLive(_6); // scope 2 at $DIR/unreachable.rs:12:12: 12:16 - _6 = const true; // scope 2 at $DIR/unreachable.rs:12:12: 12:16 -- switchInt(_6) -> [false: bb4, otherwise: bb5]; // scope 2 at $DIR/unreachable.rs:12:9: 16:10 +- switchInt(move _6) -> [false: bb5, otherwise: bb4]; // scope 2 at $DIR/unreachable.rs:12:9: 16:10 - } - - bb4: { -- _4 = const 42_i32; // scope 2 at $DIR/unreachable.rs:15:13: 15:20 -- _5 = const (); // scope 2 at $DIR/unreachable.rs:14:16: 16:10 +- _4 = const 21_i32; // scope 2 at $DIR/unreachable.rs:13:13: 13:20 +- _5 = const (); // scope 2 at $DIR/unreachable.rs:12:17: 14:10 - goto -> bb6; // scope 2 at $DIR/unreachable.rs:12:9: 16:10 - } - - bb5: { -- _4 = const 21_i32; // scope 2 at $DIR/unreachable.rs:13:13: 13:20 -- _5 = const (); // scope 2 at $DIR/unreachable.rs:12:17: 14:10 +- _4 = const 42_i32; // scope 2 at $DIR/unreachable.rs:15:13: 15:20 +- _5 = const (); // scope 2 at $DIR/unreachable.rs:14:16: 16:10 - goto -> bb6; // scope 2 at $DIR/unreachable.rs:12:9: 16:10 - } - diff --git a/src/test/mir-opt/unreachable_asm.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable_asm.main.UnreachablePropagation.diff index 9bca06a3e2b..3eda1831705 100644 --- a/src/test/mir-opt/unreachable_asm.main.UnreachablePropagation.diff +++ b/src/test/mir-opt/unreachable_asm.main.UnreachablePropagation.diff @@ -46,18 +46,18 @@ StorageLive(_5); // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10 StorageLive(_6); // scope 2 at $DIR/unreachable_asm.rs:14:12: 14:16 _6 = const true; // scope 2 at $DIR/unreachable_asm.rs:14:12: 14:16 - switchInt(_6) -> [false: bb4, otherwise: bb5]; // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10 + switchInt(move _6) -> [false: bb5, otherwise: bb4]; // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10 } bb4: { - _4 = const 42_i32; // scope 2 at $DIR/unreachable_asm.rs:17:13: 17:20 - _5 = const (); // scope 2 at $DIR/unreachable_asm.rs:16:16: 18:10 + _4 = const 21_i32; // scope 2 at $DIR/unreachable_asm.rs:15:13: 15:20 + _5 = const (); // scope 2 at $DIR/unreachable_asm.rs:14:17: 16:10 goto -> bb6; // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10 } bb5: { - _4 = const 21_i32; // scope 2 at $DIR/unreachable_asm.rs:15:13: 15:20 - _5 = const (); // scope 2 at $DIR/unreachable_asm.rs:14:17: 16:10 + _4 = const 42_i32; // scope 2 at $DIR/unreachable_asm.rs:17:13: 17:20 + _5 = const (); // scope 2 at $DIR/unreachable_asm.rs:16:16: 18:10 goto -> bb6; // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10 } diff --git a/src/test/mir-opt/unreachable_asm_2.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable_asm_2.main.UnreachablePropagation.diff index cbc24eab0f5..d0d52e869d6 100644 --- a/src/test/mir-opt/unreachable_asm_2.main.UnreachablePropagation.diff +++ b/src/test/mir-opt/unreachable_asm_2.main.UnreachablePropagation.diff @@ -49,21 +49,10 @@ StorageLive(_5); // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10 StorageLive(_6); // scope 2 at $DIR/unreachable_asm_2.rs:14:12: 14:16 _6 = const true; // scope 2 at $DIR/unreachable_asm_2.rs:14:12: 14:16 - switchInt(_6) -> [false: bb4, otherwise: bb5]; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10 + switchInt(move _6) -> [false: bb5, otherwise: bb4]; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10 } bb4: { - StorageLive(_8); // scope 2 at $DIR/unreachable_asm_2.rs:20:13: 20:41 - llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // scope 4 at $DIR/unreachable_asm_2.rs:20:22: 20:39 - _8 = const (); // scope 4 at $DIR/unreachable_asm_2.rs:20:13: 20:41 - StorageDead(_8); // scope 2 at $DIR/unreachable_asm_2.rs:20:40: 20:41 - _4 = const 42_i32; // scope 2 at $DIR/unreachable_asm_2.rs:21:13: 21:20 - _5 = const (); // scope 2 at $DIR/unreachable_asm_2.rs:18:16: 22:10 -- goto -> bb6; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10 -+ unreachable; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10 - } - - bb5: { StorageLive(_7); // scope 2 at $DIR/unreachable_asm_2.rs:16:13: 16:41 llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // scope 3 at $DIR/unreachable_asm_2.rs:16:22: 16:39 _7 = const (); // scope 3 at $DIR/unreachable_asm_2.rs:16:13: 16:41 @@ -71,6 +60,17 @@ _4 = const 21_i32; // scope 2 at $DIR/unreachable_asm_2.rs:17:13: 17:20 _5 = const (); // scope 2 at $DIR/unreachable_asm_2.rs:14:17: 18:10 - goto -> bb6; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10 ++ unreachable; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10 + } + + bb5: { + StorageLive(_8); // scope 2 at $DIR/unreachable_asm_2.rs:20:13: 20:41 + llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // scope 4 at $DIR/unreachable_asm_2.rs:20:22: 20:39 + _8 = const (); // scope 4 at $DIR/unreachable_asm_2.rs:20:13: 20:41 + StorageDead(_8); // scope 2 at $DIR/unreachable_asm_2.rs:20:40: 20:41 + _4 = const 42_i32; // scope 2 at $DIR/unreachable_asm_2.rs:21:13: 21:20 + _5 = const (); // scope 2 at $DIR/unreachable_asm_2.rs:18:16: 22:10 +- goto -> bb6; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10 - } - - bb6: { diff --git a/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff index fd8286f1c4f..2c0cc04085e 100644 --- a/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff +++ b/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff @@ -45,16 +45,11 @@ StorageLive(_5); // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10 StorageLive(_6); // scope 2 at $DIR/unreachable_diverging.rs:15:12: 15:13 _6 = _1; // scope 2 at $DIR/unreachable_diverging.rs:15:12: 15:13 -- switchInt(_6) -> [false: bb4, otherwise: bb5]; // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10 +- switchInt(move _6) -> [false: bb5, otherwise: bb4]; // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10 + goto -> bb4; // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10 } bb4: { -- _5 = const (); // scope 2 at $DIR/unreachable_diverging.rs:17:10: 17:10 -- goto -> bb6; // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10 -- } -- -- bb5: { - _5 = loop_forever() -> bb6; // scope 2 at $DIR/unreachable_diverging.rs:16:13: 16:27 + _5 = loop_forever() -> bb5; // scope 2 at $DIR/unreachable_diverging.rs:16:13: 16:27 // mir::Constant @@ -62,8 +57,12 @@ // + literal: Const { ty: fn() {loop_forever}, val: Value(Scalar(<ZST>)) } } + bb5: { +- _5 = const (); // scope 2 at $DIR/unreachable_diverging.rs:17:10: 17:10 +- goto -> bb6; // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10 +- } +- - bb6: { -+ bb5: { StorageDead(_6); // scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10 StorageDead(_5); // scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10 StorageLive(_7); // scope 2 at $DIR/unreachable_diverging.rs:18:9: 18:22 diff --git a/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir b/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir index c27c68d8702..0c034891a80 100644 --- a/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir +++ b/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir @@ -40,19 +40,19 @@ fn while_loop(_1: bool) -> () { bb4: { StorageDead(_5); // scope 0 at $DIR/while-storage.rs:11:22: 11:23 - switchInt(_4) -> [false: bb5, otherwise: bb6]; // scope 0 at $DIR/while-storage.rs:11:9: 13:10 + switchInt(move _4) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/while-storage.rs:11:9: 13:10 } bb5: { - StorageDead(_4); // scope 0 at $DIR/while-storage.rs:14:5: 14:6 - StorageDead(_2); // scope 0 at $DIR/while-storage.rs:14:5: 14:6 - goto -> bb0; // scope 0 at $DIR/while-storage.rs:10:5: 14:6 + _0 = const (); // scope 0 at $DIR/while-storage.rs:12:13: 12:18 + StorageDead(_4); // scope 0 at $DIR/while-storage.rs:13:9: 13:10 + goto -> bb7; // scope 0 at $DIR/while-storage.rs:1:1: 1:1 } bb6: { - _0 = const (); // scope 0 at $DIR/while-storage.rs:12:13: 12:18 - StorageDead(_4); // scope 0 at $DIR/while-storage.rs:14:5: 14:6 - goto -> bb7; // scope 0 at $DIR/while-storage.rs:1:1: 1:1 + StorageDead(_4); // scope 0 at $DIR/while-storage.rs:13:9: 13:10 + StorageDead(_2); // scope 0 at $DIR/while-storage.rs:14:5: 14:6 + goto -> bb0; // scope 0 at $DIR/while-storage.rs:10:5: 14:6 } bb7: { diff --git a/src/test/ui/issues/issue-14091.stderr b/src/test/ui/issues/issue-14091.stderr index 7db47347808..fc49cc6d68e 100644 --- a/src/test/ui/issues/issue-14091.stderr +++ b/src/test/ui/issues/issue-14091.stderr @@ -3,6 +3,8 @@ error[E0308]: mismatched types | LL | assert!(1,1); | ^^^^^^^^^^^^^ expected `bool`, found integer + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.stderr b/src/test/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.stderr index 13b6a7bbef3..c646912d3b6 100644 --- a/src/test/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.stderr @@ -28,9 +28,6 @@ LL | let x; ... LL | x = 1; | ^^^^^ cannot assign twice to immutable variable -LL | } else { -LL | x = 2; - | ----- first assignment to `x` error[E0384]: cannot assign twice to immutable variable `x` --> $DIR/liveness-assign-imm-local-notes.rs:32:13 @@ -38,6 +35,9 @@ error[E0384]: cannot assign twice to immutable variable `x` LL | let x; | - help: make this binding mutable: `mut x` ... +LL | x = 1; + | ----- first assignment to `x` +LL | } else { LL | x = 2; | ^^^^^ cannot assign twice to immutable variable |
