"unused import" could be more helpful ("nothing to export")
Open
Nobody has claimed this yet.
A-diagnostics
T-compiler
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Code
mod misc {
const WOW: usize = 1;
}
pub use misc::*;
Current output
warning: unused import: `misc::*`
--> src/main.rs:6:9
|
6 | pub use misc::*;
| ^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: `playground` (bin "playground") generated 1 warning (run `cargo clippy --fix --bin "playground"` to apply 1 suggestion)
Desired output
Either an additional hint saying why this lint is complaining "There is nothing to export"
Or a new lint or something.
Rationale and extra context
In more complex codebases it's not immediately obvious what the problem is. I'd prefer a message like "nothing to export".
Other cases
No response
Rust Version
rustc 1.75.0 (82e1608df 2023-12-21)
binary: rustc
commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112
commit-date: 2023-12-21
host: aarch64-apple-darwin
release: 1.75.0
LLVM version: 17.0.6
Anything else?
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the warning from the provided snippet in src/main.rs using the reported Rust version, then trace the compiler diagnostic for the unused pub use. The work is complete when this case explains that there is nothing to export, with regression coverage confirming the updated diagnostic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100