diff options
| author | Alex Macleod <alex@macleod.io> | 2025-04-22 16:05:34 +0000 |
|---|---|---|
| committer | Pietro Albini <pietro@pietroalbini.org> | 2025-05-09 17:41:24 +0200 |
| commit | 287610b489e6e9139d14f86309919c89d15c181b (patch) | |
| tree | 16e6d25a822ba7b2ba30caab2413db3c0191fdaf /compiler/rustc_codegen_gcc | |
| parent | 6e8f95f7ce6f83801433abc31ef472d7fba62946 (diff) | |
| download | rust-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
