2020-04-02 16:09:01 -05:00
|
|
|
// MIR for `unwrap` after SimplifyCfg-elaborate-drops
|
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
fn unwrap(_1: Option<T>) -> T {
|
2022-11-02 16:54:49 -05:00
|
|
|
debug opt => _1; // in scope 0 at $DIR/no_drop_for_inactive_variant.rs:+0:14: +0:17
|
|
|
|
let mut _0: T; // return place in scope 0 at $DIR/no_drop_for_inactive_variant.rs:+0:33: +0:34
|
|
|
|
let mut _2: isize; // in scope 0 at $DIR/no_drop_for_inactive_variant.rs:+2:9: +2:16
|
|
|
|
let _3: T; // in scope 0 at $DIR/no_drop_for_inactive_variant.rs:+2:14: +2:15
|
2021-01-09 09:52:06 -06:00
|
|
|
let mut _4: !; // in scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
|
2022-11-02 16:54:49 -05:00
|
|
|
let mut _5: isize; // in scope 0 at $DIR/no_drop_for_inactive_variant.rs:+5:1: +5:2
|
|
|
|
let mut _6: isize; // in scope 0 at $DIR/no_drop_for_inactive_variant.rs:+5:1: +5:2
|
|
|
|
let mut _7: isize; // in scope 0 at $DIR/no_drop_for_inactive_variant.rs:+5:1: +5:2
|
2020-04-02 16:09:01 -05:00
|
|
|
scope 1 {
|
2022-11-02 16:54:49 -05:00
|
|
|
debug x => _3; // in scope 1 at $DIR/no_drop_for_inactive_variant.rs:+2:14: +2:15
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb0: {
|
2022-11-02 16:54:49 -05:00
|
|
|
_2 = discriminant(_1); // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+1:11: +1:14
|
2022-12-03 18:03:27 -06:00
|
|
|
switchInt(move _2) -> [0: bb1, 1: bb3, otherwise: bb2]; // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+1:5: +1:14
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
|
|
|
|
2020-06-30 13:31:00 -05:00
|
|
|
bb1: {
|
2021-01-09 09:52:06 -06:00
|
|
|
StorageLive(_4); // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
|
2022-04-16 08:27:54 -05:00
|
|
|
_4 = begin_panic::<&str>(const "explicit panic") -> bb4; // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
|
2020-04-02 16:09:01 -05:00
|
|
|
// mir::Constant
|
2021-01-09 09:52:06 -06:00
|
|
|
// + span: $SRC_DIR/std/src/panic.rs:LL:COL
|
2022-07-06 09:14:46 -05:00
|
|
|
// + literal: Const { ty: fn(&str) -> ! {begin_panic::<&str>}, val: Value(<ZST>) }
|
2020-04-02 16:09:01 -05:00
|
|
|
// mir::Constant
|
2021-01-09 09:52:06 -06:00
|
|
|
// + span: $SRC_DIR/std/src/panic.rs:LL:COL
|
2022-05-06 03:58:54 -05:00
|
|
|
// + literal: Const { ty: &str, val: Value(Slice(..)) }
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
|
|
|
|
2020-06-30 13:31:00 -05:00
|
|
|
bb2: {
|
2022-11-02 16:54:49 -05:00
|
|
|
unreachable; // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+1:11: +1:14
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
|
|
|
|
2020-06-30 13:31:00 -05:00
|
|
|
bb3: {
|
2022-11-02 16:54:49 -05:00
|
|
|
StorageLive(_3); // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+2:14: +2:15
|
|
|
|
_3 = move ((_1 as Some).0: T); // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+2:14: +2:15
|
|
|
|
_0 = move _3; // scope 1 at $DIR/no_drop_for_inactive_variant.rs:+2:20: +2:21
|
|
|
|
StorageDead(_3); // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+2:20: +2:21
|
|
|
|
_5 = discriminant(_1); // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+5:1: +5:2
|
|
|
|
return; // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+5:2: +5:2
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
|
|
|
|
2020-06-30 13:31:00 -05:00
|
|
|
bb4 (cleanup): {
|
2022-11-02 16:54:49 -05:00
|
|
|
_7 = discriminant(_1); // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+5:1: +5:2
|
|
|
|
resume; // scope 0 at $DIR/no_drop_for_inactive_variant.rs:+0:1: +5:2
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
|
|
|
}
|