Commit graph

4 commits

Author SHA1 Message Date
Samuel Tardieu
cbfe1f5f58 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.
2025-04-08 18:16:41 +02:00
Samuel Tardieu
d7d0abd2ad Lint more cases of ptr::eq()
Also, do not strip conversions of a function pointer to a `*const`, as
no implicit conversion will take place.
2025-03-02 15:50:13 +01:00
Guillaume Gomez
f666fd6417 Update UI tests 2025-02-15 13:38:16 +01:00
Guillaume Gomez
40a45a463f Update and add ui tests for core/std suggestions 2024-01-14 14:45:24 +01:00