// MIR for `unwrap` after SimplifyCfg-elaborate-drops fn unwrap(_1: std::option::Option) -> T { debug opt => _1; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:7:14: 7:17 let mut _0: T; // return place in scope 0 at $DIR/no-drop-for-inactive-variant.rs:7:33: 7:34 let mut _2: isize; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:9: 9:16 let _3: T; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15 let mut _4: !; // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL let mut _5: isize; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2 let mut _6: isize; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2 scope 1 { debug x => _3; // in scope 1 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15 } bb0: { _2 = discriminant(_1); // bb0[0]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:9: 9:16 switchInt(move _2) -> [0isize: bb2, 1isize: bb4, otherwise: bb3]; // bb0[1]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:9: 9:16 } bb1 (cleanup): { resume; // bb1[0]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:7:1: 12:2 } bb2: { StorageLive(_4); // bb2[0]: scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL const std::rt::begin_panic::<&str>(const "explicit panic") -> bb5; // bb2[1]: scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL // ty::Const // + ty: fn(&str) -> ! {std::rt::begin_panic::<&str>} // + val: Value(Scalar()) // mir::Constant // + span: $SRC_DIR/libstd/macros.rs:LL:COL // + literal: Const { ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}, val: Value(Scalar()) } // ty::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: [] }), undef_mask: UndefMask { blocks: [16383], len: Size { raw: 14 } }, size: Size { raw: 14 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 }) // mir::Constant // + span: $SRC_DIR/libstd/macros.rs:LL:COL // + 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: [] }), undef_mask: UndefMask { blocks: [16383], len: Size { raw: 14 } }, size: Size { raw: 14 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 }) } } bb3: { unreachable; // bb3[0]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:8:11: 8:14 } bb4: { StorageLive(_3); // bb4[0]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15 _3 = move ((_1 as Some).0: T); // bb4[1]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15 _0 = move _3; // bb4[2]: scope 1 at $DIR/no-drop-for-inactive-variant.rs:9:20: 9:21 StorageDead(_3); // bb4[3]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:21: 9:22 _5 = discriminant(_1); // bb4[4]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2 return; // bb4[5]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:2: 12:2 } bb5 (cleanup): { drop(_1) -> bb1; // bb5[0]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2 } }