-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #127028 - Nadrieril:fix-or-pat-expansion, r=matthewjasper
Fix regression in the MIR lowering of or-patterns In #126553 I made a silly indexing mistake and regressed the MIR lowering of or-patterns. This fixes it. r? `@compiler-errors` because I'd like this to be merged quickly 🙏
- Loading branch information
Showing
3 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
tests/mir-opt/building/match/simple_match.match_enum.built.after.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// MIR for `match_enum` after built | ||
|
||
fn match_enum(_1: E1) -> bool { | ||
debug x => _1; | ||
let mut _0: bool; | ||
let mut _2: isize; | ||
|
||
bb0: { | ||
PlaceMention(_1); | ||
_2 = discriminant(_1); | ||
switchInt(move _2) -> [0: bb3, 1: bb5, 2: bb7, otherwise: bb2]; | ||
} | ||
|
||
bb1: { | ||
FakeRead(ForMatchedPlace(None), _1); | ||
unreachable; | ||
} | ||
|
||
bb2: { | ||
goto -> bb1; | ||
} | ||
|
||
bb3: { | ||
goto -> bb9; | ||
} | ||
|
||
bb4: { | ||
goto -> bb2; | ||
} | ||
|
||
bb5: { | ||
goto -> bb9; | ||
} | ||
|
||
bb6: { | ||
goto -> bb2; | ||
} | ||
|
||
bb7: { | ||
_0 = const false; | ||
goto -> bb11; | ||
} | ||
|
||
bb8: { | ||
goto -> bb2; | ||
} | ||
|
||
bb9: { | ||
falseEdge -> [real: bb10, imaginary: bb7]; | ||
} | ||
|
||
bb10: { | ||
_0 = const true; | ||
goto -> bb11; | ||
} | ||
|
||
bb11: { | ||
return; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters