2020-08-12 21:35:32 +00:00
|
|
|
- // MIR for `foo` before MatchBranchSimplification
|
|
|
|
+ // MIR for `foo` after MatchBranchSimplification
|
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
fn foo(_1: Option<()>) -> () {
|
2023-06-06 13:47:00 +00:00
|
|
|
debug bar => _1;
|
|
|
|
let mut _0: ();
|
|
|
|
let mut _2: bool;
|
|
|
|
let mut _3: isize;
|
|
|
|
+ let mut _4: isize;
|
2020-08-12 21:35:32 +00:00
|
|
|
|
|
|
|
bb0: {
|
2023-06-06 13:47:00 +00:00
|
|
|
StorageLive(_2);
|
|
|
|
_3 = discriminant(_1);
|
|
|
|
- switchInt(move _3) -> [0: bb2, otherwise: bb1];
|
|
|
|
+ StorageLive(_4);
|
|
|
|
+ _4 = move _3;
|
|
|
|
+ _2 = Eq(copy _4, const 0_isize);
|
|
|
|
+ StorageDead(_4);
|
|
|
|
+ switchInt(move _2) -> [0: bb2, otherwise: bb1];
|
2022-08-21 04:47:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2023-06-06 13:47:00 +00: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-17 01:32:53 +00:00
|
|
|
- }
|
|
|
|
-
|
2023-06-06 13:47:00 +00:00
|
|
|
- bb4: {
|
|
|
|
- _0 = ();
|
|
|
|
- goto -> bb6;
|
2021-03-17 01:32:53 +00:00
|
|
|
- }
|
|
|
|
-
|
2023-06-06 13:47:00 +00:00
|
|
|
- bb5: {
|
|
|
|
- _0 = const ();
|
|
|
|
- goto -> bb6;
|
2022-08-21 04:47:53 +00:00
|
|
|
- }
|
|
|
|
-
|
|
|
|
- bb6: {
|
2023-06-06 13:47:00 +00:00
|
|
|
StorageDead(_2);
|
|
|
|
return;
|
2020-08-12 21:35:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|