2024-03-17 13:36:55 -05:00
|
|
|
// MIR for `unwrap` after SimplifyCfg-pre-optimizations
|
2020-04-02 16:09:01 -05:00
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
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);
|
2024-02-11 21:56:03 -06:00
|
|
|
switchInt(move _2) -> [0: bb2, 1: bb3, otherwise: bb1];
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
|
|
|
|
2020-06-30 13:31:00 -05:00
|
|
|
bb1: {
|
2024-02-11 21:56:03 -06:00
|
|
|
unreachable;
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
|
|
|
|
2020-06-30 13:31:00 -05:00
|
|
|
bb2: {
|
2024-02-11 21:56:03 -06: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
|
|
|
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
|
|
|
}
|
|
|
|
}
|