Open
Description
I'm not sure, if that's intended, but it's "impossible" to compare a reference type with a non-reference type via PartialEq
. Short example code:
let a = 3;
let b = 4;
&a == &b; // works
a == &b; // doesn't work
This should work in my opinion. There already are these impl
s in std (I removed some noise -- original):
impl<A, B> PartialEq<& B> for & A where A: PartialEq<B>
impl<A, B> PartialEq<&mut B> for &mut A where A: PartialEq<B>
impl<A, B> PartialEq<&mut B> for & A where A: PartialEq<B>
impl<A, B> PartialEq<& B> for &mut A where A: PartialEq<B>
The third line in my example works because of this.
Why not something like this?
impl<A, B> PartialEq<&B> for A where A: PartialEq<B>
impl<A, B> PartialEq< B> for &A where A: PartialEq<B>
Or do I misunderstand something?