mir_build: Rename TestCase to TestableCase#150051
Conversation
|
Some changes occurred in match lowering cc @Nadrieril |
This comment has been minimized.
This comment has been minimized.
| enum TestCase<'tcx> { | ||
| enum TestableCase<'tcx> { |
There was a problem hiding this comment.
For me TestableCase is more confusing than TestCase. I would prefer TestOutcome for example
There was a problem hiding this comment.
Hmm, my main motivation is to get rid of the Test prefix, because that's the part that keeps confusing me.
I think I would find TestOutcome even more confusing, because of TestBranch.
|
r? me |
|
I would like to give this thing a better name, but I think it's only worth changing if we can agree on a new name that's clearly better. So I would be fine with closing this for now, since it would conflict with some other simplifications/improvements that I'm investigating. |
|
I can live with @bors r+ rollup |
mir_build: Rename `TestCase` to `TestableCase` In the spirit of rust-lang#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.
Rollup of 4 pull requests Successful merges: - #149919 (Correctly encode doc attribute metadata) - #150051 (mir_build: Rename `TestCase` to `TestableCase`) - #150088 (miri: add `miri_spin_loop` to make `hint::spin_loop` work consistently) - #150096 (Revert #148937) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #150051 - Zalathar:thir-pat, r=Nadrieril mir_build: Rename `TestCase` to `TestableCase` 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.
Rollup of 4 pull requests Successful merges: - rust-lang/rust#149919 (Correctly encode doc attribute metadata) - rust-lang/rust#150051 (mir_build: Rename `TestCase` to `TestableCase`) - rust-lang/rust#150088 (miri: add `miri_spin_loop` to make `hint::spin_loop` work consistently) - rust-lang/rust#150096 (Revert rust-lang/rust#148937) r? `@ghost` `@rustbot` modify labels: rollup
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
TestKindandTestCase, since the names are so similar, and they share several variant names. Therefore, this PR renamesTestCasetoTestableCase, to emphasise that these are the things selected by whatever test is being performed.There should be no change to compiler behaviour.