Skip to content

match lowering: Introduce a TestCase enum to replace most matching on PatKind#121393

Merged
bors merged 4 commits intorust-lang:masterfrom
Nadrieril:match-lowering-testcase
Feb 22, 2024
Merged

match lowering: Introduce a TestCase enum to replace most matching on PatKind#121393
bors merged 4 commits intorust-lang:masterfrom
Nadrieril:match-lowering-testcase

Conversation

@Nadrieril
Copy link
Member

Introduces TestCase that represents the specific outcome of a test. It complements TestKind which represents a test. In MatchPair::new() we select the appropriate TestCase for the pattern, and after that we almost never have to inspect the pattern directly during match lowering.

Together with #120904, this makes MatchPair into a standalone abstraction that hides the details of thir::Pat. This will become even truer in the next PR where I make TestCase handle or patterns. This opens the door to a lot of future simplifications.

r? @matthewjasper

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants