rust/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
3.0 KiB
Rust
Raw Normal View History

2020-04-02 16:09:01 -05:00
// MIR for `unwrap` after SimplifyCfg-elaborate-drops
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
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
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: {
StorageLive(_4); // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
_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
// + 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
// + 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
}
}