fork/rust
git clone https://git.julia.blue/fork/rust
49cae55760d
1.44.0
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 _5: (); // in scope 0 at $DIR/unreachable.rs:12:9: 16:10 10 let mut _6: bool; // in scope 0 at $DIR/unreachable.rs:12:12: 12:16 11 let mut _7: !; // in scope 0 at $DIR/unreachable.rs:18:9: 18:21 12 scope 1 { 13 debug _x => _3; // in scope 1 at $DIR/unreachable.rs:9:17: 9:19 14 let mut _4: i32; // in scope 1 at $DIR/unreachable.rs:10:13: 10:19 15 scope 2 { 16 debug _y => _4; // in scope 2 at $DIR/unreachable.rs:10:13: 10:19 17 } 18 } 19 20 bb0: { 21 StorageLive(_1); // bb0[0]: scope 0 at $DIR/unreachable.rs:9:23: 9:30 22 _1 = const empty() -> bb1; // bb0[1]: scope 0 at $DIR/unreachable.rs:9:23: 9:30 23 // ty::Const 24 // + ty: fn() -> std::option::Option<Empty> {empty} 25 // + val: Value(Scalar(<ZST>)) 26 // mir::Constant 27 // + span: $DIR/unreachable.rs:9:23: 9:28 28 // + literal: Const { ty: fn() -> std::option::Option<Empty> {empty}, val: Value(Scalar(<ZST>)) } 29 } 30 31 bb1: { 32 _2 = discriminant(_1); // bb1[0]: scope 0 at $DIR/unreachable.rs:9:12: 9:20 33- switchInt(move _2) -> [1isize: bb3, otherwise: bb2]; // bb1[1]: scope 0 at $DIR/unreachable.rs:9:12: 9:20 34+ goto -> bb2; // bb1[1]: scope 0 at $DIR/unreachable.rs:9:12: 9:20 35 } 36 37 bb2: { 38 _0 = const (); // bb2[0]: scope 0 at $DIR/unreachable.rs:9:5: 19:6 39 // ty::Const 40 // + ty: () 41 // + val: Value(Scalar(<ZST>)) 42 // mir::Constant 43 // + span: $DIR/unreachable.rs:9:5: 19:6 44 // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) } 45 StorageDead(_1); // bb2[1]: scope 0 at $DIR/unreachable.rs:20:1: 20:2 46 return; // bb2[2]: scope 0 at $DIR/unreachable.rs:20:2: 20:2 47- } 48- 49- bb3: { 50- StorageLive(_3); // bb3[0]: scope 0 at $DIR/unreachable.rs:9:17: 9:19 51- _3 = move ((_1 as Some).0: Empty); // bb3[1]: scope 0 at $DIR/unreachable.rs:9:17: 9:19 52- StorageLive(_4); // bb3[2]: scope 1 at $DIR/unreachable.rs:10:13: 10:19 53- StorageLive(_5); // bb3[3]: scope 2 at $DIR/unreachable.rs:12:9: 16:10 54- StorageLive(_6); // bb3[4]: scope 2 at $DIR/unreachable.rs:12:12: 12:16 55- _6 = const true; // bb3[5]: scope 2 at $DIR/unreachable.rs:12:12: 12:16 56- // ty::Const 57- // + ty: bool 58- // + val: Value(Scalar(0x01)) 59- // mir::Constant 60- // + span: $DIR/unreachable.rs:12:12: 12:16 61- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) } 62- switchInt(_6) -> [false: bb4, otherwise: bb5]; // bb3[6]: scope 2 at $DIR/unreachable.rs:12:9: 16:10 63- } 64- 65- bb4: { 66- _4 = const 42i32; // bb4[0]: scope 2 at $DIR/unreachable.rs:15:13: 15:20 67- // ty::Const 68- // + ty: i32 69- // + val: Value(Scalar(0x0000002a)) 70- // mir::Constant 71- // + span: $DIR/unreachable.rs:15:18: 15:20 72- // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) } 73- _5 = const (); // bb4[1]: scope 2 at $DIR/unreachable.rs:14:16: 16:10 74- // ty::Const 75- // + ty: () 76- // + val: Value(Scalar(<ZST>)) 77- // mir::Constant 78- // + span: $DIR/unreachable.rs:14:16: 16:10 79- // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) } 80- goto -> bb6; // bb4[2]: scope 2 at $DIR/unreachable.rs:12:9: 16:10 81- } 82- 83- bb5: { 84- _4 = const 21i32; // bb5[0]: scope 2 at $DIR/unreachable.rs:13:13: 13:20 85- // ty::Const 86- // + ty: i32 87- // + val: Value(Scalar(0x00000015)) 88- // mir::Constant 89- // + span: $DIR/unreachable.rs:13:18: 13:20 90- // + literal: Const { ty: i32, val: Value(Scalar(0x00000015)) } 91- _5 = const (); // bb5[1]: scope 2 at $DIR/unreachable.rs:12:17: 14:10 92- // ty::Const 93- // + ty: () 94- // + val: Value(Scalar(<ZST>)) 95- // mir::Constant 96- // + span: $DIR/unreachable.rs:12:17: 14:10 97- // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) } 98- goto -> bb6; // bb5[2]: scope 2 at $DIR/unreachable.rs:12:9: 16:10 99- } 100- 101- bb6: { 102- StorageDead(_6); // bb6[0]: scope 2 at $DIR/unreachable.rs:16:9: 16:10 103- StorageDead(_5); // bb6[1]: scope 2 at $DIR/unreachable.rs:16:9: 16:10 104- StorageLive(_7); // bb6[2]: scope 2 at $DIR/unreachable.rs:18:9: 18:21 105- unreachable; // bb6[3]: scope 2 at $DIR/unreachable.rs:18:15: 18:17 106 } 107 } 108