rust-lang / rust-lang/rust-clippy
Regression in `useless_transmute` due to rustup
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
After rust-lang/rust#69189, the following check returns true for types, where only the lifetimes differ: &'a T == &'b T
According to https://github.com/rust-lang/rust/pull/69189#issuecomment-601193980, this probably needs to be fixed by checking the lifetimes of the types with MIR borrowck.
Originally posted by @flip1995 in https://github.com/rust-lang/rust-clippy/pull/5333
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 in clippy_lints/src/transmute.rs at lines 303-307, then read rust-lang/rust#69189 and its linked discussion about MIR borrowck. Investigate how to distinguish reference types whose lifetimes differ, and verify that the useless_transmute check no longer treats those types as equal.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100