mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
8a3765582c
Add lint against ambiguous wide pointer comparisons This PR is the resolution of https://github.com/rust-lang/rust/issues/106447 decided in https://github.com/rust-lang/rust/issues/117717 by T-lang. ## `ambiguous_wide_pointer_comparisons` *warn-by-default* The `ambiguous_wide_pointer_comparisons` lint checks comparison of `*const/*mut ?Sized` as the operands. ### Example ```rust let ab = (A, B); let a = &ab.0 as *const dyn T; let b = &ab.1 as *const dyn T; let _ = a == b; ``` ### Explanation The comparison includes metadata which may not be expected. ------- This PR also drops `clippy::vtable_address_comparisons` which is superseded by this one. ~~One thing: is the current naming right? `invalid` seems a bit too much.~~ Fixes https://github.com/rust-lang/rust/issues/117717 |
||
---|---|---|
.. | ||
arc.rs | ||
autotraits.rs | ||
borrow.rs | ||
boxed.rs | ||
btree_set_hash.rs | ||
c_str.rs | ||
const_fns.rs | ||
cow_str.rs | ||
fmt.rs | ||
heap.rs | ||
lib.rs | ||
linked_list.rs | ||
rc.rs | ||
slice.rs | ||
str.rs | ||
string.rs | ||
thin_box.rs | ||
vec_deque.rs | ||
vec.rs |