rust/tests/ui/lint/ambiguous_wide_pointer_comparisons_suggestions.stderr
许杰友 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

19 lines
651 B
Plaintext

warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
--> $DIR/ambiguous_wide_pointer_comparisons_suggestions.rs:8:13
|
LL | let _ = a == b;
| ^^^^^^
|
= note: `#[warn(ambiguous_wide_pointer_comparisons)]` on by default
help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
|
LL | let _ = std::ptr::addr_eq(a, b);
| ++++++++++++++++++ ~ +
help: use explicit `std::ptr::eq` method to compare metadata and addresses
|
LL | let _ = std::ptr::eq(a, b);
| +++++++++++++ ~ +
warning: 1 warning emitted