about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2025-04-03 00:02:44 +0200
committerSamuel Tardieu <sam@rfc1149.net>2025-04-08 18:16:41 +0200
commitcbfe1f5f587c314ad64c57a7c7d2b38cdb3d3b7e (patch)
treeed3f8d4f9d89665e533e87d6426e0560d121cb8c /compiler/rustc_interface/src
parent97bb0639585096faa050b80a289836e46ddc3210 (diff)
downloadrust-cbfe1f5f587c314ad64c57a7c7d2b38cdb3d3b7e.tar.gz
rust-cbfe1f5f587c314ad64c57a7c7d2b38cdb3d3b7e.zip
Restrict the cases where `ptr_eq` triggers
`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.
Diffstat (limited to 'compiler/rustc_interface/src')
0 files changed, 0 insertions, 0 deletions