rust-lang / rust-lang/rust-clippy
`cargo clippy -- --target wasm32-unknown-unknown` results in confusing failures.
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
Description
Running cargo clippy -- --target wasm32-unknown-unknown will give strange failures, while cargo clippy --target wasm32-unknown-unknown will succeed as expected.
The failure occurs for any crate containing dependencies, for example I reproduced it with a minimal crate just pulling in and using anyhow.
I assume that the 2nd command is the correct way to use clippy while the 1st command is passing --target to some internal part of clippy which shouldnt really be exposed to the user.
However this is quite confusing behavior for the user.
Instead, at the very least, clippy should detect when --target is passed after -- and give the user a useful error, directing them to put it before the -- instead.
But maybe a more general solution is possible, I'm not familiar with the internals here.
Version
rustc 1.77.0 (aedd173a2 2024-03-17)
binary: rustc
commit-hash: aedd173a2c086e558c2b66d3743b344f977621a7
commit-date: 2024-03-17
host: x86_64-unknown-linux-gnu
release: 1.77.0
LLVM version: 17.0.6
Additional Labels
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 behavior with a minimal Rust crate that depends on anyhow, comparing cargo clippy -- --target wasm32-unknown-unknown with cargo clippy --target wasm32-unknown-unknown. Start by tracing how Clippy and Cargo handle arguments after --; done means the misplaced target argument is rejected with a useful message or otherwise no longer causes confusing dependency failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100