-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
New lint: empty_enum_variants_with_brackets
#12033
New lint: empty_enum_variants_with_brackets
#12033
Conversation
This lint checks for enum variants that don't have any fields but are declared using brackets.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @llogiq (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
Hello~ 😄 Since this code logic shares a lot common with [ That means have the declare_lint_pass!(EmptyWithBrackets => [
EMPTY_ENUM_VARIANTS_WITH_BRACKETS,
EMPTY_STRUCTS_WITH_BRACKETS,
]); and in that impl EarlyLintPass for EmptyWithBrackes {
/// code for empty_structs_with_brackets... bla bla
fn check_item()
/// your logic...
fn check_variant()
} reduces repeating code |
That makes sense. I shall make these changes. |
There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged. You can start a rebase with the following commands:
The following commits are merge commits: |
I'll be opening another PR after making the suggested changes. |
☔ The latest upstream changes (presumably #10283) made this pull request unmergeable. Please resolve the merge conflicts. |
Feel free to add |
@llogiq another PR I've opened regarding this issue has already been merged. :) |
This lint checks for enum variants that don't have any fields but are declared using brackets.
Closes #12007
changelog: new lint: [
empty_enum_variants_with_brackets
]