]> git.proxmox.com Git - rustc.git/blob - src/test/mir-opt/unreachable.main.UnreachablePropagation.diff
63356a400d29aa519fa7692796aa9974fb1e44a3
[rustc.git] / src / test / 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:8:11: 8:11
6 let mut _1: std::option::Option<Empty>; // in scope 0 at $DIR/unreachable.rs:9:23: 9:30
7 let mut _2: isize; // in scope 0 at $DIR/unreachable.rs:9:12: 9:20
8 let _3: Empty; // in scope 0 at $DIR/unreachable.rs:9:17: 9:19
9 let mut _4: i32; // in scope 0 at $DIR/unreachable.rs:10:13: 10:19
10 let _5: (); // in scope 0 at $DIR/unreachable.rs:12:9: 16:10
11 let mut _6: bool; // in scope 0 at $DIR/unreachable.rs:12:12: 12:16
12 let mut _7: !; // in scope 0 at $DIR/unreachable.rs:18:9: 18:21
13 scope 1 {
14 debug _x => _3; // in scope 1 at $DIR/unreachable.rs:9:17: 9:19
15 }
16 scope 2 {
17 debug _y => _4; // in scope 2 at $DIR/unreachable.rs:10:13: 10:19
18 }
19
20 bb0: {
21 StorageLive(_1); // scope 0 at $DIR/unreachable.rs:9:23: 9:30
22 _1 = empty() -> bb1; // scope 0 at $DIR/unreachable.rs:9:23: 9:30
23 // mir::Constant
24 // + span: $DIR/unreachable.rs:9:23: 9:28
25 // + literal: Const { ty: fn() -> std::option::Option<Empty> {empty}, val: Value(Scalar(<ZST>)) }
26 }
27
28 bb1: {
29 _2 = discriminant(_1); // scope 0 at $DIR/unreachable.rs:9:12: 9:20
30 - switchInt(move _2) -> [1_isize: bb2, otherwise: bb6]; // scope 0 at $DIR/unreachable.rs:9:12: 9:20
31 + goto -> bb2; // scope 0 at $DIR/unreachable.rs:9:12: 9:20
32 }
33
34 bb2: {
35 - StorageLive(_3); // scope 0 at $DIR/unreachable.rs:9:17: 9:19
36 - _3 = move ((_1 as Some).0: Empty); // scope 0 at $DIR/unreachable.rs:9:17: 9:19
37 - StorageLive(_4); // scope 0 at $DIR/unreachable.rs:10:13: 10:19
38 - StorageLive(_5); // scope 2 at $DIR/unreachable.rs:12:9: 16:10
39 - StorageLive(_6); // scope 2 at $DIR/unreachable.rs:12:12: 12:16
40 - _6 = const true; // scope 2 at $DIR/unreachable.rs:12:12: 12:16
41 - switchInt(move _6) -> [false: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable.rs:12:12: 12:16
42 - }
43 -
44 - bb3: {
45 - _4 = const 21_i32; // scope 2 at $DIR/unreachable.rs:13:13: 13:20
46 - _5 = const (); // scope 2 at $DIR/unreachable.rs:12:17: 14:10
47 - goto -> bb5; // scope 2 at $DIR/unreachable.rs:12:9: 16:10
48 - }
49 -
50 - bb4: {
51 - _4 = const 42_i32; // scope 2 at $DIR/unreachable.rs:15:13: 15:20
52 - _5 = const (); // scope 2 at $DIR/unreachable.rs:14:16: 16:10
53 - goto -> bb5; // scope 2 at $DIR/unreachable.rs:12:9: 16:10
54 - }
55 -
56 - bb5: {
57 - StorageDead(_6); // scope 2 at $DIR/unreachable.rs:16:9: 16:10
58 - StorageDead(_5); // scope 2 at $DIR/unreachable.rs:16:9: 16:10
59 - StorageLive(_7); // scope 2 at $DIR/unreachable.rs:18:9: 18:21
60 - unreachable; // scope 2 at $DIR/unreachable.rs:18:15: 18:17
61 - }
62 -
63 - bb6: {
64 _0 = const (); // scope 0 at $DIR/unreachable.rs:19:6: 19:6
65 StorageDead(_1); // scope 0 at $DIR/unreachable.rs:20:1: 20:2
66 return; // scope 0 at $DIR/unreachable.rs:20:2: 20:2
67 }
68 }
69