-
Notifications
You must be signed in to change notification settings - Fork 1.7k
item_name_repetitions
: exclude enum variants with identical path components
#14619
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
Conversation
samueltardieu is on vacation. Please choose another assignee. |
r? clippy |
check_enum_start(cx, item_name, var); | ||
check_enum_end(cx, item_name, var); | ||
} | ||
|
||
Self::check_enum_common_affix(cx, item, def); | ||
} | ||
|
||
// Exclude enum variants that contain a single item where any component | ||
// of the contained item's path is identical to the variant's name. | ||
fn filter_matching_enum_data<'a>(def: &'a EnumDef<'a>) -> Vec<&'a Variant<'a>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: I don't think we should prefilter; we should instead perform this check in check_enum_start
and check_enum_end
after we think we want to lint on it (so we perform this more expensive check later)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, I've made changes to reflect this
088a429
to
9adf1f0
Compare
9adf1f0
to
e89cf4d
Compare
fix #13637
As suggested in the PR above, we should not lint enum variants containing matching path names.
changelog: [
item_name_repetitions
]: exclude enum variants with identical path components