-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
name resolution and warnings inconsistent #5564
Comments
Looking at the code, that's a genuinely unused import when not compiling with I ran into this when removing unused imports in the compiler, and you can prefix the import with |
You're right. In this case I moved the |
Allow `use super::*;` glob imports changelog: Allow super::* glob imports fixes rust-lang#5554 fixes rust-lang#5569 A first pass at rust-lang#5554 - this allows all `use super::*` to pass, which may or may not be desirable. The original issue was around allowing test modules to import their entire parent modules - I'm happy to modify this to do that instead, may just need some guidance on how to implement that (I played around a bit with #[cfg(test)] but from what I can gather, clippy itself isn't in test mode when running, even if the code in question is being checked for the test target).
When using
use foo::{FooTypeA, FooTypeB};
anduse foo;
together, the compiler complains thatuse foo;
is an unused import even when a call to something likefoo::hello()
exists. Removinguse foo;
gets rid of the warning and the crate compiles. However, the crate will fail to link (for example with--test
) unless theuse foo;
is there.It seems like the warning is a bug unless the intent is to have
use foo::{FooTypeA, FooTypeB};
also bring in foo itself.Here's a small crate that shows the example. This was originally found in rust-core-foundation.
https://gist.github.com/metajack/5249056
The text was updated successfully, but these errors were encountered: