2022-12-04 13:20:55 -06:00
|
|
|
- // MIR for `map` before SimplifyLocals-before-const-prop
|
|
|
|
+ // MIR for `map` after SimplifyLocals-before-const-prop
|
2020-03-30 08:56:52 -05:00
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
fn map(_1: Option<Box<()>>) -> Option<Box<()>> {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug x => _1;
|
|
|
|
let mut _0: std::option::Option<std::boxed::Box<()>>;
|
|
|
|
let mut _2: isize;
|
|
|
|
let _3: std::boxed::Box<()>;
|
|
|
|
let mut _4: std::boxed::Box<()>;
|
|
|
|
- let mut _5: bool;
|
|
|
|
- let mut _6: isize;
|
|
|
|
- let mut _7: isize;
|
2020-03-30 08:56:52 -05:00
|
|
|
scope 1 {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug x => _3;
|
2020-03-30 08:56:52 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb0: {
|
2023-06-06 08:47:00 -05:00
|
|
|
- _5 = const false;
|
|
|
|
- _5 = const true;
|
|
|
|
_2 = discriminant(_1);
|
2024-02-11 21:56:03 -06:00
|
|
|
switchInt(move _2) -> [0: bb3, 1: bb2, otherwise: bb1];
|
2022-04-05 18:02:57 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2024-02-11 21:56:03 -06:00
|
|
|
unreachable;
|
|
|
|
}
|
|
|
|
|
|
|
|
bb2: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_3);
|
|
|
|
_3 = move ((_1 as Some).0: std::boxed::Box<()>);
|
|
|
|
StorageLive(_4);
|
|
|
|
_4 = move _3;
|
|
|
|
_0 = Option::<Box<()>>::Some(move _4);
|
|
|
|
StorageDead(_4);
|
|
|
|
StorageDead(_3);
|
|
|
|
goto -> bb4;
|
2022-04-05 18:02:57 -05:00
|
|
|
}
|
|
|
|
|
2022-07-26 08:17:02 -05:00
|
|
|
bb3: {
|
2023-06-06 08:47:00 -05:00
|
|
|
_0 = Option::<Box<()>>::None;
|
|
|
|
goto -> bb4;
|
2022-04-05 18:02:57 -05:00
|
|
|
}
|
|
|
|
|
2022-07-26 08:17:02 -05:00
|
|
|
bb4: {
|
2023-06-06 08:47:00 -05:00
|
|
|
- _6 = discriminant(_1);
|
|
|
|
return;
|
2020-03-30 08:56:52 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|