]>
Commit | Line | Data |
---|---|---|
ba9703b0 XL |
1 | // MIR for `unwrap` after SimplifyCfg-elaborate-drops |
2 | ||
1b1a35ee | 3 | fn unwrap(_1: Option<T>) -> T { |
ba9703b0 XL |
4 | debug opt => _1; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:7:14: 7:17 |
5 | let mut _0: T; // return place in scope 0 at $DIR/no-drop-for-inactive-variant.rs:7:33: 7:34 | |
6 | let mut _2: isize; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:9: 9:16 | |
7 | let _3: T; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15 | |
5869c6ff | 8 | let mut _4: !; // in scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL |
ba9703b0 XL |
9 | let mut _5: isize; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2 |
10 | let mut _6: isize; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2 | |
f035d41b | 11 | let mut _7: isize; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2 |
ba9703b0 XL |
12 | scope 1 { |
13 | debug x => _3; // in scope 1 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15 | |
14 | } | |
15 | ||
16 | bb0: { | |
94222f64 XL |
17 | _2 = discriminant(_1); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:8:11: 8:14 |
18 | switchInt(move _2) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:8:5: 8:14 | |
ba9703b0 XL |
19 | } |
20 | ||
f035d41b | 21 | bb1: { |
5869c6ff XL |
22 | StorageLive(_4); // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL |
23 | begin_panic::<&str>(const "explicit panic") -> bb4; // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL | |
ba9703b0 | 24 | // mir::Constant |
5869c6ff | 25 | // + span: $SRC_DIR/std/src/panic.rs:LL:COL |
ba9703b0 XL |
26 | // + literal: Const { ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}, val: Value(Scalar(<ZST>)) } |
27 | // ty::Const | |
28 | // + ty: &str | |
17df50a5 | 29 | // + val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [16383], len: Size { raw: 14 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 }) |
ba9703b0 | 30 | // mir::Constant |
5869c6ff | 31 | // + span: $SRC_DIR/std/src/panic.rs:LL:COL |
17df50a5 | 32 | // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [16383], len: Size { raw: 14 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 }) } |
ba9703b0 XL |
33 | } |
34 | ||
f035d41b | 35 | bb2: { |
f9f354fc | 36 | unreachable; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:8:11: 8:14 |
ba9703b0 XL |
37 | } |
38 | ||
f035d41b | 39 | bb3: { |
f9f354fc XL |
40 | StorageLive(_3); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15 |
41 | _3 = move ((_1 as Some).0: T); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15 | |
42 | _0 = move _3; // scope 1 at $DIR/no-drop-for-inactive-variant.rs:9:20: 9:21 | |
f035d41b | 43 | StorageDead(_3); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:20: 9:21 |
29967ef6 | 44 | _5 = discriminant(_1); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2 |
f9f354fc | 45 | return; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:2: 12:2 |
ba9703b0 XL |
46 | } |
47 | ||
f035d41b | 48 | bb4 (cleanup): { |
29967ef6 | 49 | _7 = discriminant(_1); // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2 |
f035d41b | 50 | resume; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:7:1: 12:2 |
ba9703b0 XL |
51 | } |
52 | } |