diff options
| author | Xavier Denis <xldenis@gmail.com> | 2022-06-10 14:12:58 -0700 |
|---|---|---|
| committer | Xavier Denis <xldenis@gmail.com> | 2022-06-14 18:45:33 -0700 |
| commit | a5e27a113445498b7b435bcd04e26ad1d71defab (patch) | |
| tree | 629b3e110b53a77c72862e23ad5006a05fcb1514 | |
| parent | e39c92e7aa2cd77659d504b05ad59e38388866f7 (diff) | |
| download | rust-a5e27a113445498b7b435bcd04e26ad1d71defab.tar.gz rust-a5e27a113445498b7b435bcd04e26ad1d71defab.zip | |
Only create scopes for if let
55 files changed, 756 insertions, 850 deletions
diff --git a/compiler/rustc_mir_build/src/build/expr/into.rs b/compiler/rustc_mir_build/src/build/expr/into.rs index 182a9a5cc5d..cffb67ef013 100644 --- a/compiler/rustc_mir_build/src/build/expr/into.rs +++ b/compiler/rustc_mir_build/src/build/expr/into.rs @@ -63,9 +63,17 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { (if_then_scope, then_source_info), LintLevel::Inherited, |this| { - let variable_scope = - this.new_source_scope(then_expr.span, LintLevel::Inherited, None); - this.source_scope = variable_scope; + let source_info = if this.is_let(cond) { + let variable_scope = this.new_source_scope( + then_expr.span, + LintLevel::Inherited, + None, + ); + this.source_scope = variable_scope; + SourceInfo { span: then_expr.span, scope: variable_scope } + } else { + this.source_info(then_expr.span) + }; let (then_block, else_block) = this.in_if_then_scope(condition_scope, |this| { let then_blk = unpack!(this.then_else_break( @@ -73,7 +81,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { &this.thir[cond], Some(condition_scope), condition_scope, - SourceInfo { span: then_expr.span, scope: variable_scope } + source_info )); this.expr_into_dest(destination, then_blk, then_expr) @@ -579,4 +587,12 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { block_and } + + fn is_let(&self, expr: ExprId) -> bool { + match self.thir[expr].kind { + ExprKind::Let { .. } => true, + ExprKind::Scope { value, .. } => self.is_let(value), + _ => false, + } + } } diff --git a/src/test/mir-opt/bool_compare.opt1.InstCombine.diff b/src/test/mir-opt/bool_compare.opt1.InstCombine.diff index ff608f7f5ce..8f57d307abf 100644 --- a/src/test/mir-opt/bool_compare.opt1.InstCombine.diff +++ b/src/test/mir-opt/bool_compare.opt1.InstCombine.diff @@ -6,21 +6,19 @@ let mut _0: u32; // return place in scope 0 at $DIR/bool_compare.rs:2:21: 2:24 let mut _2: bool; // in scope 0 at $DIR/bool_compare.rs:3:8: 3:17 let mut _3: bool; // in scope 0 at $DIR/bool_compare.rs:3:8: 3:9 - scope 1 { - } bb0: { - StorageLive(_2); // scope 1 at $DIR/bool_compare.rs:3:8: 3:17 - StorageLive(_3); // scope 1 at $DIR/bool_compare.rs:3:8: 3:9 - _3 = _1; // scope 1 at $DIR/bool_compare.rs:3:8: 3:9 -- _2 = Ne(move _3, const true); // scope 1 at $DIR/bool_compare.rs:3:8: 3:17 -+ _2 = Not(move _3); // scope 1 at $DIR/bool_compare.rs:3:8: 3:17 - StorageDead(_3); // scope 1 at $DIR/bool_compare.rs:3:16: 3:17 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/bool_compare.rs:3:8: 3:17 + StorageLive(_2); // scope 0 at $DIR/bool_compare.rs:3:8: 3:17 + StorageLive(_3); // scope 0 at $DIR/bool_compare.rs:3:8: 3:9 + _3 = _1; // scope 0 at $DIR/bool_compare.rs:3:8: 3:9 +- _2 = Ne(move _3, const true); // scope 0 at $DIR/bool_compare.rs:3:8: 3:17 ++ _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:3:8: 3:17 + StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:3:16: 3:17 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:3:8: 3:17 } bb1: { - _0 = const 0_u32; // scope 1 at $DIR/bool_compare.rs:3:20: 3:21 + _0 = const 0_u32; // scope 0 at $DIR/bool_compare.rs:3:20: 3:21 goto -> bb3; // scope 0 at $DIR/bool_compare.rs:3:5: 3:34 } diff --git a/src/test/mir-opt/bool_compare.opt2.InstCombine.diff b/src/test/mir-opt/bool_compare.opt2.InstCombine.diff index 8395b22b8e2..1f5738ae758 100644 --- a/src/test/mir-opt/bool_compare.opt2.InstCombine.diff +++ b/src/test/mir-opt/bool_compare.opt2.InstCombine.diff @@ -6,21 +6,19 @@ let mut _0: u32; // return place in scope 0 at $DIR/bool_compare.rs:7:21: 7:24 let mut _2: bool; // in scope 0 at $DIR/bool_compare.rs:8:8: 8:17 let mut _3: bool; // in scope 0 at $DIR/bool_compare.rs:8:16: 8:17 - scope 1 { - } bb0: { - StorageLive(_2); // scope 1 at $DIR/bool_compare.rs:8:8: 8:17 - StorageLive(_3); // scope 1 at $DIR/bool_compare.rs:8:16: 8:17 - _3 = _1; // scope 1 at $DIR/bool_compare.rs:8:16: 8:17 -- _2 = Ne(const true, move _3); // scope 1 at $DIR/bool_compare.rs:8:8: 8:17 -+ _2 = Not(move _3); // scope 1 at $DIR/bool_compare.rs:8:8: 8:17 - StorageDead(_3); // scope 1 at $DIR/bool_compare.rs:8:16: 8:17 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/bool_compare.rs:8:8: 8:17 + StorageLive(_2); // scope 0 at $DIR/bool_compare.rs:8:8: 8:17 + StorageLive(_3); // scope 0 at $DIR/bool_compare.rs:8:16: 8:17 + _3 = _1; // scope 0 at $DIR/bool_compare.rs:8:16: 8:17 +- _2 = Ne(const true, move _3); // scope 0 at $DIR/bool_compare.rs:8:8: 8:17 ++ _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:8:8: 8:17 + StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:8:16: 8:17 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:8:8: 8:17 } bb1: { - _0 = const 0_u32; // scope 1 at $DIR/bool_compare.rs:8:20: 8:21 + _0 = const 0_u32; // scope 0 at $DIR/bool_compare.rs:8:20: 8:21 goto -> bb3; // scope 0 at $DIR/bool_compare.rs:8:5: 8:34 } diff --git a/src/test/mir-opt/bool_compare.opt3.InstCombine.diff b/src/test/mir-opt/bool_compare.opt3.InstCombine.diff index 413b5fdf208..3320509a7b3 100644 --- a/src/test/mir-opt/bool_compare.opt3.InstCombine.diff +++ b/src/test/mir-opt/bool_compare.opt3.InstCombine.diff @@ -6,21 +6,19 @@ let mut _0: u32; // return place in scope 0 at $DIR/bool_compare.rs:12:21: 12:24 let mut _2: bool; // in scope 0 at $DIR/bool_compare.rs:13:8: 13:18 let mut _3: bool; // in scope 0 at $DIR/bool_compare.rs:13:8: 13:9 - scope 1 { - } bb0: { - StorageLive(_2); // scope 1 at $DIR/bool_compare.rs:13:8: 13:18 - StorageLive(_3); // scope 1 at $DIR/bool_compare.rs:13:8: 13:9 - _3 = _1; // scope 1 at $DIR/bool_compare.rs:13:8: 13:9 -- _2 = Eq(move _3, const false); // scope 1 at $DIR/bool_compare.rs:13:8: 13:18 -+ _2 = Not(move _3); // scope 1 at $DIR/bool_compare.rs:13:8: 13:18 - StorageDead(_3); // scope 1 at $DIR/bool_compare.rs:13:17: 13:18 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/bool_compare.rs:13:8: 13:18 + StorageLive(_2); // scope 0 at $DIR/bool_compare.rs:13:8: 13:18 + StorageLive(_3); // scope 0 at $DIR/bool_compare.rs:13:8: 13:9 + _3 = _1; // scope 0 at $DIR/bool_compare.rs:13:8: 13:9 +- _2 = Eq(move _3, const false); // scope 0 at $DIR/bool_compare.rs:13:8: 13:18 ++ _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:13:8: 13:18 + StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:13:17: 13:18 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:13:8: 13:18 } bb1: { - _0 = const 0_u32; // scope 1 at $DIR/bool_compare.rs:13:21: 13:22 + _0 = const 0_u32; // scope 0 at $DIR/bool_compare.rs:13:21: 13:22 goto -> bb3; // scope 0 at $DIR/bool_compare.rs:13:5: 13:35 } diff --git a/src/test/mir-opt/bool_compare.opt4.InstCombine.diff b/src/test/mir-opt/bool_compare.opt4.InstCombine.diff index ba4496aa2c9..02049f4126d 100644 --- a/src/test/mir-opt/bool_compare.opt4.InstCombine.diff +++ b/src/test/mir-opt/bool_compare.opt4.InstCombine.diff @@ -6,21 +6,19 @@ let mut _0: u32; // return place in scope 0 at $DIR/bool_compare.rs:17:21: 17:24 let mut _2: bool; // in scope 0 at $DIR/bool_compare.rs:18:8: 18:18 let mut _3: bool; // in scope 0 at $DIR/bool_compare.rs:18:17: 18:18 - scope 1 { - } bb0: { - StorageLive(_2); // scope 1 at $DIR/bool_compare.rs:18:8: 18:18 - StorageLive(_3); // scope 1 at $DIR/bool_compare.rs:18:17: 18:18 - _3 = _1; // scope 1 at $DIR/bool_compare.rs:18:17: 18:18 -- _2 = Eq(const false, move _3); // scope 1 at $DIR/bool_compare.rs:18:8: 18:18 -+ _2 = Not(move _3); // scope 1 at $DIR/bool_compare.rs:18:8: 18:18 - StorageDead(_3); // scope 1 at $DIR/bool_compare.rs:18:17: 18:18 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/bool_compare.rs:18:8: 18:18 + StorageLive(_2); // scope 0 at $DIR/bool_compare.rs:18:8: 18:18 + StorageLive(_3); // scope 0 at $DIR/bool_compare.rs:18:17: 18:18 + _3 = _1; // scope 0 at $DIR/bool_compare.rs:18:17: 18:18 +- _2 = Eq(const false, move _3); // scope 0 at $DIR/bool_compare.rs:18:8: 18:18 ++ _2 = Not(move _3); // scope 0 at $DIR/bool_compare.rs:18:8: 18:18 + StorageDead(_3); // scope 0 at $DIR/bool_compare.rs:18:17: 18:18 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/bool_compare.rs:18:8: 18:18 } bb1: { - _0 = const 0_u32; // scope 1 at $DIR/bool_compare.rs:18:21: 18:22 + _0 = const 0_u32; // scope 0 at $DIR/bool_compare.rs:18:21: 18:22 goto -> bb3; // scope 0 at $DIR/bool_compare.rs:18:5: 18:35 } diff --git a/src/test/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff b/src/test/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff index 3173d09fddc..544d16a251a 100644 --- a/src/test/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff +++ b/src/test/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff @@ -7,35 +7,33 @@ - let mut _2: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _3: isize; // in scope 0 at $DIR/const_goto.rs:12:22: 12:28 + let mut _2: isize; // in scope 0 at $DIR/const_goto.rs:12:22: 12:28 - scope 1 { - } bb0: { -- StorageLive(_2); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL -- _3 = discriminant(_1); // scope 1 at $DIR/const_goto.rs:12:17: 12:20 -- switchInt(move _3) -> [1_isize: bb2, 2_isize: bb2, otherwise: bb1]; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL -+ _2 = discriminant(_1); // scope 1 at $DIR/const_goto.rs:12:17: 12:20 -+ switchInt(move _2) -> [1_isize: bb2, 2_isize: bb2, otherwise: bb1]; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- StorageLive(_2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- _3 = discriminant(_1); // scope 0 at $DIR/const_goto.rs:12:17: 12:20 +- switchInt(move _3) -> [1_isize: bb2, 2_isize: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL ++ _2 = discriminant(_1); // scope 0 at $DIR/const_goto.rs:12:17: 12:20 ++ switchInt(move _2) -> [1_isize: bb2, 2_isize: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb1: { -- _2 = const false; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL -- goto -> bb3; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- _2 = const false; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _0 = const 42_u64; // scope 0 at $DIR/const_goto.rs:12:53: 12:55 + goto -> bb3; // scope 0 at $DIR/const_goto.rs:12:5: 12:57 } bb2: { -- _2 = const true; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL -- goto -> bb3; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- _2 = const true; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - } - - bb3: { -- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - } - - bb4: { - _0 = const 23_u64; // scope 1 at $DIR/const_goto.rs:12:41: 12:43 + _0 = const 23_u64; // scope 0 at $DIR/const_goto.rs:12:41: 12:43 - goto -> bb6; // scope 0 at $DIR/const_goto.rs:12:5: 12:57 + goto -> bb3; // scope 0 at $DIR/const_goto.rs:12:5: 12:57 } diff --git a/src/test/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff b/src/test/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff index 33925e41faa..62a681e1c12 100644 --- a/src/test/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff +++ b/src/test/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff @@ -13,60 +13,54 @@ scope 1 { debug val => _1; // in scope 1 at $DIR/const_goto_storage.rs:3:9: 3:12 } - scope 2 { - scope 3 { - scope 4 { - } - } - } bb0: { StorageLive(_1); // scope 0 at $DIR/const_goto_storage.rs:3:9: 3:12 - StorageLive(_2); // scope 0 at $DIR/const_goto_storage.rs:3:21: 3:23 - nop; // scope 0 at $DIR/const_goto_storage.rs:3:21: 3:23 - StorageLive(_3); // scope 0 at $DIR/const_goto_storage.rs:4:15: 8:10 -- StorageLive(_4); // scope 2 at $DIR/const_goto_storage.rs:4:18: 4:76 -- StorageLive(_5); // scope 3 at $DIR/const_goto_storage.rs:4:21: 4:52 -- StorageLive(_6); // scope 4 at $DIR/const_goto_storage.rs:4:24: 4:28 -- _6 = const true; // scope 4 at $DIR/const_goto_storage.rs:4:24: 4:28 -- switchInt(move _6) -> [false: bb2, otherwise: bb1]; // scope 4 at $DIR/const_goto_storage.rs:4:24: 4:28 -+ StorageLive(_2); // scope 4 at $DIR/const_goto_storage.rs:4:24: 4:28 -+ _2 = const true; // scope 4 at $DIR/const_goto_storage.rs:4:24: 4:28 -+ switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 4 at $DIR/const_goto_storage.rs:4:24: 4:28 +- StorageLive(_4); // scope 0 at $DIR/const_goto_storage.rs:4:18: 4:76 +- StorageLive(_5); // scope 0 at $DIR/const_goto_storage.rs:4:21: 4:52 +- StorageLive(_6); // scope 0 at $DIR/const_goto_storage.rs:4:24: 4:28 +- _6 = const true; // scope 0 at $DIR/const_goto_storage.rs:4:24: 4:28 +- switchInt(move _6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_storage.rs:4:24: 4:28 ++ StorageLive(_2); // scope 0 at $DIR/const_goto_storage.rs:4:24: 4:28 ++ _2 = const true; // scope 0 at $DIR/const_goto_storage.rs:4:24: 4:28 ++ switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_storage.rs:4:24: 4:28 } bb1: { -- _5 = const true; // scope 4 at $DIR/const_goto_storage.rs:4:31: 4:35 -- goto -> bb3; // scope 3 at $DIR/const_goto_storage.rs:4:21: 4:52 +- _5 = const true; // scope 0 at $DIR/const_goto_storage.rs:4:31: 4:35 +- goto -> bb3; // scope 0 at $DIR/const_goto_storage.rs:4:21: 4:52 - } - - bb2: { -- _5 = const false; // scope 3 at $DIR/const_goto_storage.rs:4:45: 4:50 -- goto -> bb3; // scope 3 at $DIR/const_goto_storage.rs:4:21: 4:52 +- _5 = const false; // scope 0 at $DIR/const_goto_storage.rs:4:45: 4:50 +- goto -> bb3; // scope 0 at $DIR/const_goto_storage.rs:4:21: 4:52 - } - - bb3: { -- StorageDead(_6); // scope 3 at $DIR/const_goto_storage.rs:4:51: 4:52 -- switchInt(move _5) -> [false: bb5, otherwise: bb4]; // scope 3 at $DIR/const_goto_storage.rs:4:21: 4:52 +- StorageDead(_6); // scope 0 at $DIR/const_goto_storage.rs:4:51: 4:52 +- switchInt(move _5) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/const_goto_storage.rs:4:21: 4:52 - } - - bb4: { -- _4 = const true; // scope 3 at $DIR/const_goto_storage.rs:4:55: 4:59 -- goto -> bb6; // scope 2 at $DIR/const_goto_storage.rs:4:18: 4:76 +- _4 = const true; // scope 0 at $DIR/const_goto_storage.rs:4:55: 4:59 +- goto -> bb6; // scope 0 at $DIR/const_goto_storage.rs:4:18: 4:76 - } - - bb5: { -- _4 = const false; // scope 2 at $DIR/const_goto_storage.rs:4:69: 4:74 -- goto -> bb6; // scope 2 at $DIR/const_goto_storage.rs:4:18: 4:76 +- _4 = const false; // scope 0 at $DIR/const_goto_storage.rs:4:69: 4:74 +- goto -> bb6; // scope 0 at $DIR/const_goto_storage.rs:4:18: 4:76 - } - - bb6: { -- StorageDead(_5); // scope 2 at $DIR/const_goto_storage.rs:4:75: 4:76 -- switchInt(move _4) -> [false: bb8, otherwise: bb7]; // scope 2 at $DIR/const_goto_storage.rs:4:18: 4:76 +- StorageDead(_5); // scope 0 at $DIR/const_goto_storage.rs:4:75: 4:76 +- switchInt(move _4) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/const_goto_storage.rs:4:18: 4:76 - } - - bb7: { -- _3 = const true; // scope 2 at $DIR/const_goto_storage.rs:5:13: 5:17 +- _3 = const true; // scope 0 at $DIR/const_goto_storage.rs:5:13: 5:17 - goto -> bb9; // scope 0 at $DIR/const_goto_storage.rs:4:15: 8:10 - } - @@ -82,7 +76,7 @@ - bb10: { - StorageDead(_4); // scope 0 at $DIR/const_goto_storage.rs:8:9: 8:10 - StorageDead(_3); // scope 0 at $DIR/const_goto_storage.rs:8:9: 8:10 -+ StorageDead(_2); // scope 3 at $DIR/const_goto_storage.rs:4:51: 4:52 ++ StorageDead(_2); // scope 0 at $DIR/const_goto_storage.rs:4:51: 4:52 _1 = const true; // scope 0 at $DIR/const_goto_storage.rs:10:17: 10:21 - goto -> bb12; // scope 0 at $DIR/const_goto_storage.rs:10:17: 10:21 + goto -> bb3; // scope 0 at $DIR/const_goto_storage.rs:10:17: 10:21 @@ -92,7 +86,7 @@ - StorageDead(_4); // scope 0 at $DIR/const_goto_storage.rs:8:9: 8:10 - StorageDead(_3); // scope 0 at $DIR/const_goto_storage.rs:8:9: 8:10 + bb2: { -+ StorageDead(_2); // scope 3 at $DIR/const_goto_storage.rs:4:51: 4:52 ++ StorageDead(_2); // scope 0 at $DIR/const_goto_storage.rs:4:51: 4:52 _1 = const false; // scope 0 at $DIR/const_goto_storage.rs:12:14: 12:19 - goto -> bb12; // scope 0 at $DIR/const_goto_storage.rs:12:14: 12:19 + goto -> bb3; // scope 0 at $DIR/const_goto_storage.rs:12:14: 12:19 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 3d9517fb504..d7636c81709 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 @@ -5,20 +5,18 @@ let mut _0: (); // return place in scope 0 at $DIR/control-flow-simplification.rs:11:14: 11:14 let mut _1: bool; // in scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 let mut _2: !; // in scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL - scope 1 { - } bb0: { - StorageLive(_1); // scope 1 at $DIR/control-flow-simplification.rs:12:8: 12:21 -- _1 = const <bool as NeedsDrop>::NEEDS; // scope 1 at $DIR/control-flow-simplification.rs:12:8: 12:21 -- switchInt(move _1) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/control-flow-simplification.rs:12:8: 12:21 -+ _1 = const false; // scope 1 at $DIR/control-flow-simplification.rs:12:8: 12:21 -+ switchInt(const false) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/control-flow-simplification.rs:12:8: 12:21 + 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(move _1) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 ++ _1 = const false; // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 ++ switchInt(const false) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 } bb1: { - StorageLive(_2); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL - _2 = begin_panic::<&str>(const "explicit panic"); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL + StorageLive(_2); // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL + _2 = begin_panic::<&str>(const "explicit panic"); // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL // mir::Constant // + span: $SRC_DIR/std/src/panic.rs:LL:COL // + literal: Const { ty: fn(&str) -> ! {begin_panic::<&str>}, val: Value(Scalar(<ZST>)) } diff --git a/src/test/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.mir b/src/test/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.mir index 4b11e4ebec6..30512d0bbe8 100644 --- a/src/test/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.mir +++ b/src/test/mir-opt/const_prop/control_flow_simplification.hello.PreCodegen.before.mir @@ -2,8 +2,6 @@ fn hello() -> () { let mut _0: (); // return place in scope 0 at $DIR/control-flow-simplification.rs:11:14: 11:14 - scope 1 { - } bb0: { return; // scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2 diff --git a/src/test/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff b/src/test/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff index 445732f7022..047853696f2 100644 --- a/src/test/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff +++ b/src/test/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff @@ -10,26 +10,28 @@ scope 1 { debug x => _1; // in scope 1 at $DIR/discriminant.rs:11:9: 11:10 } + scope 2 { + } bb0: { StorageLive(_1); // scope 0 at $DIR/discriminant.rs:11:9: 11:10 StorageLive(_2); // scope 0 at $DIR/discriminant.rs:11:13: 11:64 - StorageLive(_3); // scope 0 at $DIR/discriminant.rs:11:34: 11:44 - Deinit(_3); // scope 0 at $DIR/discriminant.rs:11:34: 11:44 - ((_3 as Some).0: bool) = const true; // scope 0 at $DIR/discriminant.rs:11:34: 11:44 - discriminant(_3) = 1; // scope 0 at $DIR/discriminant.rs:11:34: 11:44 -- _4 = discriminant(_3); // scope 0 at $DIR/discriminant.rs:11:21: 11:31 -- switchInt(move _4) -> [1_isize: bb1, otherwise: bb3]; // scope 0 at $DIR/discriminant.rs:11:21: 11:31 -+ _4 = const 1_isize; // scope 0 at $DIR/discriminant.rs:11:21: 11:31 -+ switchInt(const 1_isize) -> [1_isize: bb1, otherwise: bb3]; // scope 0 at $DIR/discriminant.rs:11:21: 11:31 + StorageLive(_3); // scope 2 at $DIR/discriminant.rs:11:34: 11:44 + Deinit(_3); // scope 2 at $DIR/discriminant.rs:11:34: 11:44 + ((_3 as Some).0: bool) = const true; // scope 2 at $DIR/discriminant.rs:11:34: 11:44 + discriminant(_3) = 1; // scope 2 at $DIR/discriminant.rs:11:34: 11:44 +- _4 = discriminant(_3); // scope 2 at $DIR/discriminant.rs:11:21: 11:31 +- switchInt(move _4) -> [1_isize: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:11:21: 11:31 ++ _4 = const 1_isize; // scope 2 at $DIR/discriminant.rs:11:21: 11:31 ++ switchInt(const 1_isize) -> [1_isize: bb1, otherwise: bb3]; // scope 2 at $DIR/discriminant.rs:11:21: 11:31 } bb1: { - switchInt(((_3 as Some).0: bool)) -> [false: bb3, otherwise: bb2]; // scope 0 at $DIR/discriminant.rs:11:21: 11:31 + switchInt(((_3 as Some).0: bool)) -> [false: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:11:21: 11:31 } bb2: { - _2 = const 42_i32; // scope 0 at $DIR/discriminant.rs:11:47: 11:49 + _2 = const 42_i32; // scope 2 at $DIR/discriminant.rs:11:47: 11:49 goto -> bb4; // scope 0 at $DIR/discriminant.rs:11:13: 11:64 } diff --git a/src/test/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff b/src/test/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff index 9f2ae1c90ca..6037f89086d 100644 --- a/src/test/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff +++ b/src/test/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff @@ -8,6 +8,7 @@ let mut _0: (); // return place in scope 0 at $DIR/cycle.rs:9:46: 9:46 let mut _4: (); // in scope 0 at $DIR/cycle.rs:9:1: 18:2 let mut _5: bool; // in scope 0 at $DIR/cycle.rs:12:11: 12:17 + let _6: i32; // in scope 0 at $DIR/cycle.rs:13:13: 13:17 let mut _7: i32; // in scope 0 at $DIR/cycle.rs:14:13: 14:14 let mut _8: i32; // in scope 0 at $DIR/cycle.rs:15:13: 15:14 let mut _9: i32; // in scope 0 at $DIR/cycle.rs:16:13: 16:17 @@ -15,10 +16,7 @@ let _11: (); // in scope 0 at $DIR/cycle.rs:12:5: 17:6 let mut _12: !; // in scope 0 at $DIR/cycle.rs:12:5: 17:6 scope 1 { - let _6: i32; // in scope 1 at $DIR/cycle.rs:13:13: 13:17 - scope 2 { - debug temp => _6; // in scope 2 at $DIR/cycle.rs:13:13: 13:17 - } + debug temp => _6; // in scope 1 at $DIR/cycle.rs:13:13: 13:17 } bb0: { @@ -26,42 +24,42 @@ } bb1: { - StorageLive(_5); // scope 1 at $DIR/cycle.rs:12:11: 12:17 - _5 = cond() -> bb2; // scope 1 at $DIR/cycle.rs:12:11: 12:17 + StorageLive(_5); // scope 0 at $DIR/cycle.rs:12:11: 12:17 + _5 = cond() -> bb2; // scope 0 at $DIR/cycle.rs:12:11: 12:17 // mir::Constant // + span: $DIR/cycle.rs:12:11: 12:15 // + literal: Const { ty: fn() -> bool {cond}, val: Value(Scalar(<ZST>)) } } bb2: { - switchInt(move _5) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/cycle.rs:12:11: 12:17 + switchInt(move _5) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/cycle.rs:12:11: 12:17 } bb3: { - StorageLive(_6); // scope 1 at $DIR/cycle.rs:13:13: 13:17 -- _6 = _3; // scope 1 at $DIR/cycle.rs:13:20: 13:21 -+ nop; // scope 1 at $DIR/cycle.rs:13:20: 13:21 - StorageLive(_7); // scope 2 at $DIR/cycle.rs:14:13: 14:14 -- _7 = _2; // scope 2 at $DIR/cycle.rs:14:13: 14:14 -- _3 = move _7; // scope 2 at $DIR/cycle.rs:14:9: 14:14 -+ nop; // scope 2 at $DIR/cycle.rs:14:13: 14:14 -+ nop; // scope 2 at $DIR/cycle.rs:14:9: 14:14 - StorageDead(_7); // scope 2 at $DIR/cycle.rs:14:13: 14:14 - StorageLive(_8); // scope 2 at $DIR/cycle.rs:15:13: 15:14 -- _8 = _1; // scope 2 at $DIR/cycle.rs:15:13: 15:14 -- _2 = move _8; // scope 2 at $DIR/cycle.rs:15:9: 15:14 -+ nop; // scope 2 at $DIR/cycle.rs:15:13: 15:14 -+ nop; // scope 2 at $DIR/cycle.rs:15:9: 15:14 - StorageDead(_8); // scope 2 at $DIR/cycle.rs:15:13: 15:14 - StorageLive(_9); // scope 2 at $DIR/cycle.rs:16:13: 16:17 -- _9 = _6; // scope 2 at $DIR/cycle.rs:16:13: 16:17 -- _1 = move _9; // scope 2 at $DIR/cycle.rs:16:9: 16:17 -+ nop; // scope 2 at $DIR/cycle.rs:16:13: 16:17 -+ nop; // scope 2 at $DIR/cycle.rs:16:9: 16:17 - StorageDead(_9); // scope 2 at $DIR/cycle.rs:16:16: 16:17 -- _4 = const (); // scope 1 at $DIR/cycle.rs:12:18: 17:6 -+ nop; // scope 1 at $DIR/cycle.rs:12:18: 17:6 - StorageDead(_6); // scope 1 at $DIR/cycle.rs:17:5: 17:6 + StorageLive(_6); // scope 0 at $DIR/cycle.rs:13:13: 13:17 +- _6 = _3; // scope 0 at $DIR/cycle.rs:13:20: 13:21 ++ nop; // scope 0 at $DIR/cycle.rs:13:20: 13:21 + StorageLive(_7); // scope 1 at $DIR/cycle.rs:14:13: 14:14 +- _7 = _2; // scope 1 at $DIR/cycle.rs:14:13: 14:14 +- _3 = move _7; // scope 1 at $DIR/cycle.rs:14:9: 14:14 ++ nop; // scope 1 at $DIR/cycle.rs:14:13: 14:14 ++ nop; // scope 1 at $DIR/cycle.rs:14:9: 14:14 + StorageDead(_7); // scope 1 at $DIR/cycle.rs:14:13: 14:14 + StorageLive(_8); // scope 1 at $DIR/cycle.rs:15:13: 15:14 +- _8 = _1; // scope 1 at $DIR/cycle.rs:15:13: 15:14 +- _2 = move _8; // scope 1 at $DIR/cycle.rs:15:9: 15:14 ++ nop; // scope 1 at $DIR/cycle.rs:15:13: 15:14 ++ nop; // scope 1 at $DIR/cycle.rs:15:9: 15:14 + StorageDead(_8); // scope 1 at $DIR/cycle.rs:15:13: 15:14 + StorageLive(_9); // scope 1 at $DIR/cycle.rs:16:13: 16:17 +- _9 = _6; // scope 1 at $DIR/cycle.rs:16:13: 16:17 +- _1 = move _9; // scope 1 at $DIR/cycle.rs:16:9: 16:17 ++ nop; // scope 1 at $DIR/cycle.rs:16:13: 16:17 ++ nop; // scope 1 at $DIR/cycle.rs:16:9: 16:17 + StorageDead(_9); // scope 1 at $DIR/cycle.rs:16:16: 16:17 +- _4 = const (); // scope 0 at $DIR/cycle.rs:12:18: 17:6 ++ nop; // scope 0 at $DIR/cycle.rs:12:18: 17:6 + StorageDead(_6); // scope 0 at $DIR/cycle.rs:17:5: 17:6 StorageDead(_5); // scope 0 at $DIR/cycle.rs:17:5: 17:6 goto -> bb1; // scope 0 at $DIR/cycle.rs:12:5: 17:6 } 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 089f43b5169..5cfcef849e9 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 @@ -8,23 +8,21 @@ let mut _3: bool; // in scope 0 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9 let mut _4: i32; // in scope 0 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17 let mut _5: i32; // in scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17 - scope 1 { - } bb0: { - StorageLive(_3); // scope 1 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9 - _3 = _1; // scope 1 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9 - switchInt(move _3) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9 + 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(move _3) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9 } bb1: { - StorageLive(_4); // scope 1 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17 - _4 = _2; // scope 1 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17 -- _0 = Foo::A(move _4); // scope 1 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18 -+ Deinit(_0); // scope 1 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18 -+ ((_0 as A).0: i32) = move _4; // scope 1 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18 -+ discriminant(_0) = 0; // scope 1 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18 - StorageDead(_4); // scope 1 at $DIR/deaggregator_test_enum_2.rs:11:17: 11:18 + 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 ++ Deinit(_0); // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18 ++ ((_0 as A).0: i32) = move _4; // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18 ++ discriminant(_0) = 0; // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18 + StorageDead(_4); // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:17: 11:18 goto -> bb3; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6 } 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 e33057e81fa..c3aa19e6c5f 100644 --- a/src/test/mir-opt/dest-prop/branch.main.DestinationPropagation.diff +++ b/src/test/mir-opt/dest-prop/branch.main.DestinationPropagation.diff @@ -12,8 +12,6 @@ scope 2 { debug y => _2; // in scope 2 at $DIR/branch.rs:15:9: 15:10 } - scope 3 { - } } bb0: { @@ -26,19 +24,19 @@ bb1: { StorageLive(_2); // scope 1 at $DIR/branch.rs:15:9: 15:10 - StorageLive(_3); // scope 3 at $DIR/branch.rs:15:16: 15:22 - _3 = cond() -> bb2; // scope 3 at $DIR/branch.rs:15:16: 15:22 + StorageLive(_3); // scope 1 at $DIR/branch.rs:15:16: 15:22 + _3 = cond() -> bb2; // scope 1 at $DIR/branch.rs:15:16: 15:22 // mir::Constant // + span: $DIR/branch.rs:15:16: 15:20 // + literal: Const { ty: fn() -> bool {cond}, val: Value(Scalar(<ZST>)) } } bb2: { - switchInt(move _3) -> [false: bb4, otherwise: bb3]; // scope 3 at $DIR/branch.rs:15:16: 15:22 + switchInt(move _3) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/branch.rs:15:16: 15:22 } bb3: { - nop; // scope 3 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 } diff --git a/src/test/mir-opt/equal_true.opt.InstCombine.diff b/src/test/mir-opt/equal_true.opt.InstCombine.diff index 56f2fede437..174095888b4 100644 --- a/src/test/mir-opt/equal_true.opt.InstCombine.diff +++ b/src/test/mir-opt/equal_true.opt.InstCombine.diff @@ -6,21 +6,19 @@ let mut _0: i32; // return place in scope 0 at $DIR/equal_true.rs:3:20: 3:23 let mut _2: bool; // in scope 0 at $DIR/equal_true.rs:4:8: 4:17 let mut _3: bool; // in scope 0 at $DIR/equal_true.rs:4:8: 4:9 - scope 1 { - } bb0: { - StorageLive(_2); // scope 1 at $DIR/equal_true.rs:4:8: 4:17 - StorageLive(_3); // scope 1 at $DIR/equal_true.rs:4:8: 4:9 - _3 = _1; // scope 1 at $DIR/equal_true.rs:4:8: 4:9 -- _2 = Eq(move _3, const true); // scope 1 at $DIR/equal_true.rs:4:8: 4:17 -+ _2 = move _3; // scope 1 at $DIR/equal_true.rs:4:8: 4:17 - StorageDead(_3); // scope 1 at $DIR/equal_true.rs:4:16: 4:17 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/equal_true.rs:4:8: 4:17 + StorageLive(_2); // scope 0 at $DIR/equal_true.rs:4:8: 4:17 + StorageLive(_3); // scope 0 at $DIR/equal_true.rs:4:8: 4:9 + _3 = _1; // scope 0 at $DIR/equal_true.rs:4:8: 4:9 +- _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(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/equal_true.rs:4:8: 4:17 } bb1: { - _0 = const 0_i32; // scope 1 at $DIR/equal_true.rs:4:20: 4:21 + _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 } 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 1baa7c7677a..dddb7acae2b 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 @@ -5,17 +5,15 @@ debug x => _1; // in scope 0 at $DIR/if-condition-int.rs:16:18: 16:19 let mut _0: u32; // return place in scope 0 at $DIR/if-condition-int.rs:16:30: 16:33 let mut _2: bool; // in scope 0 at $DIR/if-condition-int.rs:17:8: 17:9 - scope 1 { - } bb0: { - StorageLive(_2); // scope 1 at $DIR/if-condition-int.rs:17:8: 17:9 - _2 = _1; // scope 1 at $DIR/if-condition-int.rs:17:8: 17:9 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if-condition-int.rs:17:8: 17:9 + 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(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:17:8: 17:9 } bb1: { - _0 = const 0_u32; // scope 1 at $DIR/if-condition-int.rs:17:12: 17:13 + _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 } 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 13933ea52f7..2ff8386b205 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 @@ -6,20 +6,18 @@ let mut _0: i32; // return place in scope 0 at $DIR/if-condition-int.rs:52:31: 52:34 let mut _2: bool; // in scope 0 at $DIR/if-condition-int.rs:53:8: 53:18 let mut _3: f32; // in scope 0 at $DIR/if-condition-int.rs:53:8: 53:9 - scope 1 { - } bb0: { - StorageLive(_2); // scope 1 at $DIR/if-condition-int.rs:53:8: 53:18 - StorageLive(_3); // scope 1 at $DIR/if-condition-int.rs:53:8: 53:9 - _3 = _1; // scope 1 at $DIR/if-condition-int.rs:53:8: 53:9 - _2 = Eq(move _3, const -42f32); // scope 1 at $DIR/if-condition-int.rs:53:8: 53:18 - StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:53:17: 53:18 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if-condition-int.rs:53:8: 53:18 + StorageLive(_2); // scope 0 at $DIR/if-condition-int.rs:53:8: 53:18 + StorageLive(_3); // scope 0 at $DIR/if-condition-int.rs:53:8: 53:9 + _3 = _1; // scope 0 at $DIR/if-condition-int.rs:53:8: 53:9 + _2 = Eq(move _3, const -42f32); // scope 0 at $DIR/if-condition-int.rs:53:8: 53:18 + StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:53:17: 53:18 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:53:8: 53:18 } bb1: { - _0 = const 0_i32; // scope 1 at $DIR/if-condition-int.rs:53:21: 53:22 + _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 } 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 543818fdda0..40de48385f0 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 @@ -6,29 +6,27 @@ let mut _0: u32; // return place in scope 0 at $DIR/if-condition-int.rs:20:25: 20:28 let mut _2: bool; // in scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 let mut _3: char; // in scope 0 at $DIR/if-condition-int.rs:21:8: 21:9 - scope 1 { - } bb0: { - StorageLive(_2); // scope 1 at $DIR/if-condition-int.rs:21:8: 21:16 - StorageLive(_3); // scope 1 at $DIR/if-condition-int.rs:21:8: 21:9 - _3 = _1; // scope 1 at $DIR/if-condition-int.rs:21:8: 21:9 -- _2 = Eq(move _3, const 'x'); // scope 1 at $DIR/if-condition-int.rs:21:8: 21:16 -- StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:21:15: 21:16 -- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if-condition-int.rs:21:8: 21:16 -+ nop; // scope 1 at $DIR/if-condition-int.rs:21:8: 21:16 -+ nop; // scope 1 at $DIR/if-condition-int.rs:21:15: 21:16 -+ switchInt(move _3) -> ['x': bb1, otherwise: bb2]; // scope 1 at $DIR/if-condition-int.rs:21:8: 21:16 + StorageLive(_2); // scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 + StorageLive(_3); // scope 0 at $DIR/if-condition-int.rs:21:8: 21:9 + _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(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 ++ 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': bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 } bb1: { -+ StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:21:8: 21:16 - _0 = const 0_u32; // scope 1 at $DIR/if-condition-int.rs:21:19: 21:20 ++ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 + _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 1 at $DIR/if-condition-int.rs:21:8: 21:16 ++ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 _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 } 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 92e770c15e5..28c36aed84c 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 @@ -6,29 +6,27 @@ let mut _0: u32; // return place in scope 0 at $DIR/if-condition-int.rs:24:21: 24:24 let mut _2: bool; // in scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 let mut _3: i8; // in scope 0 at $DIR/if-condition-int.rs:25:8: 25:9 - scope 1 { - } bb0: { - StorageLive(_2); // scope 1 at $DIR/if-condition-int.rs:25:8: 25:15 - StorageLive(_3); // scope 1 at $DIR/if-condition-int.rs:25:8: 25:9 - _3 = _1; // scope 1 at $DIR/if-condition-int.rs:25:8: 25:9 -- _2 = Eq(move _3, const 42_i8); // scope 1 at $DIR/if-condition-int.rs:25:8: 25:15 -- StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:25:14: 25:15 -- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if-condition-int.rs:25:8: 25:15 -+ nop; // scope 1 at $DIR/if-condition-int.rs:25:8: 25:15 -+ nop; // scope 1 at $DIR/if-condition-int.rs:25:14: 25:15 -+ switchInt(move _3) -> [42_i8: bb1, otherwise: bb2]; // scope 1 at $DIR/if-condition-int.rs:25:8: 25:15 + StorageLive(_2); // scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 + StorageLive(_3); // scope 0 at $DIR/if-condition-int.rs:25:8: 25:9 + _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(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 ++ 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: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 } bb1: { -+ StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:25:8: 25:15 - _0 = const 0_u32; // scope 1 at $DIR/if-condition-int.rs:25:18: 25:19 ++ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 + _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 1 at $DIR/if-condition-int.rs:25:8: 25:15 ++ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 _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 } 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 6a3d8a948be..55932fee960 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 @@ -8,50 +8,46 @@ let mut _3: u32; // in scope 0 at $DIR/if-condition-int.rs:33:8: 33:9 let mut _4: bool; // in scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 let mut _5: u32; // in scope 0 at $DIR/if-condition-int.rs:35:15: 35:16 - scope 1 { - } - scope 2 { - } bb0: { - StorageLive(_2); // scope 1 at $DIR/if-condition-int.rs:33:8: 33:15 - StorageLive(_3); // scope 1 at $DIR/if-condition-int.rs:33:8: 33:9 - _3 = _1; // scope 1 at $DIR/if-condition-int.rs:33:8: 33:9 -- _2 = Eq(move _3, const 42_u32); // scope 1 at $DIR/if-condition-int.rs:33:8: 33:15 -- StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:33:14: 33:15 -- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if-condition-int.rs:33:8: 33:15 -+ nop; // scope 1 at $DIR/if-condition-int.rs:33:8: 33:15 -+ nop; // scope 1 at $DIR/if-condition-int.rs:33:14: 33:15 -+ switchInt(move _3) -> [42_u32: bb1, otherwise: bb2]; // scope 1 at $DIR/if-condition-int.rs:33:8: 33:15 + StorageLive(_2); // scope 0 at $DIR/if-condition-int.rs:33:8: 33:15 + StorageLive(_3); // scope 0 at $DIR/if-condition-int.rs:33:8: 33:9 + _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(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:33:8: 33:15 ++ 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: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:33:8: 33:15 } bb1: { -+ StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:33:8: 33:15 - _0 = const 0_u32; // scope 1 at $DIR/if-condition-int.rs:34:9: 34:10 ++ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:33:8: 33:15 + _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 1 at $DIR/if-condition-int.rs:33:8: 33:15 - StorageLive(_4); // scope 2 at $DIR/if-condition-int.rs:35:15: 35:22 - StorageLive(_5); // scope 2 at $DIR/if-condition-int.rs:35:15: 35:16 - _5 = _1; // scope 2 at $DIR/if-condition-int.rs:35:15: 35:16 -- _4 = Ne(move _5, const 21_u32); // scope 2 at $DIR/if-condition-int.rs:35:15: 35:22 -- StorageDead(_5); // scope 2 at $DIR/if-condition-int.rs:35:21: 35:22 -- switchInt(move _4) -> [false: bb4, otherwise: bb3]; // scope 2 at $DIR/if-condition-int.rs:35:15: 35:22 -+ nop; // scope 2 at $DIR/if-condition-int.rs:35:15: 35:22 -+ nop; // scope 2 at $DIR/if-condition-int.rs:35:21: 35:22 -+ switchInt(move _5) -> [21_u32: bb4, otherwise: bb3]; // scope 2 at $DIR/if-condition-int.rs:35:15: 35:22 ++ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:33:8: 33:15 + 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(move _4) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 ++ 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: bb4, otherwise: bb3]; // scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 } bb3: { -+ StorageDead(_5); // scope 2 at $DIR/if-condition-int.rs:35:15: 35:22 - _0 = const 1_u32; // scope 2 at $DIR/if-condition-int.rs:36:9: 36:10 ++ StorageDead(_5); // scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 + _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 2 at $DIR/if-condition-int.rs:35:15: 35:22 ++ StorageDead(_5); // scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 _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 } 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 fa2ef0c1ec5..c4574b32a59 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 @@ -6,29 +6,27 @@ let mut _0: u32; // return place in scope 0 at $DIR/if-condition-int.rs:28:28: 28:31 let mut _2: bool; // in scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 let mut _3: i32; // in scope 0 at $DIR/if-condition-int.rs:29:8: 29:9 - scope 1 { - } bb0: { - StorageLive(_2); // scope 1 at $DIR/if-condition-int.rs:29:8: 29:16 - StorageLive(_3); // scope 1 at $DIR/if-condition-int.rs:29:8: 29:9 - _3 = _1; // scope 1 at $DIR/if-condition-int.rs:29:8: 29:9 -- _2 = Eq(move _3, const -42_i32); // scope 1 at $DIR/if-condition-int.rs:29:8: 29:16 -- StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:29:15: 29:16 -- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if-condition-int.rs:29:8: 29:16 -+ nop; // scope 1 at $DIR/if-condition-int.rs:29:8: 29:16 -+ nop; // scope 1 at $DIR/if-condition-int.rs:29:15: 29:16 -+ switchInt(move _3) -> [-42_i32: bb1, otherwise: bb2]; // scope 1 at $DIR/if-condition-int.rs:29:8: 29:16 + StorageLive(_2); // scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 + StorageLive(_3); // scope 0 at $DIR/if-condition-int.rs:29:8: 29:9 + _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(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 ++ 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: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 } bb1: { -+ StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:29:8: 29:16 - _0 = const 0_u32; // scope 1 at $DIR/if-condition-int.rs:29:19: 29:20 ++ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 + _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 1 at $DIR/if-condition-int.rs:29:8: 29:16 ++ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 _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 } 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 9549e198060..88d9d5622b8 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 @@ -6,29 +6,27 @@ let mut _0: u32; // return place in scope 0 at $DIR/if-condition-int.rs:11:23: 11:26 let mut _2: bool; // in scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 let mut _3: u32; // in scope 0 at $DIR/if-condition-int.rs:12:8: 12:9 - scope 1 { - } bb0: { - StorageLive(_2); // scope 1 at $DIR/if-condition-int.rs:12:8: 12:15 - StorageLive(_3); // scope 1 at $DIR/if-condition-int.rs:12:8: 12:9 - _3 = _1; // scope 1 at $DIR/if-condition-int.rs:12:8: 12:9 -- _2 = Eq(move _3, const 42_u32); // scope 1 at $DIR/if-condition-int.rs:12:8: 12:15 -- StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:12:14: 12:15 -- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if-condition-int.rs:12:8: 12:15 -+ nop; // scope 1 at $DIR/if-condition-int.rs:12:8: 12:15 -+ nop; // scope 1 at $DIR/if-condition-int.rs:12:14: 12:15 -+ switchInt(move _3) -> [42_u32: bb1, otherwise: bb2]; // scope 1 at $DIR/if-condition-int.rs:12:8: 12:15 + StorageLive(_2); // scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 + StorageLive(_3); // scope 0 at $DIR/if-condition-int.rs:12:8: 12:9 + _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(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 ++ 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: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 } bb1: { -+ StorageDead(_3); // scope 1 at $DIR/if-condition-int.rs:12:8: 12:15 - _0 = const 0_u32; // scope 1 at $DIR/if-condition-int.rs:12:18: 12:19 ++ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 + _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 1 at $DIR/if-condition-int.rs:12:8: 12:15 ++ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 _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 } 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 9a00bb809c6..da55260e284 100644 --- a/src/test/mir-opt/inline/inline_diverging.g.Inline.diff +++ b/src/test/mir-opt/inline/inline_diverging.g.Inline.diff @@ -9,26 +9,24 @@ let mut _4: i32; // in scope 0 at $DIR/inline-diverging.rs:14:9: 14:10 let mut _5: !; // in scope 0 at $DIR/inline-diverging.rs:15:12: 17:6 let _6: !; // in scope 0 at $DIR/inline-diverging.rs:16:9: 16:16 - scope 1 { - } -+ scope 2 (inlined panic) { // at $DIR/inline-diverging.rs:16:9: 16:16 -+ let mut _7: !; // in scope 2 at $SRC_DIR/std/src/panic.rs:LL:COL ++ scope 1 (inlined panic) { // at $DIR/inline-diverging.rs:16:9: 16:16 ++ let mut _7: !; // in scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL + } bb0: { - StorageLive(_2); // scope 1 at $DIR/inline-diverging.rs:13:8: 13:13 - StorageLive(_3); // scope 1 at $DIR/inline-diverging.rs:13:8: 13:9 - _3 = _1; // scope 1 at $DIR/inline-diverging.rs:13:8: 13:9 - _2 = Gt(move _3, const 0_i32); // scope 1 at $DIR/inline-diverging.rs:13:8: 13:13 - StorageDead(_3); // scope 1 at $DIR/inline-diverging.rs:13:12: 13:13 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/inline-diverging.rs:13:8: 13:13 + StorageLive(_2); // scope 0 at $DIR/inline-diverging.rs:13:8: 13:13 + StorageLive(_3); // scope 0 at $DIR/inline-diverging.rs:13:8: 13:9 + _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(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/inline-diverging.rs:13:8: 13:13 } bb1: { - StorageLive(_4); // scope 1 at $DIR/inline-diverging.rs:14:9: 14:10 - _4 = _1; // scope 1 at $DIR/inline-diverging.rs:14:9: 14:10 - _0 = move _4 as u32 (Misc); // scope 1 at $DIR/inline-diverging.rs:14:9: 14:17 - StorageDead(_4); // scope 1 at $DIR/inline-diverging.rs:14:16: 14:17 + 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 } @@ -36,8 +34,8 @@ bb2: { StorageLive(_6); // scope 0 at $DIR/inline-diverging.rs:16:9: 16:16 - _6 = panic(); // scope 0 at $DIR/inline-diverging.rs:16:9: 16:16 -+ StorageLive(_7); // scope 2 at $SRC_DIR/std/src/panic.rs:LL:COL -+ _7 = begin_panic::<&str>(const "explicit panic"); // scope 2 at $SRC_DIR/std/src/panic.rs:LL:COL ++ StorageLive(_7); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL ++ _7 = begin_panic::<&str>(const "explicit panic"); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL // mir::Constant - // + span: $DIR/inline-diverging.rs:16:9: 16:14 - // + literal: Const { ty: fn() -> ! {panic}, val: Value(Scalar(<ZST>)) } 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 af32b315802..3e1c4a46701 100644 --- a/src/test/mir-opt/inline/inline_generator.main.Inline.diff +++ b/src/test/mir-opt/inline/inline_generator.main.Inline.diff @@ -33,8 +33,6 @@ + let mut _13: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + let mut _14: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + let mut _15: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41 -+ scope 7 { -+ } + } bb0: { @@ -106,13 +104,13 @@ + bb3: { + _11 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:17: 15:39 -+ StorageLive(_9); // scope 7 at $DIR/inline-generator.rs:15:20: 15:21 -+ _9 = _11; // scope 7 at $DIR/inline-generator.rs:15:20: 15:21 -+ switchInt(move _9) -> [false: bb5, otherwise: bb4]; // scope 7 at $DIR/inline-generator.rs:15:20: 15:21 ++ StorageLive(_9); // scope 6 at $DIR/inline-generator.rs:15:20: 15:21 ++ _9 = _11; // scope 6 at $DIR/inline-generator.rs:15:20: 15:21 ++ switchInt(move _9) -> [false: bb5, otherwise: bb4]; // scope 6 at $DIR/inline-generator.rs:15:20: 15:21 + } + + bb4: { -+ _8 = const 7_i32; // scope 7 at $DIR/inline-generator.rs:15:24: 15:25 ++ _8 = const 7_i32; // scope 6 at $DIR/inline-generator.rs:15:24: 15:25 + goto -> bb6; // scope 6 at $DIR/inline-generator.rs:15:17: 15:39 + } + 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 d4fe82cc99f..a2471e4308b 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 @@ -9,8 +9,6 @@ fn main() -> () { let mut _5: !; // in scope 0 at $DIR/issue-38669.rs:7:25: 9:10 scope 1 { debug should_break => _1; // in scope 1 at $DIR/issue-38669.rs:5:9: 5:25 - scope 2 { - } } bb0: { @@ -26,13 +24,13 @@ fn main() -> () { bb2: { StorageLive(_3); // scope 1 at $DIR/issue-38669.rs:7:9: 9:10 - StorageLive(_4); // scope 2 at $DIR/issue-38669.rs:7:12: 7:24 - _4 = _1; // scope 2 at $DIR/issue-38669.rs:7:12: 7:24 - switchInt(move _4) -> [false: bb4, otherwise: bb3]; // scope 2 at $DIR/issue-38669.rs:7:12: 7:24 + 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 + switchInt(move _4) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/issue-38669.rs:7:12: 7:24 } bb3: { - _0 = const (); // scope 2 at $DIR/issue-38669.rs:8:13: 8:18 + _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 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 7930aa99768..ce7ca20358e 100644 --- a/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir +++ b/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir @@ -15,10 +15,8 @@ fn main() -> () { scope 1 { debug e => _1; // in scope 1 at $DIR/issue-41888.rs:7:9: 7:10 scope 2 { - scope 3 { - debug _k => _6; // in scope 3 at $DIR/issue-41888.rs:10:21: 10:23 - let _6: K; // in scope 3 at $DIR/issue-41888.rs:10:21: 10:23 - } + debug _k => _6; // in scope 2 at $DIR/issue-41888.rs:10:21: 10:23 + let _6: K; // in scope 2 at $DIR/issue-41888.rs:10:21: 10:23 } } @@ -27,48 +25,48 @@ fn main() -> () { _7 = const false; // scope 0 at $DIR/issue-41888.rs:7:9: 7:10 _8 = const false; // scope 0 at $DIR/issue-41888.rs:7:9: 7:10 StorageLive(_1); // scope 0 at $DIR/issue-41888.rs:7:9: 7:10 - StorageLive(_2); // scope 2 at $DIR/issue-41888.rs:8:8: 8:14 - _2 = cond() -> [return: bb1, unwind: bb11]; // scope 2 at $DIR/issue-41888.rs:8:8: 8:14 + StorageLive(_2); // scope 1 at $DIR/issue-41888.rs:8:8: 8:14 + _2 = cond() -> [return: bb1, unwind: bb11]; // scope 1 at $DIR/issue-41888.rs:8:8: 8:14 // mir::Constant // + span: $DIR/issue-41888.rs:8:8: 8:12 // + literal: Const { ty: fn() -> bool {cond}, val: Value(Scalar(<ZST>)) } } bb1: { - switchInt(move _2) -> [false: bb7, otherwise: bb2]; // scope 2 at $DIR/issue-41888.rs:8:8: 8:14 + switchInt(move _2) -> [false: bb7, otherwise: bb2]; // scope 1 at $DIR/issue-41888.rs:8:8: 8:14 } bb2: { - StorageLive(_3); // scope 2 at $DIR/issue-41888.rs:9:13: 9:20 - StorageLive(_4); // scope 2 at $DIR/issue-41888.rs:9:18: 9:19 - _4 = K; // scope 2 at $DIR/issue-41888.rs:9:18: 9:19 - _3 = E::F(move _4); // scope 2 at $DIR/issue-41888.rs:9:13: 9:20 - StorageDead(_4); // scope 2 at $DIR/issue-41888.rs:9:19: 9:20 - goto -> bb14; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 + 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 + _3 = E::F(move _4); // scope 1 at $DIR/issue-41888.rs:9:13: 9:20 + StorageDead(_4); // scope 1 at $DIR/issue-41888.rs:9:19: 9:20 + goto -> bb14; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 } bb3: { - goto -> bb4; // scope 2 at $DIR/issue-41888.rs:9:19: 9:20 + goto -> bb4; // scope 1 at $DIR/issue-41888.rs:9:19: 9:20 } bb4: { - StorageDead(_3); // scope 2 at $DIR/issue-41888.rs:9:19: 9:20 - _5 = discriminant(_1); // scope 3 at $DIR/issue-41888.rs:10:16: 10:24 - switchInt(move _5) -> [0_isize: bb5, otherwise: bb6]; // scope 3 at $DIR/issue-41888.rs:10:16: 10:24 + StorageDead(_3); // scope 1 at $DIR/issue-41888.rs:9:19: 9:20 + _5 = discriminant(_1); // scope 2 at $DIR/issue-41888.rs:10:16: 10:24 + switchInt(move _5) -> [0_isize: bb5, otherwise: bb6]; // scope 2 at $DIR/issue-41888.rs:10:16: 10:24 } bb5: { - StorageLive(_6); // scope 3 at $DIR/issue-41888.rs:10:21: 10:23 - _9 = const false; // scope 3 at $DIR/issue-41888.rs:10:21: 10:23 - _6 = move ((_1 as F).0: K); // scope 3 at $DIR/issue-41888.rs:10:21: 10:23 - _0 = const (); // scope 3 at $DIR/issue-41888.rs:10:29: 13:10 - StorageDead(_6); // scope 2 at $DIR/issue-41888.rs:13:9: 13:10 - goto -> bb8; // scope 2 at $DIR/issue-41888.rs:10:9: 13:10 + StorageLive(_6); // scope 2 at $DIR/issue-41888.rs:10:21: 10:23 + _9 = const false; // scope 2 at $DIR/issue-41888.rs:10:21: 10:23 + _6 = move ((_1 as F).0: K); // scope 2 at $DIR/issue-41888.rs:10:21: 10:23 + _0 = const (); // scope 2 at $DIR/issue-41888.rs:10:29: 13:10 + StorageDead(_6); // scope 1 at $DIR/issue-41888.rs:13:9: 13:10 + goto -> bb8; // scope 1 at $DIR/issue-41888.rs:10:9: 13:10 } bb6: { - _0 = const (); // scope 2 at $DIR/issue-41888.rs:13:10: 13:10 - goto -> bb8; // scope 2 at $DIR/issue-41888.rs:10:9: 13:10 + _0 = const (); // scope 1 at $DIR/issue-41888.rs:13:10: 13:10 + goto -> bb8; // scope 1 at $DIR/issue-41888.rs:10:9: 13:10 } bb7: { @@ -90,7 +88,7 @@ fn main() -> () { } bb10 (cleanup): { - goto -> bb11; // scope 2 at $DIR/issue-41888.rs:9:19: 9:20 + goto -> bb11; // scope 1 at $DIR/issue-41888.rs:9:19: 9:20 } bb11 (cleanup): { @@ -102,19 +100,19 @@ fn main() -> () { } bb13 (cleanup): { - _7 = const true; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 - _8 = const true; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 - _9 = const true; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 - _1 = move _3; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 - goto -> bb10; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 + _7 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 + _8 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 + _9 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 + _1 = move _3; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 + goto -> bb10; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 } bb14: { - _7 = const true; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 - _8 = const true; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 - _9 = const true; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 - _1 = move _3; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 - goto -> bb3; // scope 2 at $DIR/issue-41888.rs:9:9: 9:10 + _7 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 + _8 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 + _9 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 + _1 = move _3; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 + goto -> bb3; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 } bb15: { 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 52a4cc661a5..8b0a73ec4ba 100644 --- a/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff +++ b/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff @@ -29,11 +29,9 @@ scope 4 { debug left_val => _8; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL debug right_val => _9; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _13: core::panicking::AssertKind; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL scope 5 { - let _13: core::panicking::AssertKind; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - scope 6 { - debug kind => _13; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - } + debug kind => _13; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } } } @@ -72,32 +70,32 @@ _8 = (_5.0: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _9 = (_5.1: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_10); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_11); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_12); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _12 = (*_8); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _11 = Eq(move _12, const 1_i32); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_12); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _10 = Not(move _11); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_11); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(move _10) -> [false: bb2, otherwise: bb1]; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_12); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _12 = (*_8); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _11 = Eq(move _12, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_12); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _10 = Not(move _11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(move _10) -> [false: bb2, otherwise: bb1]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb1: { - StorageLive(_13); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_14); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_15); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_16); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _16 = _8; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _15 = _16; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_17); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_18); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _18 = _9; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _17 = _18; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_19); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - Deinit(_19); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - discriminant(_19) = 0; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _14 = core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _15, move _17, move _19); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_13); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_14); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_15); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_16); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _16 = _8; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _15 = _16; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_17); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _18 = _9; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _17 = _18; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_19); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + Deinit(_19); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + discriminant(_19) = 0; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _14 = core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _15, move _17, move _19); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, Option<Arguments<'t0>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(Scalar(<ZST>)) } 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 877c03d65cf..c96a6641bab 100644 --- a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff +++ b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff @@ -37,11 +37,9 @@ scope 4 { debug left_val => _13; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL debug right_val => _14; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _20: core::panicking::AssertKind; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL scope 5 { - let _20: core::panicking::AssertKind; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - scope 6 { - debug kind => _20; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - } + debug kind => _20; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } } } @@ -99,42 +97,42 @@ _13 = (_9.0: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _14 = (_9.1: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_15); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_16); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_17); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _17 = (*_13); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _18 = const 1_i32; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _16 = Eq(move _17, const 1_i32); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_17); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _15 = Not(move _16); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_16); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(move _15) -> [false: bb4, otherwise: bb3]; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _17 = (*_13); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_18); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _18 = const 1_i32; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _16 = Eq(move _17, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_18); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + 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(move _15) -> [false: bb4, otherwise: bb3]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb3: { - StorageLive(_20); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - Deinit(_20); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - discriminant(_20) = 0; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_21); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_22); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _22 = const core::panicking::AssertKind::Eq; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + Deinit(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + discriminant(_20) = 0; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_21); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_22); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _22 = const core::panicking::AssertKind::Eq; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) } - StorageLive(_23); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_24); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _24 = _13; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _23 = _24; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_25); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_26); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _26 = _14; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _25 = _26; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_27); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - Deinit(_27); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - discriminant(_27) = 0; // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _21 = core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _23, move _25, move _27); // scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_23); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_24); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _24 = _13; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _23 = _24; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_25); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_26); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _26 = _14; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _25 = _26; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + Deinit(_27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + discriminant(_27) = 0; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _21 = core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _23, move _25, move _27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, Option<Arguments<'t0>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(Scalar(<ZST>)) } diff --git a/src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir b/src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir index 1dca68fd727..40e7b74453a 100644 --- a/src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir +++ b/src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir @@ -8,62 +8,60 @@ fn num_to_digit(_1: char) -> u32 { let mut _4: char; // in scope 0 at $DIR/issue-59352.rs:14:26: 14:29 let mut _5: u32; // in scope 0 at $DIR/issue-59352.rs:14:8: 14:23 let mut _12: isize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - scope 1 { - scope 2 (inlined char::methods::<impl char>::is_digit) { // at $DIR/issue-59352.rs:14:8: 14:23 - debug self => _2; // in scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL - debug radix => _5; // in scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL - let mut _6: &std::option::Option<u32>; // in scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL - let _7: std::option::Option<u32>; // in scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL - let mut _8: char; // in scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL - scope 3 (inlined Option::<u32>::is_some) { // at $SRC_DIR/core/src/char/methods.rs:LL:COL - debug self => _6; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - let mut _9: isize; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - } + scope 1 (inlined char::methods::<impl char>::is_digit) { // at $DIR/issue-59352.rs:14:8: 14:23 + debug self => _2; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL + debug radix => _5; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL + let mut _6: &std::option::Option<u32>; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL + let _7: std::option::Option<u32>; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL + let mut _8: char; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL + scope 2 (inlined Option::<u32>::is_some) { // at $SRC_DIR/core/src/char/methods.rs:LL:COL + debug self => _6; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL + let mut _9: isize; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL } - scope 4 (inlined #[track_caller] Option::<u32>::unwrap) { // at $DIR/issue-59352.rs:14:26: 14:50 - debug self => _3; // in scope 4 at $SRC_DIR/core/src/option.rs:LL:COL - let mut _10: isize; // in scope 4 at $SRC_DIR/core/src/option.rs:LL:COL - let mut _11: !; // in scope 4 at $SRC_DIR/core/src/option.rs:LL:COL - scope 5 { - debug val => _0; // in scope 5 at $SRC_DIR/core/src/option.rs:LL:COL - } + } + scope 3 (inlined #[track_caller] Option::<u32>::unwrap) { // at $DIR/issue-59352.rs:14:26: 14:50 + debug self => _3; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL + let mut _10: isize; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL + let mut _11: !; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL + scope 4 { + debug val => _0; // in scope 4 at $SRC_DIR/core/src/option.rs:LL:COL } } bb0: { - StorageLive(_2); // scope 1 at $DIR/issue-59352.rs:14:8: 14:11 - _2 = _1; // scope 1 at $DIR/issue-59352.rs:14:8: 14:11 - StorageLive(_5); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 - StorageLive(_6); // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL - StorageLive(_7); // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL - StorageLive(_8); // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL - _8 = _2; // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL - _7 = char::methods::<impl char>::to_digit(move _8, const 8_u32) -> bb5; // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL + StorageLive(_2); // scope 0 at $DIR/issue-59352.rs:14:8: 14:11 + _2 = _1; // scope 0 at $DIR/issue-59352.rs:14:8: 14:11 + StorageLive(_5); // scope 0 at $DIR/issue-59352.rs:14:8: 14:23 + StorageLive(_6); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL + StorageLive(_7); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL + StorageLive(_8); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL + _8 = _2; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL + _7 = char::methods::<impl char>::to_digit(move _8, const 8_u32) -> bb5; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/char/methods.rs:LL:COL // + literal: Const { ty: fn(char, u32) -> Option<u32> {char::methods::<impl char>::to_digit}, val: Value(Scalar(<ZST>)) } } bb1: { - StorageDead(_12); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 - StorageLive(_3); // scope 1 at $DIR/issue-59352.rs:14:26: 14:41 - StorageLive(_4); // scope 1 at $DIR/issue-59352.rs:14:26: 14:29 - _4 = _1; // scope 1 at $DIR/issue-59352.rs:14:26: 14:29 - _3 = char::methods::<impl char>::to_digit(move _4, const 8_u32) -> bb2; // scope 1 at $DIR/issue-59352.rs:14:26: 14:41 + StorageDead(_12); // scope 0 at $DIR/issue-59352.rs:14:8: 14:23 + StorageLive(_3); // scope 0 at $DIR/issue-59352.rs:14:26: 14:41 + StorageLive(_4); // scope 0 at $DIR/issue-59352.rs:14:26: 14:29 + _4 = _1; // scope 0 at $DIR/issue-59352.rs:14:26: 14:29 + _3 = char::methods::<impl char>::to_digit(move _4, const 8_u32) -> bb2; // scope 0 at $DIR/issue-59352.rs:14:26: 14:41 // mir::Constant // + span: $DIR/issue-59352.rs:14:30: 14:38 // + literal: Const { ty: fn(char, u32) -> Option<u32> {char::methods::<impl char>::to_digit}, val: Value(Scalar(<ZST>)) } } bb2: { - StorageDead(_4); // scope 1 at $DIR/issue-59352.rs:14:40: 14:41 - StorageLive(_10); // scope 1 at $DIR/issue-59352.rs:14:26: 14:50 - _10 = discriminant(_3); // scope 4 at $SRC_DIR/core/src/option.rs:LL:COL - switchInt(move _10) -> [0_isize: bb6, 1_isize: bb8, otherwise: bb7]; // scope 4 at $SRC_DIR/core/src/option.rs:LL:COL + StorageDead(_4); // scope 0 at $DIR/issue-59352.rs:14:40: 14:41 + StorageLive(_10); // scope 0 at $DIR/issue-59352.rs:14:26: 14:50 + _10 = discriminant(_3); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL + switchInt(move _10) -> [0_isize: bb6, 1_isize: bb8, otherwise: bb7]; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL } bb3: { - StorageDead(_12); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 + StorageDead(_12); // scope 0 at $DIR/issue-59352.rs:14:8: 14:23 _0 = const 0_u32; // scope 0 at $DIR/issue-59352.rs:14:60: 14:61 goto -> bb4; // scope 0 at $DIR/issue-59352.rs:14:5: 14:63 } @@ -73,23 +71,23 @@ fn num_to_digit(_1: char) -> u32 { } bb5: { - _6 = &_7; // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL - StorageDead(_8); // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL - StorageLive(_9); // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL - _9 = discriminant((*_6)); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - StorageLive(_12); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _12 = move _9; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_9); // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL - StorageDead(_6); // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL - StorageDead(_7); // scope 2 at $SRC_DIR/core/src/char/methods.rs:LL:COL - StorageDead(_5); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 - StorageDead(_2); // scope 1 at $DIR/issue-59352.rs:14:22: 14:23 - switchInt(move _12) -> [1_isize: bb1, otherwise: bb3]; // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 + _6 = &_7; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL + StorageDead(_8); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL + StorageLive(_9); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL + _9 = discriminant((*_6)); // scope 2 at $SRC_DIR/core/src/option.rs:LL:COL + StorageLive(_12); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _12 = move _9; // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_9); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL + StorageDead(_6); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL + StorageDead(_7); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL + StorageDead(_5); // scope 0 at $DIR/issue-59352.rs:14:8: 14:23 + StorageDead(_2); // scope 0 at $DIR/issue-59352.rs:14:22: 14:23 + switchInt(move _12) -> [1_isize: bb1, otherwise: bb3]; // scope 0 at $DIR/issue-59352.rs:14:8: 14:23 } bb6: { - StorageLive(_11); // scope 4 at $SRC_DIR/core/src/option.rs:LL:COL - _11 = core::panicking::panic(const "called `Option::unwrap()` on a `None` value"); // scope 4 at $SRC_DIR/core/src/option.rs:LL:COL + StorageLive(_11); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL + _11 = core::panicking::panic(const "called `Option::unwrap()` on a `None` value"); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/option.rs:LL:COL // + literal: Const { ty: fn(&'static str) -> ! {core::panicking::panic}, val: Value(Scalar(<ZST>)) } @@ -99,13 +97,13 @@ fn num_to_digit(_1: char) -> u32 { } bb7: { - unreachable; // scope 4 at $SRC_DIR/core/src/option.rs:LL:COL + unreachable; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL } bb8: { - _0 = move ((_3 as Some).0: u32); // scope 4 at $SRC_DIR/core/src/option.rs:LL:COL - StorageDead(_10); // scope 1 at $DIR/issue-59352.rs:14:26: 14:50 - StorageDead(_3); // scope 1 at $DIR/issue-59352.rs:14:49: 14:50 + _0 = move ((_3 as Some).0: u32); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL + StorageDead(_10); // scope 0 at $DIR/issue-59352.rs:14:26: 14:50 + StorageDead(_3); // scope 0 at $DIR/issue-59352.rs:14:49: 14:50 goto -> bb4; // scope 0 at $DIR/issue-59352.rs:14:5: 14:63 } } 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 d39bb419e3f..9e91603cee9 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 @@ -9,20 +9,18 @@ fn main() -> () { let mut _5: (); // in scope 0 at $DIR/loop_test.rs:6:1: 17:2 let _6: i32; // in scope 0 at $DIR/loop_test.rs:14:13: 14:14 scope 1 { - } - scope 2 { - debug x => _6; // in scope 2 at $DIR/loop_test.rs:14:13: 14:14 + debug x => _6; // in scope 1 at $DIR/loop_test.rs:14:13: 14:14 } bb0: { StorageLive(_1); // scope 0 at $DIR/loop_test.rs:10:5: 12:6 - StorageLive(_2); // scope 1 at $DIR/loop_test.rs:10:8: 10:12 - _2 = const true; // scope 1 at $DIR/loop_test.rs:10:8: 10:12 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/loop_test.rs:10:8: 10:12 + 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 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/loop_test.rs:10:8: 10:12 } bb1: { - _0 = const (); // scope 1 at $DIR/loop_test.rs:11:9: 11:15 + _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 diff --git a/src/test/mir-opt/lower_array_len.array_bound.InstCombine.diff b/src/test/mir-opt/lower_array_len.array_bound.InstCombine.diff index e2cc076c6d8..c7226573d75 100644 --- a/src/test/mir-opt/lower_array_len.array_bound.InstCombine.diff +++ b/src/test/mir-opt/lower_array_len.array_bound.InstCombine.diff @@ -13,45 +13,43 @@ let _8: usize; // in scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 let mut _9: usize; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 let mut _10: bool; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 - scope 1 { - let mut _11: &[u8; N]; // in scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 - } + let mut _11: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 bb0: { - StorageLive(_3); // scope 1 at $DIR/lower_array_len.rs:7:8: 7:27 - StorageLive(_4); // scope 1 at $DIR/lower_array_len.rs:7:8: 7:13 - _4 = _1; // scope 1 at $DIR/lower_array_len.rs:7:8: 7:13 - StorageLive(_5); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 - StorageLive(_6); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 - StorageLive(_7); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 -- _7 = &(*_2); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 -+ _7 = _2; // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 - StorageLive(_11); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 - _11 = _7; // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 - _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 - StorageDead(_7); // scope 1 at $DIR/lower_array_len.rs:7:20: 7:21 -- _5 = Len((*_11)); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 -+ _5 = const N; // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 - StorageDead(_11); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 - StorageDead(_6); // scope 1 at $DIR/lower_array_len.rs:7:26: 7:27 - _3 = Lt(move _4, move _5); // scope 1 at $DIR/lower_array_len.rs:7:8: 7:27 - StorageDead(_5); // scope 1 at $DIR/lower_array_len.rs:7:26: 7:27 - StorageDead(_4); // scope 1 at $DIR/lower_array_len.rs:7:26: 7:27 - switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 1 at $DIR/lower_array_len.rs:7:8: 7:27 + StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27 + StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:13 + _4 = _1; // scope 0 at $DIR/lower_array_len.rs:7:8: 7:13 + StorageLive(_5); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageLive(_7); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 +- _7 = &(*_2); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 ++ _7 = _2; // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageLive(_11); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 + _11 = _7; // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 + _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:7:20: 7:21 +- _5 = Len((*_11)); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 ++ _5 = const N; // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageDead(_11); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27 + _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27 + StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27 + StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27 + switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27 } bb1: { - StorageLive(_8); // scope 1 at $DIR/lower_array_len.rs:8:15: 8:20 - _8 = _1; // scope 1 at $DIR/lower_array_len.rs:8:15: 8:20 -- _9 = Len((*_2)); // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 -+ _9 = const N; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 - _10 = Lt(_8, _9); // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 - assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 + StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 + _8 = _1; // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 +- _9 = Len((*_2)); // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 ++ _9 = const N; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 + _10 = Lt(_8, _9); // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 + assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 } bb2: { - _0 = (*_2)[_8]; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 - StorageDead(_8); // scope 1 at $DIR/lower_array_len.rs:9:5: 9:6 + _0 = (*_2)[_8]; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 + StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:9:5: 9:6 goto -> bb4; // scope 0 at $DIR/lower_array_len.rs:7:5: 11:6 } diff --git a/src/test/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.diff b/src/test/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.diff index d1cd3865da3..d6c1c92cd91 100644 --- a/src/test/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.diff +++ b/src/test/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.diff @@ -13,47 +13,45 @@ let _8: usize; // in scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 let mut _9: usize; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 let mut _10: bool; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 - scope 1 { -+ let mut _11: &[u8; N]; // in scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 - } ++ let mut _11: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 bb0: { - StorageLive(_3); // scope 1 at $DIR/lower_array_len.rs:7:8: 7:27 - StorageLive(_4); // scope 1 at $DIR/lower_array_len.rs:7:8: 7:13 - _4 = _1; // scope 1 at $DIR/lower_array_len.rs:7:8: 7:13 - StorageLive(_5); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 - StorageLive(_6); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 - StorageLive(_7); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 - _7 = &(*_2); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 -+ StorageLive(_11); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 -+ _11 = _7; // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 - _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 - StorageDead(_7); // scope 1 at $DIR/lower_array_len.rs:7:20: 7:21 -- _5 = Len((*_6)); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 -+ _5 = Len((*_11)); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 -+ StorageDead(_11); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 - goto -> bb1; // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27 + StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:13 + _4 = _1; // scope 0 at $DIR/lower_array_len.rs:7:8: 7:13 + StorageLive(_5); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageLive(_7); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 + _7 = &(*_2); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 ++ StorageLive(_11); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 ++ _11 = _7; // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 + _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 + StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:7:20: 7:21 +- _5 = Len((*_6)); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 ++ _5 = Len((*_11)); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 ++ StorageDead(_11); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 + goto -> bb1; // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 } bb1: { - StorageDead(_6); // scope 1 at $DIR/lower_array_len.rs:7:26: 7:27 - _3 = Lt(move _4, move _5); // scope 1 at $DIR/lower_array_len.rs:7:8: 7:27 - StorageDead(_5); // scope 1 at $DIR/lower_array_len.rs:7:26: 7:27 - StorageDead(_4); // scope 1 at $DIR/lower_array_len.rs:7:26: 7:27 - switchInt(move _3) -> [false: bb4, otherwise: bb2]; // scope 1 at $DIR/lower_array_len.rs:7:8: 7:27 + StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27 + _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27 + StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27 + StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27 + switchInt(move _3) -> [false: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27 } bb2: { - StorageLive(_8); // scope 1 at $DIR/lower_array_len.rs:8:15: 8:20 - _8 = _1; // scope 1 at $DIR/lower_array_len.rs:8:15: 8:20 - _9 = Len((*_2)); // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 - _10 = Lt(_8, _9); // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 - assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb3; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 + StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 + _8 = _1; // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 + _9 = Len((*_2)); // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 + _10 = Lt(_8, _9); // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 + assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb3; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 } bb3: { - _0 = (*_2)[_8]; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 - StorageDead(_8); // scope 1 at $DIR/lower_array_len.rs:9:5: 9:6 + _0 = (*_2)[_8]; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 + StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:9:5: 9:6 goto -> bb5; // scope 0 at $DIR/lower_array_len.rs:7:5: 11:6 } diff --git a/src/test/mir-opt/lower_array_len.array_bound.SimplifyLocals.diff b/src/test/mir-opt/lower_array_len.array_bound.SimplifyLocals.diff index 3d7047b71d3..887c7b01f43 100644 --- a/src/test/mir-opt/lower_array_len.array_bound.SimplifyLocals.diff +++ b/src/test/mir-opt/lower_array_len.array_bound.SimplifyLocals.diff @@ -13,49 +13,47 @@ - let _8: usize; // in scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 - let mut _9: usize; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 - let mut _10: bool; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 +- let mut _11: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 + let _6: usize; // in scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 + let mut _7: usize; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 + let mut _8: bool; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 - scope 1 { -- let mut _11: &[u8; N]; // in scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 - } bb0: { - StorageLive(_3); // scope 1 at $DIR/lower_array_len.rs:7:8: 7:27 - StorageLive(_4); // scope 1 at $DIR/lower_array_len.rs:7:8: 7:13 - _4 = _1; // scope 1 at $DIR/lower_array_len.rs:7:8: 7:13 - StorageLive(_5); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 -- StorageLive(_6); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 -- StorageLive(_7); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 -- StorageLive(_11); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 -- StorageDead(_7); // scope 1 at $DIR/lower_array_len.rs:7:20: 7:21 - _5 = const N; // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 -- StorageDead(_11); // scope 1 at $DIR/lower_array_len.rs:7:16: 7:27 -- StorageDead(_6); // scope 1 at $DIR/lower_array_len.rs:7:26: 7:27 - _3 = Lt(move _4, move _5); // scope 1 at $DIR/lower_array_len.rs:7:8: 7:27 - StorageDead(_5); // scope 1 at $DIR/lower_array_len.rs:7:26: 7:27 - StorageDead(_4); // scope 1 at $DIR/lower_array_len.rs:7:26: 7:27 - switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 1 at $DIR/lower_array_len.rs:7:8: 7:27 + StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27 + StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:13 + _4 = _1; // scope 0 at $DIR/lower_array_len.rs:7:8: 7:13 + StorageLive(_5); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 +- StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 +- StorageLive(_7); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 +- StorageLive(_11); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 +- StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:7:20: 7:21 + _5 = const N; // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 +- StorageDead(_11); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27 +- StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27 + _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27 + StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27 + StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27 + switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27 } bb1: { -- StorageLive(_8); // scope 1 at $DIR/lower_array_len.rs:8:15: 8:20 -- _8 = _1; // scope 1 at $DIR/lower_array_len.rs:8:15: 8:20 -- _9 = const N; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 -- _10 = Lt(_8, _9); // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 -+ StorageLive(_6); // scope 1 at $DIR/lower_array_len.rs:8:15: 8:20 -+ _6 = _1; // scope 1 at $DIR/lower_array_len.rs:8:15: 8:20 -+ _7 = const N; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 -+ _8 = Lt(_6, _7); // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 -+ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb2; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 +- StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 +- _8 = _1; // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 +- _9 = const N; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 +- _10 = Lt(_8, _9); // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 ++ StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 ++ _6 = _1; // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20 ++ _7 = const N; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 ++ _8 = Lt(_6, _7); // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 ++ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb2; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 } bb2: { -- _0 = (*_2)[_8]; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 -- StorageDead(_8); // scope 1 at $DIR/lower_array_len.rs:9:5: 9:6 -+ _0 = (*_2)[_6]; // scope 1 at $DIR/lower_array_len.rs:8:9: 8:21 -+ StorageDead(_6); // scope 1 at $DIR/lower_array_len.rs:9:5: 9:6 +- _0 = (*_2)[_8]; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 +- StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:9:5: 9:6 ++ _0 = (*_2)[_6]; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21 ++ StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:9:5: 9:6 goto -> bb4; // scope 0 at $DIR/lower_array_len.rs:7:5: 11:6 } diff --git a/src/test/mir-opt/lower_array_len.array_bound_mut.InstCombine.diff b/src/test/mir-opt/lower_array_len.array_bound_mut.InstCombine.diff index ef5641ad343..5622d484532 100644 --- a/src/test/mir-opt/lower_array_len.array_bound_mut.InstCombine.diff +++ b/src/test/mir-opt/lower_array_len.array_bound_mut.InstCombine.diff @@ -16,44 +16,42 @@ let _11: usize; // in scope 0 at $DIR/lower_array_len.rs:21:15: 21:16 let mut _12: usize; // in scope 0 at $DIR/lower_array_len.rs:21:9: 21:17 let mut _13: bool; // in scope 0 at $DIR/lower_array_len.rs:21:9: 21:17 - scope 1 { - let mut _14: &[u8; N]; // in scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 - } + let mut _14: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 bb0: { - StorageLive(_3); // scope 1 at $DIR/lower_array_len.rs:18:8: 18:27 - StorageLive(_4); // scope 1 at $DIR/lower_array_len.rs:18:8: 18:13 - _4 = _1; // scope 1 at $DIR/lower_array_len.rs:18:8: 18:13 - StorageLive(_5); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 - StorageLive(_6); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 - StorageLive(_7); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 - _7 = &(*_2); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 - StorageLive(_14); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 - _14 = _7; // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 - _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 - StorageDead(_7); // scope 1 at $DIR/lower_array_len.rs:18:20: 18:21 -- _5 = Len((*_14)); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 -+ _5 = const N; // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 - StorageDead(_14); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 - StorageDead(_6); // scope 1 at $DIR/lower_array_len.rs:18:26: 18:27 - _3 = Lt(move _4, move _5); // scope 1 at $DIR/lower_array_len.rs:18:8: 18:27 - StorageDead(_5); // scope 1 at $DIR/lower_array_len.rs:18:26: 18:27 - StorageDead(_4); // scope 1 at $DIR/lower_array_len.rs:18:26: 18:27 - switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 1 at $DIR/lower_array_len.rs:18:8: 18:27 + StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:18:8: 18:27 + StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:18:8: 18:13 + _4 = _1; // scope 0 at $DIR/lower_array_len.rs:18:8: 18:13 + StorageLive(_5); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageLive(_7); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + _7 = &(*_2); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageLive(_14); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + _14 = _7; // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:18:20: 18:21 +- _5 = Len((*_14)); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 ++ _5 = const N; // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageDead(_14); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:18:26: 18:27 + _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:18:8: 18:27 + StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:18:26: 18:27 + StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:18:26: 18:27 + switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len.rs:18:8: 18:27 } bb1: { - StorageLive(_8); // scope 1 at $DIR/lower_array_len.rs:19:15: 19:20 - _8 = _1; // scope 1 at $DIR/lower_array_len.rs:19:15: 19:20 -- _9 = Len((*_2)); // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 -+ _9 = const N; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 - _10 = Lt(_8, _9); // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 - assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 + StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:19:15: 19:20 + _8 = _1; // scope 0 at $DIR/lower_array_len.rs:19:15: 19:20 +- _9 = Len((*_2)); // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 ++ _9 = const N; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 + _10 = Lt(_8, _9); // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 + assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 } bb2: { - _0 = (*_2)[_8]; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 - StorageDead(_8); // scope 1 at $DIR/lower_array_len.rs:20:5: 20:6 + _0 = (*_2)[_8]; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 + StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:20:5: 20:6 goto -> bb5; // scope 0 at $DIR/lower_array_len.rs:18:5: 24:6 } diff --git a/src/test/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff b/src/test/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff index c31c9d80a1b..11fc20aa693 100644 --- a/src/test/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff +++ b/src/test/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.diff @@ -16,47 +16,45 @@ let _11: usize; // in scope 0 at $DIR/lower_array_len.rs:21:15: 21:16 let mut _12: usize; // in scope 0 at $DIR/lower_array_len.rs:21:9: 21:17 let mut _13: bool; // in scope 0 at $DIR/lower_array_len.rs:21:9: 21:17 - scope 1 { -+ let mut _14: &[u8; N]; // in scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 - } ++ let mut _14: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 bb0: { - StorageLive(_3); // scope 1 at $DIR/lower_array_len.rs:18:8: 18:27 - StorageLive(_4); // scope 1 at $DIR/lower_array_len.rs:18:8: 18:13 - _4 = _1; // scope 1 at $DIR/lower_array_len.rs:18:8: 18:13 - StorageLive(_5); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 - StorageLive(_6); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 - StorageLive(_7); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 - _7 = &(*_2); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 -+ StorageLive(_14); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 -+ _14 = _7; // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 - _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 - StorageDead(_7); // scope 1 at $DIR/lower_array_len.rs:18:20: 18:21 -- _5 = Len((*_6)); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 -+ _5 = Len((*_14)); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 -+ StorageDead(_14); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 - goto -> bb1; // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:18:8: 18:27 + StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:18:8: 18:13 + _4 = _1; // scope 0 at $DIR/lower_array_len.rs:18:8: 18:13 + StorageLive(_5); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageLive(_7); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + _7 = &(*_2); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 ++ StorageLive(_14); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 ++ _14 = _7; // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:18:20: 18:21 +- _5 = Len((*_6)); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 ++ _5 = Len((*_14)); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 ++ StorageDead(_14); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + goto -> bb1; // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 } bb1: { - StorageDead(_6); // scope 1 at $DIR/lower_array_len.rs:18:26: 18:27 - _3 = Lt(move _4, move _5); // scope 1 at $DIR/lower_array_len.rs:18:8: 18:27 - StorageDead(_5); // scope 1 at $DIR/lower_array_len.rs:18:26: 18:27 - StorageDead(_4); // scope 1 at $DIR/lower_array_len.rs:18:26: 18:27 - switchInt(move _3) -> [false: bb4, otherwise: bb2]; // scope 1 at $DIR/lower_array_len.rs:18:8: 18:27 + StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:18:26: 18:27 + _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:18:8: 18:27 + StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:18:26: 18:27 + StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:18:26: 18:27 + switchInt(move _3) -> [false: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_array_len.rs:18:8: 18:27 } bb2: { - StorageLive(_8); // scope 1 at $DIR/lower_array_len.rs:19:15: 19:20 - _8 = _1; // scope 1 at $DIR/lower_array_len.rs:19:15: 19:20 - _9 = Len((*_2)); // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 - _10 = Lt(_8, _9); // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 - assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb3; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 + StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:19:15: 19:20 + _8 = _1; // scope 0 at $DIR/lower_array_len.rs:19:15: 19:20 + _9 = Len((*_2)); // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 + _10 = Lt(_8, _9); // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 + assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb3; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 } bb3: { - _0 = (*_2)[_8]; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 - StorageDead(_8); // scope 1 at $DIR/lower_array_len.rs:20:5: 20:6 + _0 = (*_2)[_8]; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 + StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:20:5: 20:6 goto -> bb6; // scope 0 at $DIR/lower_array_len.rs:18:5: 24:6 } diff --git a/src/test/mir-opt/lower_array_len.array_bound_mut.SimplifyLocals.diff b/src/test/mir-opt/lower_array_len.array_bound_mut.SimplifyLocals.diff index a3d794f94b3..51d5f1acdab 100644 --- a/src/test/mir-opt/lower_array_len.array_bound_mut.SimplifyLocals.diff +++ b/src/test/mir-opt/lower_array_len.array_bound_mut.SimplifyLocals.diff @@ -16,52 +16,50 @@ - let _11: usize; // in scope 0 at $DIR/lower_array_len.rs:21:15: 21:16 - let mut _12: usize; // in scope 0 at $DIR/lower_array_len.rs:21:9: 21:17 - let mut _13: bool; // in scope 0 at $DIR/lower_array_len.rs:21:9: 21:17 +- let mut _14: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 + let _6: usize; // in scope 0 at $DIR/lower_array_len.rs:19:15: 19:20 + let mut _7: usize; // in scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 + let mut _8: bool; // in scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 + let _9: usize; // in scope 0 at $DIR/lower_array_len.rs:21:15: 21:16 + let mut _10: usize; // in scope 0 at $DIR/lower_array_len.rs:21:9: 21:17 + let mut _11: bool; // in scope 0 at $DIR/lower_array_len.rs:21:9: 21:17 - scope 1 { -- let mut _14: &[u8; N]; // in scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 - } bb0: { - StorageLive(_3); // scope 1 at $DIR/lower_array_len.rs:18:8: 18:27 - StorageLive(_4); // scope 1 at $DIR/lower_array_len.rs:18:8: 18:13 - _4 = _1; // scope 1 at $DIR/lower_array_len.rs:18:8: 18:13 - StorageLive(_5); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 -- StorageLive(_6); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 -- StorageLive(_7); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 -- StorageLive(_14); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 -- StorageDead(_7); // scope 1 at $DIR/lower_array_len.rs:18:20: 18:21 - _5 = const N; // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 -- StorageDead(_14); // scope 1 at $DIR/lower_array_len.rs:18:16: 18:27 -- StorageDead(_6); // scope 1 at $DIR/lower_array_len.rs:18:26: 18:27 - _3 = Lt(move _4, move _5); // scope 1 at $DIR/lower_array_len.rs:18:8: 18:27 - StorageDead(_5); // scope 1 at $DIR/lower_array_len.rs:18:26: 18:27 - StorageDead(_4); // scope 1 at $DIR/lower_array_len.rs:18:26: 18:27 - switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 1 at $DIR/lower_array_len.rs:18:8: 18:27 + StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:18:8: 18:27 + StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:18:8: 18:13 + _4 = _1; // scope 0 at $DIR/lower_array_len.rs:18:8: 18:13 + StorageLive(_5); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 +- StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 +- StorageLive(_7); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 +- StorageLive(_14); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 +- StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:18:20: 18:21 + _5 = const N; // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 +- StorageDead(_14); // scope 0 at $DIR/lower_array_len.rs:18:16: 18:27 +- StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:18:26: 18:27 + _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:18:8: 18:27 + StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:18:26: 18:27 + StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:18:26: 18:27 + switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len.rs:18:8: 18:27 } bb1: { -- StorageLive(_8); // scope 1 at $DIR/lower_array_len.rs:19:15: 19:20 -- _8 = _1; // scope 1 at $DIR/lower_array_len.rs:19:15: 19:20 -- _9 = const N; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 -- _10 = Lt(_8, _9); // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 -+ StorageLive(_6); // scope 1 at $DIR/lower_array_len.rs:19:15: 19:20 -+ _6 = _1; // scope 1 at $DIR/lower_array_len.rs:19:15: 19:20 -+ _7 = const N; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 -+ _8 = Lt(_6, _7); // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 -+ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb2; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 +- StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:19:15: 19:20 +- _8 = _1; // scope 0 at $DIR/lower_array_len.rs:19:15: 19:20 +- _9 = const N; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 +- _10 = Lt(_8, _9); // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 ++ StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:19:15: 19:20 ++ _6 = _1; // scope 0 at $DIR/lower_array_len.rs:19:15: 19:20 ++ _7 = const N; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 ++ _8 = Lt(_6, _7); // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 ++ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb2; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 } bb2: { -- _0 = (*_2)[_8]; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 -- StorageDead(_8); // scope 1 at $DIR/lower_array_len.rs:20:5: 20:6 -+ _0 = (*_2)[_6]; // scope 1 at $DIR/lower_array_len.rs:19:9: 19:21 -+ StorageDead(_6); // scope 1 at $DIR/lower_array_len.rs:20:5: 20:6 +- _0 = (*_2)[_8]; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 +- StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:20:5: 20:6 ++ _0 = (*_2)[_6]; // scope 0 at $DIR/lower_array_len.rs:19:9: 19:21 ++ StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:20:5: 20:6 goto -> bb5; // scope 0 at $DIR/lower_array_len.rs:18:5: 24:6 } 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 4b77db0707d..7750624db30 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 @@ -7,9 +7,7 @@ fn f_u64() -> () { debug t => _1; // in scope 1 at $DIR/lower_intrinsics.rs:44:22: 44:23 let _2: (); // in scope 1 at $DIR/lower_intrinsics.rs:48:9: 48:21 let mut _3: u64; // in scope 1 at $DIR/lower_intrinsics.rs:48:19: 48:20 - scope 2 { - scope 3 (inlined std::mem::size_of::<u64>) { // at $DIR/lower_intrinsics.rs:45:8: 45:32 - } + scope 2 (inlined std::mem::size_of::<u64>) { // at $DIR/lower_intrinsics.rs:45:8: 45:32 } } diff --git a/src/test/mir-opt/lower_intrinsics.f_unit.PreCodegen.before.mir b/src/test/mir-opt/lower_intrinsics.f_unit.PreCodegen.before.mir index 1306caf2291..4d4e65d3114 100644 --- a/src/test/mir-opt/lower_intrinsics.f_unit.PreCodegen.before.mir +++ b/src/test/mir-opt/lower_intrinsics.f_unit.PreCodegen.before.mir @@ -6,23 +6,21 @@ fn f_unit() -> () { scope 1 (inlined f_dispatch::<()>) { // at $DIR/lower_intrinsics.rs:34:5: 34:19 debug t => _1; // in scope 1 at $DIR/lower_intrinsics.rs:44:22: 44:23 let _2: (); // in scope 1 at $DIR/lower_intrinsics.rs:46:9: 46:17 - scope 2 { - scope 3 (inlined std::mem::size_of::<()>) { // at $DIR/lower_intrinsics.rs:45:8: 45:32 - } + scope 2 (inlined std::mem::size_of::<()>) { // at $DIR/lower_intrinsics.rs:45:8: 45:32 } } bb0: { StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:34:16: 34:18 - StorageLive(_2); // scope 2 at $DIR/lower_intrinsics.rs:46:9: 46:17 - _2 = f_zst::<()>(const ()) -> bb1; // scope 2 at $DIR/lower_intrinsics.rs:46:9: 46:17 + StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:46:9: 46:17 + _2 = f_zst::<()>(const ()) -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:46:9: 46:17 // mir::Constant // + span: $DIR/lower_intrinsics.rs:46:9: 46:14 // + literal: Const { ty: fn(()) {f_zst::<()>}, val: Value(Scalar(<ZST>)) } } bb1: { - StorageDead(_2); // scope 2 at $DIR/lower_intrinsics.rs:46:17: 46:18 + StorageDead(_2); // scope 1 at $DIR/lower_intrinsics.rs:46:17: 46:18 StorageDead(_1); // scope 0 at $DIR/lower_intrinsics.rs:34:18: 34:19 return; // scope 0 at $DIR/lower_intrinsics.rs:35:2: 35:2 } diff --git a/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff b/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff index 095641a597b..13241d882f2 100644 --- a/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff +++ b/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff @@ -12,43 +12,41 @@ let _7: usize; // in scope 0 at $DIR/lower_slice_len.rs:6:15: 6:20 let mut _8: usize; // in scope 0 at $DIR/lower_slice_len.rs:6:9: 6:21 let mut _9: bool; // in scope 0 at $DIR/lower_slice_len.rs:6:9: 6:21 - scope 1 { - } bb0: { - StorageLive(_3); // scope 1 at $DIR/lower_slice_len.rs:5:8: 5:27 - StorageLive(_4); // scope 1 at $DIR/lower_slice_len.rs:5:8: 5:13 - _4 = _1; // scope 1 at $DIR/lower_slice_len.rs:5:8: 5:13 - StorageLive(_5); // scope 1 at $DIR/lower_slice_len.rs:5:16: 5:27 - StorageLive(_6); // scope 1 at $DIR/lower_slice_len.rs:5:16: 5:27 - _6 = &(*_2); // scope 1 at $DIR/lower_slice_len.rs:5:16: 5:27 -- _5 = core::slice::<impl [u8]>::len(move _6) -> bb1; // scope 1 at $DIR/lower_slice_len.rs:5:16: 5:27 + StorageLive(_3); // scope 0 at $DIR/lower_slice_len.rs:5:8: 5:27 + StorageLive(_4); // scope 0 at $DIR/lower_slice_len.rs:5:8: 5:13 + _4 = _1; // scope 0 at $DIR/lower_slice_len.rs:5:8: 5:13 + StorageLive(_5); // scope 0 at $DIR/lower_slice_len.rs:5:16: 5:27 + StorageLive(_6); // scope 0 at $DIR/lower_slice_len.rs:5:16: 5:27 + _6 = &(*_2); // scope 0 at $DIR/lower_slice_len.rs:5:16: 5:27 +- _5 = core::slice::<impl [u8]>::len(move _6) -> bb1; // scope 0 at $DIR/lower_slice_len.rs:5:16: 5:27 - // mir::Constant - // + span: $DIR/lower_slice_len.rs:5:22: 5:25 - // + literal: Const { ty: for<'r> fn(&'r [u8]) -> usize {core::slice::<impl [u8]>::len}, val: Value(Scalar(<ZST>)) } -+ _5 = Len((*_6)); // scope 1 at $DIR/lower_slice_len.rs:5:16: 5:27 -+ goto -> bb1; // scope 1 at $DIR/lower_slice_len.rs:5:16: 5:27 ++ _5 = Len((*_6)); // scope 0 at $DIR/lower_slice_len.rs:5:16: 5:27 ++ goto -> bb1; // scope 0 at $DIR/lower_slice_len.rs:5:16: 5:27 } bb1: { - StorageDead(_6); // scope 1 at $DIR/lower_slice_len.rs:5:26: 5:27 - _3 = Lt(move _4, move _5); // scope 1 at $DIR/lower_slice_len.rs:5:8: 5:27 - StorageDead(_5); // scope 1 at $DIR/lower_slice_len.rs:5:26: 5:27 - StorageDead(_4); // scope 1 at $DIR/lower_slice_len.rs:5:26: 5:27 - switchInt(move _3) -> [false: bb4, otherwise: bb2]; // scope 1 at $DIR/lower_slice_len.rs:5:8: 5:27 + StorageDead(_6); // scope 0 at $DIR/lower_slice_len.rs:5:26: 5:27 + _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_slice_len.rs:5:8: 5:27 + StorageDead(_5); // scope 0 at $DIR/lower_slice_len.rs:5:26: 5:27 + StorageDead(_4); // scope 0 at $DIR/lower_slice_len.rs:5:26: 5:27 + switchInt(move _3) -> [false: bb4, otherwise: bb2]; // scope 0 at $DIR/lower_slice_len.rs:5:8: 5:27 } bb2: { - StorageLive(_7); // scope 1 at $DIR/lower_slice_len.rs:6:15: 6:20 - _7 = _1; // scope 1 at $DIR/lower_slice_len.rs:6:15: 6:20 - _8 = Len((*_2)); // scope 1 at $DIR/lower_slice_len.rs:6:9: 6:21 - _9 = Lt(_7, _8); // scope 1 at $DIR/lower_slice_len.rs:6:9: 6:21 - assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> bb3; // scope 1 at $DIR/lower_slice_len.rs:6:9: 6:21 + StorageLive(_7); // scope 0 at $DIR/lower_slice_len.rs:6:15: 6:20 + _7 = _1; // scope 0 at $DIR/lower_slice_len.rs:6:15: 6:20 + _8 = Len((*_2)); // scope 0 at $DIR/lower_slice_len.rs:6:9: 6:21 + _9 = Lt(_7, _8); // scope 0 at $DIR/lower_slice_len.rs:6:9: 6:21 + assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> bb3; // scope 0 at $DIR/lower_slice_len.rs:6:9: 6:21 } bb3: { - _0 = (*_2)[_7]; // scope 1 at $DIR/lower_slice_len.rs:6:9: 6:21 - StorageDead(_7); // scope 1 at $DIR/lower_slice_len.rs:7:5: 7:6 + _0 = (*_2)[_7]; // scope 0 at $DIR/lower_slice_len.rs:6:9: 6:21 + StorageDead(_7); // scope 0 at $DIR/lower_slice_len.rs:7:5: 7:6 goto -> bb5; // scope 0 at $DIR/lower_slice_len.rs:5:5: 9:6 } 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 72fd303d447..c2e422f8002 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 @@ -26,12 +26,8 @@ debug s => _8; // in scope 1 at $DIR/match-arm-scopes.rs:15:20: 15:21 } scope 2 { - } - scope 3 { - } - scope 4 { - debug b => _15; // in scope 4 at $DIR/match-arm-scopes.rs:16:16: 16:17 - debug t => _16; // in scope 4 at $DIR/match-arm-scopes.rs:16:19: 16:20 + debug b => _15; // in scope 2 at $DIR/match-arm-scopes.rs:16:16: 16:17 + debug t => _16; // in scope 2 at $DIR/match-arm-scopes.rs:16:19: 16:20 } bb0: { @@ -87,15 +83,15 @@ - _3 = &shallow (_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16 - _4 = &shallow (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16 StorageLive(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 - StorageLive(_10); // scope 2 at $DIR/match-arm-scopes.rs:15:45: 15:49 - _10 = _1; // scope 2 at $DIR/match-arm-scopes.rs:15:45: 15:49 -- switchInt(move _10) -> [false: bb10, otherwise: bb9]; // scope 2 at $DIR/match-arm-scopes.rs:15:45: 15:49 -+ switchInt(move _10) -> [false: bb7, otherwise: bb6]; // scope 2 at $DIR/match-arm-scopes.rs:15:45: 15:49 + 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 +- switchInt(move _10) -> [false: bb10, otherwise: bb9]; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 ++ switchInt(move _10) -> [false: bb7, otherwise: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 } - bb9: { + bb6: { - _0 = const 3_i32; // scope 2 at $DIR/match-arm-scopes.rs:15:59: 15:60 + _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 StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 - goto -> bb23; // scope 0 at no-location @@ -144,15 +140,15 @@ - _3 = &shallow (_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16 - _4 = &shallow (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:14:11: 14:16 StorageLive(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 - StorageLive(_13); // scope 3 at $DIR/match-arm-scopes.rs:15:45: 15:49 - _13 = _1; // scope 3 at $DIR/match-arm-scopes.rs:15:45: 15:49 -- switchInt(move _13) -> [false: bb15, otherwise: bb14]; // scope 3 at $DIR/match-arm-scopes.rs:15:45: 15:49 -+ switchInt(move _13) -> [false: bb12, otherwise: bb11]; // scope 3 at $DIR/match-arm-scopes.rs:15:45: 15:49 + 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 +- switchInt(move _13) -> [false: bb15, otherwise: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 ++ switchInt(move _13) -> [false: bb12, otherwise: bb11]; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 } - bb14: { + bb11: { - _0 = const 3_i32; // scope 3 at $DIR/match-arm-scopes.rs:15:59: 15:60 + _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 StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 - goto -> bb23; // scope 0 at no-location @@ -204,7 +200,7 @@ - bb19: { + bb16: { - _0 = const 2_i32; // scope 4 at $DIR/match-arm-scopes.rs:16:41: 16:42 + _0 = const 2_i32; // scope 2 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 } 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 7736342316b..29f66ceac98 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 @@ -6,26 +6,24 @@ let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:7:25: 7:25 let mut _2: isize; // in scope 0 at $DIR/matches_reduce_branches.rs:8:22: 8:26 + let mut _3: isize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - scope 1 { - } bb0: { - _2 = discriminant(_1); // scope 1 at $DIR/matches_reduce_branches.rs:8:17: 8:20 -- switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _2 = discriminant(_1); // scope 0 at $DIR/matches_reduce_branches.rs:8:17: 8:20 +- switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - } - - bb1: { -- goto -> bb3; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - } - - bb2: { -- goto -> bb3; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL +- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - } - - bb3: { -+ StorageLive(_3); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL -+ _3 = move _2; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL -+ StorageDead(_3); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL ++ StorageLive(_3); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL ++ _3 = move _2; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL ++ StorageDead(_3); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL return; // scope 0 at $DIR/matches_reduce_branches.rs:11:2: 11:2 } } diff --git a/src/test/mir-opt/matches_reduce_branches.foo.PreCodegen.before.64bit.mir b/src/test/mir-opt/matches_reduce_branches.foo.PreCodegen.before.64bit.mir index 4cac6a007f3..e3b318c949f 100644 --- a/src/test/mir-opt/matches_reduce_branches.foo.PreCodegen.before.64bit.mir +++ b/src/test/mir-opt/matches_reduce_branches.foo.PreCodegen.before.64bit.mir @@ -3,8 +3,6 @@ fn foo(_1: Option<()>) -> () { debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:7:8: 7:11 let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:7:25: 7:25 - scope 1 { - } bb0: { return; // scope 0 at $DIR/matches_reduce_branches.rs:11:2: 11:2 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 95ce545bbd4..2dfb2e1af0d 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 @@ -9,37 +9,31 @@ scope 1 { debug val => _1; // in scope 1 at $DIR/matches_reduce_branches.rs:40:9: 40:12 } - scope 2 { - scope 3 { - scope 4 { - } - } - } bb0: { StorageLive(_1); // scope 0 at $DIR/matches_reduce_branches.rs:40:9: 40:12 - StorageLive(_2); // scope 4 at $DIR/matches_reduce_branches.rs:41:24: 41:28 - _2 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:41:24: 41:28 -- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 4 at $DIR/matches_reduce_branches.rs:41:24: 41:28 + StorageLive(_2); // scope 0 at $DIR/matches_reduce_branches.rs:41:24: 41:28 + _2 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:41:24: 41:28 +- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:41:24: 41:28 - } - - bb1: { -+ StorageLive(_3); // scope 4 at $DIR/matches_reduce_branches.rs:41:24: 41:28 -+ _3 = move _2; // scope 4 at $DIR/matches_reduce_branches.rs:41:24: 41:28 - StorageDead(_2); // scope 3 at $DIR/matches_reduce_branches.rs:41:51: 41:52 ++ StorageLive(_3); // scope 0 at $DIR/matches_reduce_branches.rs:41:24: 41:28 ++ _3 = move _2; // scope 0 at $DIR/matches_reduce_branches.rs:41:24: 41:28 + StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:41:51: 41:52 - _1 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:47:13: 47:17 - goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:47:13: 47:17 - } - - bb2: { -- StorageDead(_2); // scope 3 at $DIR/matches_reduce_branches.rs:41:51: 41:52 +- StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:41:51: 41:52 - _1 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:49:14: 49:19 - goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:49:14: 49:19 - } - - bb3: { + _1 = Ne(_3, const false); // scope 0 at $DIR/matches_reduce_branches.rs:49:14: 49:19 -+ StorageDead(_3); // scope 4 at $DIR/matches_reduce_branches.rs:41:24: 41:28 ++ StorageDead(_3); // scope 0 at $DIR/matches_reduce_branches.rs:41:24: 41:28 _0 = _1; // scope 1 at $DIR/matches_reduce_branches.rs:51:5: 51:8 StorageDead(_1); // scope 0 at $DIR/matches_reduce_branches.rs:52:1: 52:2 return; // scope 0 at $DIR/matches_reduce_branches.rs:52:2: 52:2 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 23a388aadde..dbcb8813d54 100644 --- a/src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff +++ b/src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff @@ -4,8 +4,6 @@ fn test(_1: bool) -> () { debug x => _1; // in scope 0 at $DIR/multiple_return_terminators.rs:4:9: 4:10 let mut _0: (); // return place in scope 0 at $DIR/multiple_return_terminators.rs:4:18: 4:18 - scope 1 { - } bb0: { 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.64bit.mir b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir index 4a0a7b24aa3..162cacef8a5 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 @@ -39,8 +39,6 @@ fn main() -> () { let _6: &'_#5r usize; // in scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 scope 3 { debug q => _6; // in scope 3 at $DIR/region-subtyping-basic.rs:19:9: 19:10 - scope 4 { - } } } } @@ -63,25 +61,25 @@ fn main() -> () { StorageLive(_6); // bb1[2]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 _6 = _2; // bb1[3]: scope 2 at $DIR/region-subtyping-basic.rs:19:13: 19:14 FakeRead(ForLet(None), _6); // bb1[4]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 - StorageLive(_7); // bb1[5]: scope 4 at $DIR/region-subtyping-basic.rs:20:8: 20:12 - _7 = const ConstValue(Scalar(0x01): bool); // bb1[6]: scope 4 at $DIR/region-subtyping-basic.rs:20:8: 20:12 - switchInt(move _7) -> [Const(Value(Scalar(0x00)): bool): bb4, otherwise: bb2]; // bb1[7]: scope 4 at $DIR/region-subtyping-basic.rs:20:8: 20:12 + StorageLive(_7); // bb1[5]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 + _7 = const ConstValue(Scalar(0x01): bool); // bb1[6]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 + switchInt(move _7) -> [Const(Value(Scalar(0x00)): bool): bb4, otherwise: bb2]; // bb1[7]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 } bb2: { - StorageLive(_8); // bb2[0]: scope 4 at $DIR/region-subtyping-basic.rs:21:9: 21:18 - StorageLive(_9); // bb2[1]: scope 4 at $DIR/region-subtyping-basic.rs:21:15: 21:17 - _9 = (*_6); // bb2[2]: scope 4 at $DIR/region-subtyping-basic.rs:21:15: 21:17 - _8 = ConstValue(Scalar(<ZST>): fn(usize) -> bool {use_x})(move _9) -> [return: bb3, unwind: bb7]; // bb2[3]: scope 4 at $DIR/region-subtyping-basic.rs:21:9: 21:18 + 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 = ConstValue(Scalar(<ZST>): fn(usize) -> bool {use_x})(move _9) -> [return: bb3, 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: { - StorageDead(_9); // bb3[0]: scope 4 at $DIR/region-subtyping-basic.rs:21:17: 21:18 - StorageDead(_8); // bb3[1]: scope 4 at $DIR/region-subtyping-basic.rs:21:18: 21:19 - _0 = const ConstValue(Scalar(<ZST>): ()); // bb3[2]: scope 4 at $DIR/region-subtyping-basic.rs:20:13: 22:6 + StorageDead(_9); // bb3[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:17: 21:18 + StorageDead(_8); // bb3[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:18: 21:19 + _0 = const ConstValue(Scalar(<ZST>): ()); // bb3[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:13: 22:6 goto -> bb6; // bb3[3]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } diff --git a/src/test/mir-opt/not_equal_false.opt.InstCombine.diff b/src/test/mir-opt/not_equal_false.opt.InstCombine.diff index 349dbbb2679..249db1c8a5a 100644 --- a/src/test/mir-opt/not_equal_false.opt.InstCombine.diff +++ b/src/test/mir-opt/not_equal_false.opt.InstCombine.diff @@ -6,21 +6,19 @@ let mut _0: u32; // return place in scope 0 at $DIR/not_equal_false.rs:3:20: 3:23 let mut _2: bool; // in scope 0 at $DIR/not_equal_false.rs:4:8: 4:18 let mut _3: bool; // in scope 0 at $DIR/not_equal_false.rs:4:8: 4:9 - scope 1 { - } bb0: { - StorageLive(_2); // scope 1 at $DIR/not_equal_false.rs:4:8: 4:18 - StorageLive(_3); // scope 1 at $DIR/not_equal_false.rs:4:8: 4:9 - _3 = _1; // scope 1 at $DIR/not_equal_false.rs:4:8: 4:9 -- _2 = Ne(move _3, const false); // scope 1 at $DIR/not_equal_false.rs:4:8: 4:18 -+ _2 = move _3; // scope 1 at $DIR/not_equal_false.rs:4:8: 4:18 - StorageDead(_3); // scope 1 at $DIR/not_equal_false.rs:4:17: 4:18 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/not_equal_false.rs:4:8: 4:18 + StorageLive(_2); // scope 0 at $DIR/not_equal_false.rs:4:8: 4:18 + StorageLive(_3); // scope 0 at $DIR/not_equal_false.rs:4:8: 4:9 + _3 = _1; // scope 0 at $DIR/not_equal_false.rs:4:8: 4:9 +- _2 = Ne(move _3, const false); // scope 0 at $DIR/not_equal_false.rs:4:8: 4:18 ++ _2 = move _3; // scope 0 at $DIR/not_equal_false.rs:4:8: 4:18 + StorageDead(_3); // scope 0 at $DIR/not_equal_false.rs:4:17: 4:18 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/not_equal_false.rs:4:8: 4:18 } bb1: { - _0 = const 0_u32; // scope 1 at $DIR/not_equal_false.rs:4:21: 4:22 + _0 = const 0_u32; // scope 0 at $DIR/not_equal_false.rs:4:21: 4:22 goto -> bb3; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:35 } diff --git a/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir index c1fe50afff2..69742d6bc3b 100644 --- a/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir @@ -51,11 +51,9 @@ fn array_casts() -> () { scope 7 { debug left_val => _20; // in scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL debug right_val => _21; // in scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _27: core::panicking::AssertKind; // in scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL scope 8 { - let _27: core::panicking::AssertKind; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - scope 9 { - debug kind => _27; // in scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - } + debug kind => _27; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } } } @@ -139,41 +137,41 @@ fn array_casts() -> () { StorageLive(_21); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _21 = (_13.1: &usize); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL Retag(_21); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_22); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_23); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_24); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _24 = (*_20); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_25); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _25 = (*_21); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _23 = Eq(move _24, move _25); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_25); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_24); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _22 = Not(move _23); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_23); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(move _22) -> [false: bb4, otherwise: bb3]; // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_22); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_23); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_24); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _24 = (*_20); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_25); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _25 = (*_21); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _23 = Eq(move _24, move _25); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_25); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_24); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _22 = Not(move _23); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_23); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(move _22) -> [false: bb4, otherwise: bb3]; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb3: { - StorageLive(_27); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _27 = core::panicking::AssertKind::Eq; // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_28); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_29); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _29 = move _27; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_30); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_31); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _31 = &(*_20); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - Retag(_31); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _30 = &(*_31); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - Retag(_30); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_32); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_33); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _33 = &(*_21); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - Retag(_33); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _32 = &(*_33); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - Retag(_32); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_34); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _34 = Option::<Arguments>::None; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _28 = core::panicking::assert_failed::<usize, usize>(move _29, move _30, move _32, move _34); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_27); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _27 = core::panicking::AssertKind::Eq; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_28); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_29); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _29 = move _27; // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_30); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_31); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _31 = &(*_20); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + Retag(_31); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _30 = &(*_31); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + Retag(_30); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_32); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_33); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _33 = &(*_21); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + Retag(_33); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _32 = &(*_33); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + Retag(_32); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_34); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _34 = Option::<Arguments>::None; // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _28 = core::panicking::assert_failed::<usize, usize>(move _29, move _30, move _32, move _34); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r usize, &'s usize, Option<Arguments<'t0>>) -> ! {core::panicking::assert_failed::<usize, usize>}, val: Value(Scalar(<ZST>)) } 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 06c4b997c7c..1c5a8900236 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 @@ -6,8 +6,6 @@ let mut _1: (); // in scope 0 at $DIR/simplify_cfg.rs:7:1: 13:2 let mut _2: bool; // in scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 let mut _3: !; // in scope 0 at $DIR/simplify_cfg.rs:9:18: 11:10 - scope 1 { - } bb0: { goto -> bb1; // scope 0 at $DIR/simplify_cfg.rs:8:5: 12:6 @@ -18,23 +16,23 @@ - } - - bb2: { - StorageLive(_2); // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 -- _2 = bar() -> [return: bb3, unwind: bb6]; // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 -+ _2 = bar() -> [return: bb2, unwind: bb5]; // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 + StorageLive(_2); // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 +- _2 = bar() -> [return: bb3, unwind: bb6]; // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 ++ _2 = bar() -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 // mir::Constant // + span: $DIR/simplify_cfg.rs:9:12: 9:15 // + literal: Const { ty: fn() -> bool {bar}, val: Value(Scalar(<ZST>)) } } - bb3: { -- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 +- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 + bb2: { -+ switchInt(move _2) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 ++ switchInt(move _2) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 } - bb4: { + bb3: { - _0 = const (); // scope 1 at $DIR/simplify_cfg.rs:10:13: 10:18 + _0 = const (); // scope 0 at $DIR/simplify_cfg.rs:10:13: 10:18 StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:11:9: 11:10 return; // scope 0 at $DIR/simplify_cfg.rs:13:2: 13: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 ed2bda1a474..b079bd7b57c 100644 --- a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff +++ b/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff @@ -6,8 +6,6 @@ let mut _1: (); // in scope 0 at $DIR/simplify_cfg.rs:7:1: 13:2 let mut _2: bool; // in scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 let mut _3: !; // in scope 0 at $DIR/simplify_cfg.rs:9:18: 11:10 - scope 1 { - } bb0: { goto -> bb1; // scope 0 at $DIR/simplify_cfg.rs:8:5: 12:6 @@ -19,31 +17,31 @@ } bb2: { - StorageLive(_2); // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 -- _2 = bar() -> [return: bb3, unwind: bb11]; // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 -+ _2 = bar() -> [return: bb3, unwind: bb6]; // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 + StorageLive(_2); // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 +- _2 = bar() -> [return: bb3, unwind: bb11]; // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 ++ _2 = bar() -> [return: bb3, unwind: bb6]; // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 // mir::Constant // + span: $DIR/simplify_cfg.rs:9:12: 9:15 // + literal: Const { ty: fn() -> bool {bar}, val: Value(Scalar(<ZST>)) } } bb3: { - switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 + switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 } bb4: { - _0 = const (); // scope 1 at $DIR/simplify_cfg.rs:10:13: 10:18 -- goto -> bb10; // scope 1 at $DIR/simplify_cfg.rs:10:13: 10:18 + _0 = const (); // scope 0 at $DIR/simplify_cfg.rs:10:13: 10:18 +- goto -> bb10; // scope 0 at $DIR/simplify_cfg.rs:10:13: 10:18 + StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:11:9: 11:10 + return; // scope 0 at $DIR/simplify_cfg.rs:13:2: 13:2 } bb5: { -- goto -> bb8; // scope 1 at $DIR/simplify_cfg.rs:9:12: 9:17 +- goto -> bb8; // scope 0 at $DIR/simplify_cfg.rs:9:12: 9:17 - } - - bb6: { -- unreachable; // scope 1 at $DIR/simplify_cfg.rs:9:18: 11:10 +- unreachable; // scope 0 at $DIR/simplify_cfg.rs:9:18: 11:10 - } - - bb7: { diff --git a/src/test/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff b/src/test/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff index 2f9e45279d8..d11c70b1efe 100644 --- a/src/test/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff +++ b/src/test/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff @@ -5,27 +5,25 @@ let mut _0: (); // return place in scope 0 at $DIR/simplify_if.rs:5:11: 5:11 let mut _1: bool; // in scope 0 at $DIR/simplify_if.rs:6:8: 6:13 let _2: (); // in scope 0 at $DIR/simplify_if.rs:7:9: 7:15 - scope 1 { - } bb0: { - StorageLive(_1); // scope 1 at $DIR/simplify_if.rs:6:8: 6:13 - _1 = const false; // scope 1 at $DIR/simplify_if.rs:6:8: 6:13 -- switchInt(const false) -> [false: bb3, otherwise: bb1]; // scope 1 at $DIR/simplify_if.rs:6:8: 6:13 -+ goto -> bb3; // scope 1 at $DIR/simplify_if.rs:6:8: 6:13 + 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: bb3, otherwise: bb1]; // scope 0 at $DIR/simplify_if.rs:6:8: 6:13 ++ goto -> bb3; // scope 0 at $DIR/simplify_if.rs:6:8: 6:13 } bb1: { - StorageLive(_2); // scope 1 at $DIR/simplify_if.rs:7:9: 7:15 - _2 = noop() -> bb2; // scope 1 at $DIR/simplify_if.rs:7:9: 7:15 + StorageLive(_2); // scope 0 at $DIR/simplify_if.rs:7:9: 7:15 + _2 = noop() -> bb2; // scope 0 at $DIR/simplify_if.rs:7:9: 7:15 // mir::Constant // + span: $DIR/simplify_if.rs:7:9: 7:13 // + literal: Const { ty: fn() {noop}, val: Value(Scalar(<ZST>)) } } bb2: { - StorageDead(_2); // scope 1 at $DIR/simplify_if.rs:7:15: 7:16 - nop; // scope 1 at $DIR/simplify_if.rs:6:14: 8:6 + StorageDead(_2); // scope 0 at $DIR/simplify_if.rs:7:15: 7:16 + nop; // scope 0 at $DIR/simplify_if.rs:6:14: 8:6 goto -> bb4; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6 } 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 d220d929020..075fe8d0908 100644 --- a/src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff +++ b/src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff @@ -13,8 +13,6 @@ scope 1 { debug a => _6; // in scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:18: 4:19 let _6: u8; // in scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:18: 4:19 - scope 2 { - } } bb0: { @@ -42,11 +40,11 @@ bb2: { StorageLive(_6); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:18: 4:19 _6 = (((_1.0: std::option::Option<u8>) as Some).0: u8); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:18: 4:19 -- StorageLive(_7); // scope 2 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20 -- StorageLive(_8); // scope 2 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13 -- _8 = _6; // scope 2 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13 -- _7 = Gt(move _8, const 42_u8); // scope 2 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20 -- StorageDead(_8); // scope 2 at $DIR/simplify-locals-fixedpoint.rs:5:19: 5:20 +- StorageLive(_7); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20 +- StorageLive(_8); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13 +- _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 - 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 -> bb3; // 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 e87c59a4c77..70486f546d7 100644 --- a/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff +++ b/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff @@ -14,8 +14,6 @@ let mut _4: i32; // in scope 1 at $DIR/unreachable.rs:10:13: 10:19 scope 2 { debug _y => _4; // in scope 2 at $DIR/unreachable.rs:10:13: 10:19 - scope 3 { - } } } @@ -38,14 +36,14 @@ - _3 = move ((_1 as Some).0: Empty); // scope 1 at $DIR/unreachable.rs:9:17: 9:19 - StorageLive(_4); // scope 1 at $DIR/unreachable.rs:10:13: 10:19 - StorageLive(_5); // scope 2 at $DIR/unreachable.rs:12:9: 16:10 -- StorageLive(_6); // scope 3 at $DIR/unreachable.rs:12:12: 12:16 -- _6 = const true; // scope 3 at $DIR/unreachable.rs:12:12: 12:16 -- switchInt(move _6) -> [false: bb4, otherwise: bb3]; // scope 3 at $DIR/unreachable.rs:12:12: 12:16 +- 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(move _6) -> [false: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable.rs:12:12: 12:16 - } - - bb3: { -- _4 = const 21_i32; // scope 3 at $DIR/unreachable.rs:13:13: 13:20 -- _5 = const (); // scope 3 at $DIR/unreachable.rs:12:17: 14: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 -> bb5; // scope 2 at $DIR/unreachable.rs:12:9: 16:10 - } - diff --git a/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff index b63a2f2b0ac..d9f2681d145 100644 --- a/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff +++ b/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff @@ -14,8 +14,6 @@ scope 2 { debug bomb => _4; // in scope 2 at $DIR/unreachable_diverging.rs:14:17: 14:21 let _4: Empty; // in scope 2 at $DIR/unreachable_diverging.rs:14:17: 14:21 - scope 3 { - } } } @@ -39,15 +37,15 @@ StorageLive(_4); // scope 2 at $DIR/unreachable_diverging.rs:14:17: 14:21 _4 = move ((_2 as Some).0: Empty); // scope 2 at $DIR/unreachable_diverging.rs:14:17: 14:21 StorageLive(_5); // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10 - StorageLive(_6); // scope 3 at $DIR/unreachable_diverging.rs:15:12: 15:13 - _6 = _1; // scope 3 at $DIR/unreachable_diverging.rs:15:12: 15:13 -- switchInt(move _6) -> [false: bb4, otherwise: bb3]; // scope 3 at $DIR/unreachable_diverging.rs:15:12: 15:13 -+ goto -> bb3; // scope 3 at $DIR/unreachable_diverging.rs:15:12: 15:13 + 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(move _6) -> [false: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable_diverging.rs:15:12: 15:13 ++ goto -> bb3; // scope 2 at $DIR/unreachable_diverging.rs:15:12: 15:13 } bb3: { -- _5 = loop_forever() -> bb5; // scope 3 at $DIR/unreachable_diverging.rs:16:13: 16:27 -+ _5 = loop_forever() -> bb4; // scope 3 at $DIR/unreachable_diverging.rs:16:13: 16:27 +- _5 = loop_forever() -> bb5; // scope 2 at $DIR/unreachable_diverging.rs:16:13: 16:27 ++ _5 = loop_forever() -> bb4; // scope 2 at $DIR/unreachable_diverging.rs:16:13: 16:27 // mir::Constant // + span: $DIR/unreachable_diverging.rs:16:13: 16:25 // + literal: Const { ty: fn() {loop_forever}, val: Value(Scalar(<ZST>)) } diff --git a/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.32bit.diff b/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.32bit.diff index 0529b15522e..f8b41d7b4c5 100644 --- a/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.32bit.diff +++ b/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.32bit.diff @@ -13,28 +13,30 @@ let mut _8: !; // in scope 0 at $DIR/while_let_loops.rs:7:5: 10:6 scope 1 { debug _x => _1; // in scope 1 at $DIR/while_let_loops.rs:6:9: 6:15 + scope 2 { + } } bb0: { StorageLive(_1); // scope 0 at $DIR/while_let_loops.rs:6:9: 6:15 _1 = const 0_i32; // scope 0 at $DIR/while_let_loops.rs:6:18: 6:19 - StorageLive(_3); // scope 1 at $DIR/while_let_loops.rs:7:28: 7:32 - Deinit(_3); // scope 1 at $DIR/while_let_loops.rs:7:28: 7:32 - discriminant(_3) = 0; // scope 1 at $DIR/while_let_loops.rs:7:28: 7:32 -- _4 = discriminant(_3); // scope 1 at $DIR/while_let_loops.rs:7:15: 7:25 -- switchInt(move _4) -> [1_isize: bb1, otherwise: bb3]; // scope 1 at $DIR/while_let_loops.rs:7:15: 7:25 -+ _4 = const 0_isize; // scope 1 at $DIR/while_let_loops.rs:7:15: 7:25 -+ switchInt(const 0_isize) -> [1_isize: bb1, otherwise: bb3]; // scope 1 at $DIR/while_let_loops.rs:7:15: 7:25 + StorageLive(_3); // scope 2 at $DIR/while_let_loops.rs:7:28: 7:32 + Deinit(_3); // scope 2 at $DIR/while_let_loops.rs:7:28: 7:32 + discriminant(_3) = 0; // scope 2 at $DIR/while_let_loops.rs:7:28: 7:32 +- _4 = discriminant(_3); // scope 2 at $DIR/while_let_loops.rs:7:15: 7:25 +- switchInt(move _4) -> [1_isize: bb1, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:7:15: 7:25 ++ _4 = const 0_isize; // scope 2 at $DIR/while_let_loops.rs:7:15: 7:25 ++ switchInt(const 0_isize) -> [1_isize: bb1, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:7:15: 7:25 } bb1: { - switchInt(((_3 as Some).0: u32)) -> [0_u32: bb2, otherwise: bb3]; // scope 1 at $DIR/while_let_loops.rs:7:15: 7:25 + switchInt(((_3 as Some).0: u32)) -> [0_u32: bb2, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:7:15: 7:25 } bb2: { - _1 = const 1_i32; // scope 1 at $DIR/while_let_loops.rs:8:9: 8:15 - nop; // scope 1 at $DIR/while_let_loops.rs:9:9: 9:14 - goto -> bb4; // scope 1 at $DIR/while_let_loops.rs:9:9: 9:14 + _1 = const 1_i32; // scope 2 at $DIR/while_let_loops.rs:8:9: 8:15 + nop; // scope 2 at $DIR/while_let_loops.rs:9:9: 9:14 + goto -> bb4; // scope 2 at $DIR/while_let_loops.rs:9:9: 9:14 } bb3: { diff --git a/src/test/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.32bit.mir b/src/test/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.32bit.mir index 3c94fbddc44..5657f9413a1 100644 --- a/src/test/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.32bit.mir +++ b/src/test/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.32bit.mir @@ -5,6 +5,8 @@ fn change_loop_body() -> () { let mut _1: i32; // in scope 0 at $DIR/while_let_loops.rs:6:9: 6:15 scope 1 { debug _x => _1; // in scope 1 at $DIR/while_let_loops.rs:6:9: 6:15 + scope 2 { + } } bb0: { 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 df5a3cb3151..ec2d161251b 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 @@ -7,52 +7,48 @@ fn while_loop(_1: bool) -> () { let mut _3: bool; // in scope 0 at $DIR/while-storage.rs:10:20: 10:21 let mut _4: bool; // in scope 0 at $DIR/while-storage.rs:11:12: 11:23 let mut _5: bool; // in scope 0 at $DIR/while-storage.rs:11:21: 11:22 - scope 1 { - scope 2 { - } - } bb0: { goto -> bb1; // scope 0 at $DIR/while-storage.rs:10:5: 14:6 } bb1: { - StorageLive(_2); // scope 1 at $DIR/while-storage.rs:10:11: 10:22 - StorageLive(_3); // scope 1 at $DIR/while-storage.rs:10:20: 10:21 - _3 = _1; // scope 1 at $DIR/while-storage.rs:10:20: 10:21 - _2 = get_bool(move _3) -> bb2; // scope 1 at $DIR/while-storage.rs:10:11: 10:22 + StorageLive(_2); // scope 0 at $DIR/while-storage.rs:10:11: 10:22 + StorageLive(_3); // scope 0 at $DIR/while-storage.rs:10:20: 10:21 + _3 = _1; // scope 0 at $DIR/while-storage.rs:10:20: 10:21 + _2 = get_bool(move _3) -> bb2; // scope 0 at $DIR/while-storage.rs:10:11: 10:22 // mir::Constant // + span: $DIR/while-storage.rs:10:11: 10:19 // + literal: Const { ty: fn(bool) -> bool {get_bool}, val: Value(Scalar(<ZST>)) } } bb2: { - StorageDead(_3); // scope 1 at $DIR/while-storage.rs:10:21: 10:22 - switchInt(move _2) -> [false: bb7, otherwise: bb3]; // scope 1 at $DIR/while-storage.rs:10:11: 10:22 + StorageDead(_3); // scope 0 at $DIR/while-storage.rs:10:21: 10:22 + switchInt(move _2) -> [false: bb7, otherwise: bb3]; // scope 0 at $DIR/while-storage.rs:10:11: 10:22 } bb3: { - StorageLive(_4); // scope 2 at $DIR/while-storage.rs:11:12: 11:23 - StorageLive(_5); // scope 2 at $DIR/while-storage.rs:11:21: 11:22 - _5 = _1; // scope 2 at $DIR/while-storage.rs:11:21: 11:22 - _4 = get_bool(move _5) -> bb4; // scope 2 at $DIR/while-storage.rs:11:12: 11:23 + StorageLive(_4); // scope 0 at $DIR/while-storage.rs:11:12: 11:23 + StorageLive(_5); // scope 0 at $DIR/while-storage.rs:11:21: 11:22 + _5 = _1; // scope 0 at $DIR/while-storage.rs:11:21: 11:22 + _4 = get_bool(move _5) -> bb4; // scope 0 at $DIR/while-storage.rs:11:12: 11:23 // mir::Constant // + span: $DIR/while-storage.rs:11:12: 11:20 // + literal: Const { ty: fn(bool) -> bool {get_bool}, val: Value(Scalar(<ZST>)) } } bb4: { - StorageDead(_5); // scope 2 at $DIR/while-storage.rs:11:22: 11:23 - switchInt(move _4) -> [false: bb6, otherwise: bb5]; // scope 2 at $DIR/while-storage.rs:11:12: 11:23 + StorageDead(_5); // scope 0 at $DIR/while-storage.rs:11:22: 11:23 + switchInt(move _4) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/while-storage.rs:11:12: 11:23 } bb5: { - StorageDead(_4); // scope 1 at $DIR/while-storage.rs:13:9: 13:10 - goto -> bb8; // scope 1 at no-location + StorageDead(_4); // scope 0 at $DIR/while-storage.rs:13:9: 13:10 + goto -> bb8; // scope 0 at no-location } bb6: { - StorageDead(_4); // scope 1 at $DIR/while-storage.rs:13:9: 13:10 + 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 -> bb1; // scope 0 at $DIR/while-storage.rs:10:5: 14:6 } |
