unused macros fails some obvious cases due to prelude #51177
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
WG-epoch
Working group: Epoch (2018) management
This example does not warn, even in Rust 2018 edition:
The reason is that we resolve
foo
against the extern crate, when in fact it could also be resolved by the extern prelude fallback. But that's tricky! Something like this could also happen:In which case, removing
foo
would result in importing the module, since (I believe) that would shadow the implicit prelude imports.Therefore: we can do better here, but with caution -- for example, we could suggest removing an extern crate in a scenario like this, but only if there are no glob imports in the current module. Not sure it's worth it though.
The text was updated successfully, but these errors were encountered: