-
Notifications
You must be signed in to change notification settings - Fork 533
Update non_exhaustive
to use the attribute template
#1921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ehuss
wants to merge
16
commits into
rust-lang:master
Choose a base branch
from
ehuss:non_exhaustive
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
This adds a rule name that was missing for this statement. It also clarifies why this is being said.
This statement isn't really a rule, but more of a high-level explanation. I have moved it to the intro where I think it better belongs.
Some word cleanup and a hidden clarification.
The original felt a little awkward with how it differentiated between enum and enum variants. I also wasn't terribly happy with using a list here.
This adds a missing rule for this paragraph. It also adds a little more clarity as to what it means.
The existing rule was mixing pattern match restrictions with match arm exhaustiveness. Although very closely related, I think they deserve to be split up. This also adds a little clarity about tuple matching.
`type` is a keyword and can't be used here.
Single-segment identifiers are bindings and don't work to match against a Unit struct.
The intent here is to highlight exactly where the errors are in the example (and which ones aren't errors!).
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.
New rules:
attributes.type-system.non_exhaustive.duplicates
attributes.type-system.non_exhaustive.enum-exhaustiveness
attributes.type-system.non_exhaustive.enum-cast
attributes.type-system.non_exhaustive.inhabited
Renamed rules:
attributes.type-system.non_exhaustive.external-crate
moved to.intro
because it is generally explaining the purpose.