2020-08-12 16:35:32 -05:00
|
|
|
- // MIR for `foo` before MatchBranchSimplification
|
|
|
|
+ // MIR for `foo` after MatchBranchSimplification
|
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
fn foo(_1: Option<()>) -> () {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug bar => _1;
|
|
|
|
let mut _0: ();
|
|
|
|
let mut _2: bool;
|
|
|
|
let mut _3: isize;
|
|
|
|
+ let mut _4: isize;
|
2020-08-12 16:35:32 -05:00
|
|
|
|
|
|
|
bb0: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_2);
|
|
|
|
_3 = discriminant(_1);
|
|
|
|
- switchInt(move _3) -> [0: bb2, otherwise: bb1];
|
|
|
|
+ StorageLive(_4);
|
|
|
|
+ _4 = move _3;
|
|
|
|
+ _2 = Eq(_4, const 0_isize);
|
|
|
|
+ StorageDead(_4);
|
|
|
|
+ switchInt(move _2) -> [0: bb2, otherwise: bb1];
|
2022-08-20 23:47:53 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2023-06-06 08:47:00 -05:00
|
|
|
- _2 = const false;
|
|
|
|
+ _0 = ();
|
|
|
|
goto -> bb3;
|
|
|
|
}
|
|
|
|
|
|
|
|
bb2: {
|
|
|
|
- _2 = const true;
|
|
|
|
+ _0 = const ();
|
|
|
|
goto -> bb3;
|
|
|
|
}
|
|
|
|
|
|
|
|
bb3: {
|
|
|
|
- switchInt(move _2) -> [0: bb5, otherwise: bb4];
|
2021-03-16 20:32:53 -05:00
|
|
|
- }
|
|
|
|
-
|
2023-06-06 08:47:00 -05:00
|
|
|
- bb4: {
|
|
|
|
- _0 = ();
|
|
|
|
- goto -> bb6;
|
2021-03-16 20:32:53 -05:00
|
|
|
- }
|
|
|
|
-
|
2023-06-06 08:47:00 -05:00
|
|
|
- bb5: {
|
|
|
|
- _0 = const ();
|
|
|
|
- goto -> bb6;
|
2022-08-20 23:47:53 -05:00
|
|
|
- }
|
|
|
|
-
|
|
|
|
- bb6: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_2);
|
|
|
|
return;
|
2020-08-12 16:35:32 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|