rust-lang / rust-lang/rust-clippy
Warn on unnecessary coercions
Open
Nobody has claimed this yet.
A-lint
E-medium
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
Here the as *const i32 coercion is unnecessary, but no warning is emitted.
fn foo(_x: *const i32) {}
pub fn bar(x: &mut i32) {
foo(x as *const i32)
}
pub fn baz(x: &mut i32) {
foo(x)
}
cc @oli-obk
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
The payload names no files, tests, or entry points. Start by reproducing the Rust example in rust-clippy, then identify the appropriate lint and test location; done means the unnecessary as *const i32 form emits a warning while the direct call remains valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100