rust-lang / rust-lang/rust-clippy
wildcard imports breaks code
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
clippy 0.0.212 (fc5d0cc 2020-02-24)
I applied the wildcard import lints suggestions but it broke my code inside tests:
I have use library::* here https://github.com/matthiaskrgr/cargo-cache/blob/master/src/dirsizes.rs#L21
and it gets expanded to use crate::library::CargoCachePaths; (lint suggestion).
This however breaks tests where I use use super::*; here: https://github.com/matthiaskrgr/cargo-cache/blob/master/src/dirsizes.rs#L464
and causes DirInfo struct to not be found anymore inside the test. :(
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
Start with the wildcard import lint behavior described in src/dirsizes.rs, especially the imports near lines 21 and 464 in the linked cargo-cache example. Reproduce the suggested expansion and inspect how it affects the test's use super::*; done when the lint suggestion no longer causes DirInfo to become unavailable in that test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100