fork/rust
git clone https://git.julia.blue/fork/rust
49cae55760d
1.44.0
1- // MIR for `main` before UninhabitedEnumBranching 2+ // MIR for `main` after UninhabitedEnumBranching 3 4 fn main() -> () { 5 let mut _0: (); // return place in scope 0 at $DIR/uninhabited_enum_branching.rs:19:11: 19:11 6 let _1: &str; // in scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6 7 let mut _2: Test1; // in scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19 8 let mut _3: isize; // in scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20 9 let _4: &str; // in scope 0 at $DIR/uninhabited_enum_branching.rs:22:24: 22:34 10 let _5: &str; // in scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24 11 let _6: &str; // in scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6 12 let mut _7: Test2; // in scope 0 at $DIR/uninhabited_enum_branching.rs:26:11: 26:19 13 let mut _8: isize; // in scope 0 at $DIR/uninhabited_enum_branching.rs:27:9: 27:17 14 let _9: &str; // in scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24 15 16 bb0: { 17 StorageLive(_1); // bb0[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6 18 StorageLive(_2); // bb0[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19 19 _2 = Test1::C; // bb0[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19 20 _3 = discriminant(_2); // bb0[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20 21- switchInt(move _3) -> [0isize: bb2, 1isize: bb3, otherwise: bb1]; // bb0[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20 22+ switchInt(move _3) -> bb1; // bb0[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20 23 } 24 25 bb1: { 26 StorageLive(_5); // bb1[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24 27 _5 = const "C"; // bb1[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24 28 // ty::Const 29 // + ty: &str 30 // + val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) 31 // mir::Constant 32 // + span: $DIR/uninhabited_enum_branching.rs:23:21: 23:24 33 // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) } 34 _1 = &(*_5); // bb1[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24 35 StorageDead(_5); // bb1[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:23: 23:24 36 goto -> bb4; // bb1[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6 37 } 38 39 bb2: { 40 _1 = const "A(Empty)"; // bb2[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:21:24: 21:34 41 // ty::Const 42 // + ty: &str 43 // + val: Value(Slice { data: Allocation { bytes: [65, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 }) 44 // mir::Constant 45 // + span: $DIR/uninhabited_enum_branching.rs:21:24: 21:34 46 // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [65, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 }) } 47 goto -> bb4; // bb2[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6 48 } 49 50 bb3: { 51 StorageLive(_4); // bb3[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:22:24: 22:34 52 _4 = const "B(Empty)"; // bb3[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:22:24: 22:34 53 // ty::Const 54 // + ty: &str 55 // + val: Value(Slice { data: Allocation { bytes: [66, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 }) 56 // mir::Constant 57 // + span: $DIR/uninhabited_enum_branching.rs:22:24: 22:34 58 // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [66, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 }) } 59 _1 = &(*_4); // bb3[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:22:24: 22:34 60 StorageDead(_4); // bb3[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:22:33: 22:34 61 goto -> bb4; // bb3[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6 62 } 63 64 bb4: { 65 StorageDead(_2); // bb4[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:24:6: 24:7 66 StorageDead(_1); // bb4[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:24:6: 24:7 67 StorageLive(_6); // bb4[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6 68 StorageLive(_7); // bb4[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:11: 26:19 69 _7 = Test2::D; // bb4[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:11: 26:19 70 _8 = discriminant(_7); // bb4[5]: scope 0 at $DIR/uninhabited_enum_branching.rs:27:9: 27:17 71 switchInt(move _8) -> [4isize: bb6, otherwise: bb5]; // bb4[6]: scope 0 at $DIR/uninhabited_enum_branching.rs:27:9: 27:17 72 } 73 74 bb5: { 75 StorageLive(_9); // bb5[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24 76 _9 = const "E"; // bb5[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24 77 // ty::Const 78 // + ty: &str 79 // + val: Value(Slice { data: Allocation { bytes: [69], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) 80 // mir::Constant 81 // + span: $DIR/uninhabited_enum_branching.rs:28:21: 28:24 82 // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [69], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) } 83 _6 = &(*_9); // bb5[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24 84 StorageDead(_9); // bb5[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:23: 28:24 85 goto -> bb7; // bb5[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6 86 } 87 88 bb6: { 89 _6 = const "D"; // bb6[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:27:21: 27:24 90 // ty::Const 91 // + ty: &str 92 // + val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) 93 // mir::Constant 94 // + span: $DIR/uninhabited_enum_branching.rs:27:21: 27:24 95 // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) } 96 goto -> bb7; // bb6[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6 97 } 98 99 bb7: { 100 StorageDead(_7); // bb7[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7 101 StorageDead(_6); // bb7[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7 102 _0 = const (); // bb7[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:19:11: 30:2 103 // ty::Const 104 // + ty: () 105 // + val: Value(Scalar(<ZST>)) 106 // mir::Constant 107 // + span: $DIR/uninhabited_enum_branching.rs:19:11: 30:2 108 // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) } 109 return; // bb7[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:30:2: 30:2 110 } 111 } 112