-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Potential false positive for wildcard_imports #5917
Labels
C-bug
Category: Clippy is not doing the correct thing
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
good-first-issue
These issues are a good way to get started with Clippy
Comments
flip1995
added
good-first-issue
These issues are a good way to get started with Clippy
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
labels
Aug 18, 2020
This was referenced Aug 18, 2020
Hi, I'd like to give this a go and try to submit a PR for this. As far as I can see https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/src/wildcard_imports.rs#L200 only allows wildcard where the last segment before the wildcard is "prelude", so I assume we would hereby allow wildcards where |
Hi, and welcome to Clippy! Yes, I think that makes sense 👍 |
stchris
added a commit
to stchris/rust-clippy
that referenced
this issue
Aug 20, 2020
Prelude imports are exempt from wildcard import warnings. Until now only imports of the form ``` use ...::prelude::*; ``` were considered. This change makes it so that the segment `prelude` can show up anywhere, for instance: ``` use ...::prelude::v1::*; ``` Fixes rust-lang#5917
stchris
added a commit
to stchris/rust-clippy
that referenced
this issue
Aug 21, 2020
Prelude imports are exempt from wildcard import warnings. Until now only imports of the form ``` use ...::prelude::*; ``` were considered. This change makes it so that the segment `prelude` can show up anywhere, for instance: ``` use ...::prelude::v1::*; ``` Fixes rust-lang#5917
bors
added a commit
that referenced
this issue
Aug 22, 2020
Widen understanding of prelude import Prelude imports are exempt from wildcard import warnings. Until now only imports of the form ``` use ...::prelude::*; ``` were considered. This change makes it so that the segment `prelude` can show up anywhere, for instance: ``` use ...::prelude::v1::*; ``` Fixes #5917 changelog: Allow `prelude` to appear in any segment of the import path in [`wildcard_imports`]
bors
added a commit
that referenced
this issue
Aug 22, 2020
Widen understanding of prelude import Prelude imports are exempt from wildcard import warnings. Until now only imports of the form ``` use ...::prelude::*; ``` were considered. This change makes it so that the segment `prelude` can show up anywhere, for instance: ``` use ...::prelude::v1::*; ``` Fixes #5917 changelog: Allow `prelude` to appear in any segment of the import path in [`wildcard_imports`]
hegza
pushed a commit
to hegza/rust-clippy
that referenced
this issue
Aug 25, 2020
Prelude imports are exempt from wildcard import warnings. Until now only imports of the form ``` use ...::prelude::*; ``` were considered. This change makes it so that the segment `prelude` can show up anywhere, for instance: ``` use ...::prelude::v1::*; ``` Fixes rust-lang#5917
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: Clippy is not doing the correct thing
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
good-first-issue
These issues are a good way to get started with Clippy
I tried this code:
I expected to see this happen: explanation
No warning, since this is a prelude import which is exempt from the
wildcard_imports
rule. I think it's the versioning suffix::v1
from theno-std-compat
crate that throws it off.Instead, this happened: explanation
Meta
cargo clippy -V
: clippy 0.0.212 (7e6d6e5 2020-08-16)rustc -Vv
:Backtrace
The text was updated successfully, but these errors were encountered: