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