]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/unreachable.main.UnreachablePropagation.diff
Auto merge of #102842 - rol1510:issue-85566-fix, r=notriddle
[rust.git] / tests / mir-opt / unreachable.main.UnreachablePropagation.diff
1 - // MIR for `main` before UnreachablePropagation
2 + // MIR for `main` after UnreachablePropagation
3   
4   fn main() -> () {
5       let mut _0: ();                      // return place in scope 0 at $DIR/unreachable.rs:+0:11: +0:11
6       let mut _1: std::option::Option<Empty>; // in scope 0 at $DIR/unreachable.rs:+1:23: +1:30
7       let mut _2: isize;                   // in scope 0 at $DIR/unreachable.rs:+1:12: +1:20
8       let _5: ();                          // in scope 0 at $DIR/unreachable.rs:+4:9: +8:10
9       let mut _6: bool;                    // in scope 0 at $DIR/unreachable.rs:+4:12: +4:16
10       let mut _7: !;                       // in scope 0 at $DIR/unreachable.rs:+10:9: +10:21
11       scope 1 {
12           debug _x => _3;                  // in scope 1 at $DIR/unreachable.rs:+1:17: +1:19
13           let _3: Empty;                   // in scope 1 at $DIR/unreachable.rs:+1:17: +1:19
14           let mut _4: i32;                 // in scope 1 at $DIR/unreachable.rs:+2:13: +2:19
15           scope 2 {
16               debug _y => _4;              // in scope 2 at $DIR/unreachable.rs:+2:13: +2:19
17           }
18       }
19   
20       bb0: {
21           StorageLive(_1);                 // scope 1 at $DIR/unreachable.rs:+1:23: +1:30
22           _1 = empty() -> bb1;             // scope 1 at $DIR/unreachable.rs:+1:23: +1:30
23                                            // mir::Constant
24                                            // + span: $DIR/unreachable.rs:9:23: 9:28
25                                            // + literal: Const { ty: fn() -> Option<Empty> {empty}, val: Value(<ZST>) }
26       }
27   
28       bb1: {
29           _2 = discriminant(_1);           // scope 1 at $DIR/unreachable.rs:+1:12: +1:20
30 -         switchInt(move _2) -> [1: bb2, otherwise: bb6]; // scope 1 at $DIR/unreachable.rs:+1:12: +1:20
31 +         switchInt(move _2) -> [1: bb2, otherwise: bb3]; // scope 1 at $DIR/unreachable.rs:+1:12: +1:20
32       }
33   
34       bb2: {
35 -         StorageLive(_3);                 // scope 1 at $DIR/unreachable.rs:+1:17: +1:19
36 -         _3 = move ((_1 as Some).0: Empty); // scope 1 at $DIR/unreachable.rs:+1:17: +1:19
37 -         StorageLive(_4);                 // scope 1 at $DIR/unreachable.rs:+2:13: +2:19
38 -         StorageLive(_5);                 // scope 2 at $DIR/unreachable.rs:+4:9: +8:10
39 -         StorageLive(_6);                 // scope 2 at $DIR/unreachable.rs:+4:12: +4:16
40 -         _6 = const true;                 // scope 2 at $DIR/unreachable.rs:+4:12: +4:16
41 -         switchInt(move _6) -> [0: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable.rs:+4:12: +4:16
42 +         unreachable;                     // scope 2 at $DIR/unreachable.rs:+4:12: +4:16
43       }
44   
45       bb3: {
46 -         _4 = const 21_i32;               // scope 2 at $DIR/unreachable.rs:+5:13: +5:20
47 -         _5 = const ();                   // scope 2 at $DIR/unreachable.rs:+4:17: +6:10
48 -         goto -> bb5;                     // scope 2 at $DIR/unreachable.rs:+4:9: +8:10
49 -     }
50
51 -     bb4: {
52 -         _4 = const 42_i32;               // scope 2 at $DIR/unreachable.rs:+7:13: +7:20
53 -         _5 = const ();                   // scope 2 at $DIR/unreachable.rs:+6:16: +8:10
54 -         goto -> bb5;                     // scope 2 at $DIR/unreachable.rs:+4:9: +8:10
55 -     }
56
57 -     bb5: {
58 -         StorageDead(_6);                 // scope 2 at $DIR/unreachable.rs:+8:9: +8:10
59 -         StorageDead(_5);                 // scope 2 at $DIR/unreachable.rs:+8:9: +8:10
60 -         StorageLive(_7);                 // scope 2 at $DIR/unreachable.rs:+10:9: +10:21
61 -         unreachable;                     // scope 2 at $DIR/unreachable.rs:+10:15: +10:17
62 -     }
63
64 -     bb6: {
65           _0 = const ();                   // scope 0 at $DIR/unreachable.rs:+11:6: +11:6
66           StorageDead(_1);                 // scope 0 at $DIR/unreachable.rs:+12:1: +12:2
67           return;                          // scope 0 at $DIR/unreachable.rs:+12:2: +12:2
68       }
69   }
70