-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.
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?
becmer, tannakartikey, natewind, schneiderfelipe and Mubelotixstepancheg
Metadata
Metadata
Assignees
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.