]> git.lizzy.rs Git - rust.git/commitdiff
More minimal changes
authorXavier Denis <xldenis@gmail.com>
Thu, 9 Jun 2022 23:23:06 +0000 (16:23 -0700)
committerXavier Denis <xldenis@gmail.com>
Fri, 10 Jun 2022 20:01:56 +0000 (13:01 -0700)
12 files changed:
compiler/rustc_mir_build/src/build/expr/into.rs
compiler/rustc_mir_build/src/build/matches/mod.rs
src/test/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff
src/test/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff
src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir
src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff
src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff
src/test/mir-opt/unreachable.main.UnreachablePropagation.diff
src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff
src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.64bit.diff
src/test/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.64bit.mir

index ea677d727e0172003df6f27b95a0f5af1345b5a4..ccbb518e72d08d49c905132c76c8de98bf5f208c 100644 (file)
@@ -70,9 +70,8 @@ pub(crate) fn expr_into_dest(
                                         &this.thir[cond],
                                         Some(condition_scope),
                                         condition_scope,
-                                        then_expr.span
+                                        then_expr.span,
                                     ));
-
                                     this.expr_into_dest(destination, then_blk, then_expr)
                                 });
                             then_block.and(else_block)
@@ -98,7 +97,7 @@ pub(crate) fn expr_into_dest(
             ExprKind::Let { expr, ref pat } => {
                 let scope = this.local_scope();
                 let (true_block, false_block) = this.in_if_then_scope(scope, |this| {
-                    this.lower_let_expr(block, &this.thir[expr], pat, scope, None, expr_span)
+                    this.lower_let_expr(block, &this.thir[expr], pat, scope, expr_span)
                 });
 
                 this.cfg.push_assign_constant(
index ce25a89a2749b17029687b39c5c34929906fe3fd..117af1a781e4ab7083a31abf0614fa29d44d8c60 100644 (file)
@@ -41,7 +41,7 @@ pub(crate) fn then_else_break(
         expr: &Expr<'tcx>,
         temp_scope_override: Option<region::Scope>,
         break_scope: region::Scope,
-        variable_span: Span,
+        variable_scope_span: Span,
     ) -> BlockAnd<()> {
         let this = self;
         let expr_span = expr.span;
@@ -53,7 +53,7 @@ pub(crate) fn then_else_break(
                     &this.thir[lhs],
                     temp_scope_override,
                     break_scope,
-                    variable_span,
+                    variable_scope_span,
                 ));
 
                 let rhs_then_block = unpack!(this.then_else_break(
@@ -61,7 +61,7 @@ pub(crate) fn then_else_break(
                     &this.thir[rhs],
                     temp_scope_override,
                     break_scope,
-                    variable_span,
+                    variable_scope_span,
                 ));
 
                 rhs_then_block.unit()
@@ -74,22 +74,12 @@ pub(crate) fn then_else_break(
                         &this.thir[value],
                         temp_scope_override,
                         break_scope,
-                        variable_span,
+                        variable_scope_span,
                     )
                 })
             }
             ExprKind::Let { expr, ref pat } => {
-                let variable_scope =
-                    this.new_source_scope(variable_span, LintLevel::Inherited, None);
-                this.source_scope = variable_scope;
-                this.lower_let_expr(
-                    block,
-                    &this.thir[expr],
-                    pat,
-                    break_scope,
-                    Some(variable_scope),
-                    variable_span,
-                )
+                this.lower_let_expr(block, &this.thir[expr], pat, break_scope, variable_scope_span)
             }
             _ => {
                 let temp_scope = temp_scope_override.unwrap_or_else(|| this.local_scope());
@@ -1783,7 +1773,6 @@ pub(crate) fn lower_let_expr(
         expr: &Expr<'tcx>,
         pat: &Pat<'tcx>,
         else_target: region::Scope,
-        source_scope: Option<SourceScope>,
         span: Span,
     ) -> BlockAnd<()> {
         let expr_span = expr.span;
@@ -1809,13 +1798,12 @@ pub(crate) fn lower_let_expr(
         let otherwise_post_guard_block = otherwise_candidate.pre_binding_block.unwrap();
         self.break_for_else(otherwise_post_guard_block, else_target, self.source_info(expr_span));
 
-        self.declare_bindings(
-            source_scope,
-            pat.span.to(span),
-            pat,
-            ArmHasGuard(false),
-            opt_expr_place,
-        );
+        let scope =
+            self.declare_bindings(None, pat.span.to(span), pat, ArmHasGuard(false), opt_expr_place);
+
+        if let Some(scope) = scope {
+            self.source_scope = scope;
+        }
 
         let post_guard_block = self.bind_pattern(
             self.source_info(pat.span),
@@ -1993,7 +1981,7 @@ fn bind_and_guard_matched_candidate<'pat>(
                     Guard::IfLet(ref pat, scrutinee) => {
                         let s = &this.thir[scrutinee];
                         guard_span = s.span;
-                        this.lower_let_expr(block, s, pat, match_scope, None, arm_span)
+                        this.lower_let_expr(block, s, pat, match_scope, arm_span)
                     }
                 });
 
index a773ca246dd61a5141fa99101a6012e4af8a817f..445732f70220a53b3e6e2502c8240ae979b35c16 100644 (file)
       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 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
+          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
       }
   
       bb1: {
-          switchInt(((_3 as Some).0: bool)) -> [false: bb3, otherwise: bb2]; // scope 2 at $DIR/discriminant.rs:11:21: 11:31
+          switchInt(((_3 as Some).0: bool)) -> [false: bb3, otherwise: bb2]; // scope 0 at $DIR/discriminant.rs:11:21: 11:31
       }
   
       bb2: {
index d77056e6316f2e5144a2cb0b49b05e04d132f8aa..1efaba044ecf1bca44392f70ed61fef63ae84a88 100644 (file)
@@ -7,20 +7,18 @@
       let mut _2: isize;                   // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:13:20: 13:30
       let mut _3: isize;                   // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:13:12: 13:31
       let mut _4: &E;                      // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:12:16: 12:17
-      scope 1 {
-      }
   
       bb0: {
-          _3 = discriminant((*_1));        // scope 1 at $DIR/early_otherwise_branch_soundness.rs:13:12: 13:31
-          switchInt(move _3) -> [1_isize: bb1, otherwise: bb3]; // scope 1 at $DIR/early_otherwise_branch_soundness.rs:13:12: 13:31
+          _3 = discriminant((*_1));        // scope 0 at $DIR/early_otherwise_branch_soundness.rs:13:12: 13:31
+          switchInt(move _3) -> [1_isize: bb1, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:13:12: 13:31
       }
   
       bb1: {
-          StorageLive(_4);                 // scope 1 at $DIR/early_otherwise_branch_soundness.rs:13:12: 13:31
-          _4 = move (((*_1) as Some).0: &E); // scope 1 at $DIR/early_otherwise_branch_soundness.rs:13:12: 13:31
-          _2 = discriminant((*_4));        // scope 1 at $DIR/early_otherwise_branch_soundness.rs:13:12: 13:31
-          StorageDead(_4);                 // scope 1 at $DIR/early_otherwise_branch_soundness.rs:13:12: 13:31
-          switchInt(move _2) -> [1_isize: bb2, otherwise: bb3]; // scope 1 at $DIR/early_otherwise_branch_soundness.rs:13:12: 13:31
+          StorageLive(_4);                 // scope 0 at $DIR/early_otherwise_branch_soundness.rs:13:12: 13:31
+          _4 = move (((*_1) as Some).0: &E); // scope 0 at $DIR/early_otherwise_branch_soundness.rs:13:12: 13:31
+          _2 = discriminant((*_4));        // scope 0 at $DIR/early_otherwise_branch_soundness.rs:13:12: 13:31
+          StorageDead(_4);                 // scope 0 at $DIR/early_otherwise_branch_soundness.rs:13:12: 13:31
+          switchInt(move _2) -> [1_isize: bb2, otherwise: bb3]; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:13:12: 13:31
       }
   
       bb2: {
index 2e0df0a6ba9f70d1dc08929d7681bb6888da5601..c49bef159b4ab1864fd19809ce70a1b704151f63 100644 (file)
@@ -27,9 +27,9 @@
           let _6: core::num::flt2dec::Sign; // in scope 1 at $DIR/funky_arms.rs:19:9: 19:13
           scope 2 {
               debug sign => _6;            // in scope 2 at $DIR/funky_arms.rs:19:9: 19:13
+              let _10: usize;              // in scope 2 at $DIR/funky_arms.rs:24:17: 24:26
               scope 3 {
                   debug precision => _10;  // in scope 3 at $DIR/funky_arms.rs:24:17: 24:26
-                  let _10: usize;          // in scope 3 at $DIR/funky_arms.rs:24:17: 24:26
               }
           }
       }
       }
   
       bb4: {
-          StorageLive(_7);                 // scope 3 at $DIR/funky_arms.rs:24:30: 24:45
-          StorageLive(_8);                 // scope 3 at $DIR/funky_arms.rs:24:30: 24:45
-          _8 = &(*_1);                     // scope 3 at $DIR/funky_arms.rs:24:30: 24:45
-          _7 = Formatter::precision(move _8) -> bb5; // scope 3 at $DIR/funky_arms.rs:24:30: 24:45
+          StorageLive(_7);                 // scope 2 at $DIR/funky_arms.rs:24:30: 24:45
+          StorageLive(_8);                 // scope 2 at $DIR/funky_arms.rs:24:30: 24:45
+          _8 = &(*_1);                     // scope 2 at $DIR/funky_arms.rs:24:30: 24:45
+          _7 = Formatter::precision(move _8) -> bb5; // scope 2 at $DIR/funky_arms.rs:24:30: 24:45
                                            // mir::Constant
                                            // + span: $DIR/funky_arms.rs:24:34: 24:43
                                            // + literal: Const { ty: for<'r> fn(&'r Formatter) -> Option<usize> {Formatter::precision}, val: Value(Scalar(<ZST>)) }
       }
   
       bb5: {
-          StorageDead(_8);                 // scope 3 at $DIR/funky_arms.rs:24:44: 24:45
-          _9 = discriminant(_7);           // scope 3 at $DIR/funky_arms.rs:24:12: 24:27
-          switchInt(move _9) -> [1_isize: bb6, otherwise: bb8]; // scope 3 at $DIR/funky_arms.rs:24:12: 24:27
+          StorageDead(_8);                 // scope 2 at $DIR/funky_arms.rs:24:44: 24:45
+          _9 = discriminant(_7);           // scope 2 at $DIR/funky_arms.rs:24:12: 24:27
+          switchInt(move _9) -> [1_isize: bb6, otherwise: bb8]; // scope 2 at $DIR/funky_arms.rs:24:12: 24:27
       }
   
       bb6: {
index 3c662a86814060e7bd9157187356ce1ebd718b94..9defa0dcf397ef7b9f63ba39b86317c19e075d10 100644 (file)
@@ -14,9 +14,9 @@ fn main() -> () {
     let mut _11: isize;                  // in scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     scope 1 {
         debug e => _1;                   // in scope 1 at $DIR/issue-41888.rs:7:9: 7:10
+        let _6: K;                       // in scope 1 at $DIR/issue-41888.rs:10:21: 10:23
         scope 2 {
             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
         }
     }
 
@@ -51,8 +51,8 @@ fn main() -> () {
 
     bb4: {
         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
+        _5 = discriminant(_1);           // scope 1 at $DIR/issue-41888.rs:10:16: 10:24
+        switchInt(move _5) -> [0_isize: bb5, otherwise: bb6]; // scope 1 at $DIR/issue-41888.rs:10:16: 10:24
     }
 
     bb5: {
index a194cddd52a604c26942ed7cd5ff1e426546f057..8466014c9381c2e6de8f06b2b71e599c815cab37 100644 (file)
@@ -10,9 +10,9 @@
       let mut _6: u32;                     // in scope 0 at $DIR/issue-75439.rs:10:33: 10:35
       scope 1 {
           debug dwords => _2;              // in scope 1 at $DIR/issue-75439.rs:7:9: 7:15
+          let _4: u32;                     // in scope 1 at $DIR/issue-75439.rs:9:27: 9:29
           scope 3 {
               debug ip => _4;              // in scope 3 at $DIR/issue-75439.rs:9:27: 9:29
-              let _4: u32;                 // in scope 3 at $DIR/issue-75439.rs:9:27: 9:29
           }
           scope 4 {
           }
   
       bb1: {
           StorageDead(_3);                 // scope 2 at $DIR/issue-75439.rs:7:52: 7:53
-          switchInt(_2[0 of 4]) -> [0_u32: bb2, otherwise: bb8]; // scope 3 at $DIR/issue-75439.rs:9:12: 9:30
+          switchInt(_2[0 of 4]) -> [0_u32: bb2, otherwise: bb8]; // scope 1 at $DIR/issue-75439.rs:9:12: 9:30
       }
   
       bb2: {
-          switchInt(_2[1 of 4]) -> [0_u32: bb3, otherwise: bb8]; // scope 3 at $DIR/issue-75439.rs:9:12: 9:30
+          switchInt(_2[1 of 4]) -> [0_u32: bb3, otherwise: bb8]; // scope 1 at $DIR/issue-75439.rs:9:12: 9:30
       }
   
       bb3: {
-          switchInt(_2[2 of 4]) -> [0_u32: bb5, 4294901760_u32: bb6, otherwise: bb8]; // scope 3 at $DIR/issue-75439.rs:9:12: 9:30
+          switchInt(_2[2 of 4]) -> [0_u32: bb5, 4294901760_u32: bb6, otherwise: bb8]; // scope 1 at $DIR/issue-75439.rs:9:12: 9:30
       }
   
       bb4: {
index 7137e01fae3b93dde95a654ab0227c6619774b47..32de7f68b3e3cfd206d6595e3207399305034a7f 100644 (file)
@@ -8,33 +8,33 @@
       let mut _3: std::option::Option<T>;  // in scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:51: 4:68
       let mut _4: isize;                   // in scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:22: 4:26
       let mut _5: isize;                   // in scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:13: 4:20
+      let _6: u8;                          // in scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:18: 4:19
 -     let mut _7: bool;                    // in scope 0 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20
 -     let mut _8: u8;                      // in scope 0 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13
       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
       }
   
       bb0: {
-          StorageLive(_1);                 // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
-          StorageLive(_2);                 // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:31: 4:49
-          Deinit(_2);                      // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:31: 4:49
-          discriminant(_2) = 0;            // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:31: 4:49
-          StorageLive(_3);                 // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:51: 4:68
-          Deinit(_3);                      // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:51: 4:68
-          discriminant(_3) = 0;            // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:51: 4:68
-          Deinit(_1);                      // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
-          (_1.0: std::option::Option<u8>) = move _2; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
-          (_1.1: std::option::Option<T>) = move _3; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
-          StorageDead(_3);                 // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:68: 4:69
-          StorageDead(_2);                 // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:68: 4:69
-          _5 = discriminant((_1.0: std::option::Option<u8>)); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:12: 4:27
-          switchInt(move _5) -> [1_isize: bb1, otherwise: bb3]; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:12: 4:27
+          StorageLive(_1);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
+          StorageLive(_2);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:31: 4:49
+          Deinit(_2);                      // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:31: 4:49
+          discriminant(_2) = 0;            // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:31: 4:49
+          StorageLive(_3);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:51: 4:68
+          Deinit(_3);                      // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:51: 4:68
+          discriminant(_3) = 0;            // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:51: 4:68
+          Deinit(_1);                      // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
+          (_1.0: std::option::Option<u8>) = move _2; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
+          (_1.1: std::option::Option<T>) = move _3; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
+          StorageDead(_3);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:68: 4:69
+          StorageDead(_2);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:68: 4:69
+          _5 = discriminant((_1.0: std::option::Option<u8>)); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:12: 4:27
+          switchInt(move _5) -> [1_isize: bb1, otherwise: bb3]; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:12: 4:27
       }
   
       bb1: {
-          _4 = discriminant((_1.1: std::option::Option<T>)); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:12: 4:27
-          switchInt(move _4) -> [0_isize: bb2, otherwise: bb3]; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:4:12: 4:27
+          _4 = discriminant((_1.1: std::option::Option<T>)); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:12: 4:27
+          switchInt(move _4) -> [0_isize: bb2, otherwise: bb3]; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:12: 4:27
       }
   
       bb2: {
index fa8fd0a3c11705071428f8b7658e799452a73ec1..ee841fb6c5a05887864fb457ad6a7056150fd5ff 100644 (file)
@@ -5,30 +5,30 @@
       let mut _0: ();                      // return place in scope 0 at $DIR/unreachable.rs:8:11: 8:11
       let mut _1: std::option::Option<Empty>; // in scope 0 at $DIR/unreachable.rs:9:23: 9:30
       let mut _2: isize;                   // in scope 0 at $DIR/unreachable.rs:9:12: 9:20
+      let _3: Empty;                       // in scope 0 at $DIR/unreachable.rs:9:17: 9:19
       let mut _4: i32;                     // in scope 0 at $DIR/unreachable.rs:10:13: 10:19
       let _5: ();                          // in scope 0 at $DIR/unreachable.rs:12:9: 16:10
       let mut _6: bool;                    // in scope 0 at $DIR/unreachable.rs:12:12: 12:16
       let mut _7: !;                       // in scope 0 at $DIR/unreachable.rs:18:9: 18:21
       scope 1 {
           debug _x => _3;                  // in scope 1 at $DIR/unreachable.rs:9:17: 9:19
-          let _3: Empty;                   // in scope 1 at $DIR/unreachable.rs:9:17: 9:19
       }
       scope 2 {
           debug _y => _4;                  // in scope 2 at $DIR/unreachable.rs:10:13: 10:19
       }
   
       bb0: {
-          StorageLive(_1);                 // scope 1 at $DIR/unreachable.rs:9:23: 9:30
-          _1 = empty() -> bb1;             // scope 1 at $DIR/unreachable.rs:9:23: 9:30
+          StorageLive(_1);                 // scope 0 at $DIR/unreachable.rs:9:23: 9:30
+          _1 = empty() -> bb1;             // scope 0 at $DIR/unreachable.rs:9:23: 9:30
                                            // mir::Constant
                                            // + span: $DIR/unreachable.rs:9:23: 9:28
                                            // + literal: Const { ty: fn() -> Option<Empty> {empty}, val: Value(Scalar(<ZST>)) }
       }
   
       bb1: {
-          _2 = discriminant(_1);           // scope 1 at $DIR/unreachable.rs:9:12: 9:20
--         switchInt(move _2) -> [1_isize: bb2, otherwise: bb6]; // scope 1 at $DIR/unreachable.rs:9:12: 9:20
-+         goto -> bb2;                     // scope 1 at $DIR/unreachable.rs:9:12: 9:20
+          _2 = discriminant(_1);           // scope 0 at $DIR/unreachable.rs:9:12: 9:20
+-         switchInt(move _2) -> [1_isize: bb2, otherwise: bb6]; // scope 0 at $DIR/unreachable.rs:9:12: 9:20
++         goto -> bb2;                     // scope 0 at $DIR/unreachable.rs:9:12: 9:20
       }
   
       bb2: {
index 48c9f6bf27159469be35f14d3b6f7f02adba9188..91e90906557ca0c6d07708d8ba46fe224e8fbbe8 100644 (file)
       let mut _7: !;                       // in scope 0 at $DIR/unreachable_diverging.rs:18:9: 18:22
       scope 1 {
           debug x => _1;                   // in scope 1 at $DIR/unreachable_diverging.rs:13:9: 13:10
+          let _4: Empty;                   // in scope 1 at $DIR/unreachable_diverging.rs:14:17: 14:21
           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
           }
       }
   
       bb0: {
           StorageLive(_1);                 // scope 0 at $DIR/unreachable_diverging.rs:13:9: 13:10
           _1 = const true;                 // scope 0 at $DIR/unreachable_diverging.rs:13:13: 13:17
-          StorageLive(_2);                 // scope 2 at $DIR/unreachable_diverging.rs:14:25: 14:32
-          _2 = empty() -> bb1;             // scope 2 at $DIR/unreachable_diverging.rs:14:25: 14:32
+          StorageLive(_2);                 // scope 1 at $DIR/unreachable_diverging.rs:14:25: 14:32
+          _2 = empty() -> bb1;             // scope 1 at $DIR/unreachable_diverging.rs:14:25: 14:32
                                            // mir::Constant
                                            // + span: $DIR/unreachable_diverging.rs:14:25: 14:30
                                            // + literal: Const { ty: fn() -> Option<Empty> {empty}, val: Value(Scalar(<ZST>)) }
       }
   
       bb1: {
-          _3 = discriminant(_2);           // scope 2 at $DIR/unreachable_diverging.rs:14:12: 14:22
--         switchInt(move _3) -> [1_isize: bb2, otherwise: bb6]; // scope 2 at $DIR/unreachable_diverging.rs:14:12: 14:22
-+         switchInt(move _3) -> [1_isize: bb2, otherwise: bb5]; // scope 2 at $DIR/unreachable_diverging.rs:14:12: 14:22
+          _3 = discriminant(_2);           // scope 1 at $DIR/unreachable_diverging.rs:14:12: 14:22
+-         switchInt(move _3) -> [1_isize: bb2, otherwise: bb6]; // scope 1 at $DIR/unreachable_diverging.rs:14:12: 14:22
++         switchInt(move _3) -> [1_isize: bb2, otherwise: bb5]; // scope 1 at $DIR/unreachable_diverging.rs:14:12: 14:22
       }
   
       bb2: {
index d6156eaaf482345412cb0874dd1db849cc909122..0529b15522ea6a4ac43970cd9d630824a7aada5f 100644 (file)
       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 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
+          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
       }
   
       bb1: {
-          switchInt(((_3 as Some).0: u32)) -> [0_u32: bb2, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:7:15: 7:25
+          switchInt(((_3 as Some).0: u32)) -> [0_u32: bb2, otherwise: bb3]; // scope 1 at $DIR/while_let_loops.rs:7:15: 7:25
       }
   
       bb2: {
index 5657f9413a1b4e585bc62f359a2edc4ba3035c4c..3c94fbddc4421622cbbefab82507734cba5b0b1f 100644 (file)
@@ -5,8 +5,6 @@ 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: {