Skip to content

Conversation

@Zalathar
Copy link
Member

@Zalathar Zalathar commented Dec 16, 2025

In the spirit of #149946, this is another renaming of something I've always found confusing.

When lowering match conditions, there is a subtle distinction between the kind of test being performed (on a scrutinee place), the possible outcomes of that test, and the different “cases” (corresponding to pattern nodes) that the test is distinguishing. Cases imply a particular preferred test, but once a test is chosen it can also interact with other cases as well.

I have often mixed up TestKind and TestCase, since the names are so similar, and they share several variant names. Therefore, this PR renames TestCase to TestableCase, to emphasise that these are the things selected by whatever test is being performed.

There should be no change to compiler behaviour.

@rustbot
Copy link
Collaborator

rustbot commented Dec 16, 2025

Some changes occurred in match lowering

cc @Nadrieril

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 16, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 16, 2025

r? @mati865

rustbot has assigned @mati865.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rust-log-analyzer

This comment has been minimized.

Comment on lines -1264 to +1267
enum TestCase<'tcx> {
enum TestableCase<'tcx> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me TestableCase is more confusing than TestCase. I would prefer TestOutcome for example

@Nadrieril
Copy link
Member

r? me

@rustbot rustbot assigned Nadrieril and unassigned mati865 Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

5 participants