about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorAlex Macleod <alex@macleod.io>2025-04-22 16:05:34 +0000
committerPietro Albini <pietro@pietroalbini.org>2025-05-09 17:41:24 +0200
commit287610b489e6e9139d14f86309919c89d15c181b (patch)
tree16e6d25a822ba7b2ba30caab2413db3c0191fdaf /compiler/rustc_codegen_gcc
parent6e8f95f7ce6f83801433abc31ef472d7fba62946 (diff)
downloadrust-287610b489e6e9139d14f86309919c89d15c181b.tar.gz
rust-287610b489e6e9139d14f86309919c89d15c181b.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_codegen_gcc')
0 files changed, 0 insertions, 0 deletions