Open
Description
The documentation for PartialEq
states:
x.eq(y)
can also be writtenx == y
, andx.ne(y)
can be writtenx != y
.
This is not true, as #44762 illustrates, as well as this URLO-inspired example:
let val = 1i32;
let val_ref = &val;
let is_equal = val.eq(val_ref); // Compiles
let is_equal = val == val_ref; // Does not compile
The other operator's documentation don't have this error. Shl
(and Shr
) also explicitly note some differences in inference between operators and the method call.
@rustbot label +A-docs