diff options
| author | Alex Macleod <alex@macleod.io> | 2025-04-22 16:05:34 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-22 16:05:34 +0000 |
| commit | 2422f0b9acd5e7876f7a3e270dfb74cde972ebcf (patch) | |
| tree | 220c70ca838d046be11f92968edfc05d5b9ceb08 /compiler/rustc_interface/src | |
| parent | 0621446356e20fd2ead13a6763bb936c95eb0cfa (diff) | |
| parent | cbfe1f5f587c314ad64c57a7c7d2b38cdb3d3b7e (diff) | |
| download | rust-2422f0b9acd5e7876f7a3e270dfb74cde972ebcf.tar.gz rust-2422f0b9acd5e7876f7a3e270dfb74cde972ebcf.zip | |
Restrict the cases where `ptr_eq` triggers (#14526)
`ptr_eq` was recently enhanced to lint on more cases of raw pointers comparison: - lint on all raw pointer comparison, by proposing to use `[core|std]::ptr::eq(lhs, rhs)` instead of `lhs == rhs`; - removing one symetric `as usize` on each size if needed - peeling any level of `as *[const|mut] _` if the remaining expression can still be coerced into the original one (i.e., is a ref or raw pointer to the same type as before) The current change restricts the lint to the cases where at least one level of symetric `as usize`, or any conversion to a raw pointer, could be removed. For example, a direct comparaison of two raw pointers will not trigger the lint anymore. changelog: [`ptr_eq`]: do not lint when comparing two raw pointers directly with no casts involved Fixes rust-lang/rust-clippy#14525
Diffstat (limited to 'compiler/rustc_interface/src')
0 files changed, 0 insertions, 0 deletions
