2024-03-17 18:36:55 +00:00
|
|
|
// MIR for `unwrap` after SimplifyCfg-pre-optimizations
|
2020-04-02 21:09:01 +00:00
|
|
|
|
2020-09-02 07:40:56 +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
|
|
|
}
|
|
|
|
}
|