1
Fork 0

Auto merge of #121268 - Urgau:improve_ambi_wide_ptr_cmps, r=Nadrieril

Add detection of [Partial]Ord methods in the `ambiguous_wide_pointer_comparisons` lint

Partially addresses https://github.com/rust-lang/rust/issues/121264 by adding diagnostics items for PartialOrd and Ord methods, detecting such diagnostics items as "binary operation" and suggesting the correct replacement.

I also took the opportunity to change the suggestion to use new methods `.cast()` on `*mut T` an d `*const T`.
This commit is contained in:
bors 2024-03-29 18:23:57 +00:00
commit af4a5a13a1
10 changed files with 271 additions and 82 deletions

View file

@ -531,8 +531,15 @@ symbols! {
cmp,
cmp_max,
cmp_min,
cmp_ord_max,
cmp_ord_min,
cmp_partialeq_eq,
cmp_partialeq_ne,
cmp_partialord_cmp,
cmp_partialord_ge,
cmp_partialord_gt,
cmp_partialord_le,
cmp_partialord_lt,
cmpxchg16b_target_feature,
cmse_nonsecure_entry,
coerce_unsized,