rust/tests/ui/lint/ambiguous_wide_pointer_comparisons_suggestions.fixed
许杰友 Jieyou Xu (Joe) 4d386d9f04
Downgrade ambiguous_wide_pointer_comparisons suggestions to MaybeIncorrect
It is possible to have more than one valid suggestion, which when
applied together via rustfix causes the code to no longer compile.

This is a temporary workaround; the real long term solution to these
issues is to solve <https://github.com/rust-lang/rust/issues/53934>.
2024-02-20 17:21:01 +00:00

14 lines
275 B
Rust

//@ run-rustfix
//@ rustfix-only-machine-applicable
//@ check-pass
// See <https://github.com/rust-lang/rust/issues/121330>.
fn cmp<T: ?Sized>(a: *mut T, b: *mut T) -> bool {
let _ = a == b;
//~^ WARN ambiguous wide pointer comparison
panic!();
}
fn main() {}