rust/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-pre-optimizations.after.panic-unwind.mir

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

44 lines
811 B
Rust
Raw Normal View History

// MIR for `unwrap` after SimplifyCfg-pre-optimizations
2020-04-02 21:09:01 +00:00
fn unwrap(_1: Option<T>) -> T {
2023-06-06 13:47:00 +00: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 21:09:01 +00:00
scope 1 {
2023-06-06 13:47:00 +00:00
debug x => _3;
2020-04-02 21:09:01 +00:00
}
bb0: {
2023-06-06 13:47:00 +00:00
_2 = discriminant(_1);
2024-02-12 03:56:03 +00:00
switchInt(move _2) -> [0: bb2, 1: bb3, otherwise: bb1];
2020-04-02 21:09:01 +00:00
}
2020-06-30 18:31:00 +00:00
bb1: {
2024-02-12 03:56:03 +00:00
unreachable;
2020-04-02 21:09:01 +00:00
}
2020-06-30 18:31:00 +00:00
bb2: {
2024-02-12 03:56:03 +00:00
StorageLive(_4);
_4 = begin_panic::<&str>(const "explicit panic") -> bb4;
2020-04-02 21:09:01 +00:00
}
2020-06-30 18:31:00 +00:00
bb3: {
2023-06-06 13:47:00 +00:00
StorageLive(_3);
_3 = move ((_1 as Some).0: T);
_0 = move _3;
StorageDead(_3);
_5 = discriminant(_1);
return;
2020-04-02 21:09:01 +00:00
}
2020-06-30 18:31:00 +00:00
bb4 (cleanup): {
2023-06-06 13:47:00 +00:00
_7 = discriminant(_1);
resume;
2020-04-02 21:09:01 +00:00
}
}