Mark the invalid discriminant case as unreachable.#14
Open
jacobsa wants to merge 3 commits intobrain0:masterfrom
Open
Mark the invalid discriminant case as unreachable.#14jacobsa wants to merge 3 commits intobrain0:masterfrom
jacobsa wants to merge 3 commits intobrain0:masterfrom
Conversation
In order to avoid diffs in later commits.
Give the inner field a name to prevent/discourage direct use, ensuring the invariant that it always has a valid value. This will be necessary for an upcoming commit that takes advantage of that invariant. I tried instead putting the enum into a module and controlling this with visibility, but I couldn't make it work correctly for enums defined within a function, as in the case of the doc tests.
In reality this value should never be invalid. Teaching this to the compiler improves benchmarks for some low-level task polling code I'm working on by 3-4% in practice.
Author
|
Hi, is there anyone who can have a look at this? I've potentially got another pull request to send (use |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In reality this value should never be invalid. Teaching this to the compiler improves benchmarks for some low-level task polling code I'm working on by 3-4% in practice.