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

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

44 lines
809 B
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 {
2023-06-06 08:47:00 -05:00
debug opt => _1;
let mut _0: T;
let mut _2: isize;
let _3: T;
let mut _4: !;
let mut _5: isize;
let mut _6: isize;
let mut _7: isize;
2020-04-02 16:09:01 -05:00
scope 1 {
2023-06-06 08:47:00 -05:00
debug x => _3;
2020-04-02 16:09:01 -05:00
}
bb0: {
2023-06-06 08:47:00 -05:00
_2 = discriminant(_1);
switchInt(move _2) -> [0: bb1, 1: bb3, otherwise: bb2];
2020-04-02 16:09:01 -05:00
}
2020-06-30 13:31:00 -05:00
bb1: {
2023-06-06 08:47:00 -05:00
StorageLive(_4);
_4 = begin_panic::<&str>(const "explicit panic") -> bb4;
2020-04-02 16:09:01 -05:00
}
2020-06-30 13:31:00 -05:00
bb2: {
2023-06-06 08:47:00 -05:00
unreachable;
2020-04-02 16:09:01 -05:00
}
2020-06-30 13:31:00 -05:00
bb3: {
2023-06-06 08:47:00 -05:00
StorageLive(_3);
_3 = move ((_1 as Some).0: T);
_0 = move _3;
StorageDead(_3);
_5 = discriminant(_1);
return;
2020-04-02 16:09:01 -05:00
}
2020-06-30 13:31:00 -05:00
bb4 (cleanup): {
2023-06-06 08:47:00 -05:00
_7 = discriminant(_1);
resume;
2020-04-02 16:09:01 -05:00
}
}