-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Ignore imported items in min_ident_chars
#12285
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
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @dswij (or someone else) some time within the next two weeks. 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 (
|
| | ||
LL | use extern_types::Aaa; | ||
| ^^^ | ||
LL | use extern_types::{Aaa, N as W}; |
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.
There were 2 distinct changes which that diff does poorly reflect:
- I started by making sure that
use extern_types::Aaa
does not trigger the warning - I added another identifier with an alias, to make sure the alias triggers the warning
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.
Thanks! LGTM, just a small request. I think it's good to merge after.
@@ -3,7 +3,7 @@ | |||
#![warn(clippy::min_ident_chars)] |
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.
Can you also help add a positive and negative case for const
in the test?
Thanks for your review! I was unsure about where the |
Suppress the `min_ident_chars` warning for items whose name we cannot control. Do not warn for `use a::b`, but warn for `use a::b as c`, since `c` is a local identifier. Fixes rust-lang#12232
That last force-push fixes only 2 typos in the comments. |
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.
Thanks, the test cases look great :)
@bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Suppress the
min_ident_chars
warning for items whose name we cannot control. Do not warn foruse a::b
, but warn foruse a::b as c
, sincec
is a local identifier.Fixes #12232
Please write a short comment explaining your change (or "none" for internal only changes)
changelog: [
min_ident_chars
]: Do not warn on non-local identifiers