@@ -796,49 +796,51 @@ impl<'a, 'b> Pattern<'a> for &'b String {
796
796
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
797
797
impl PartialEq for String {
798
798
#[ inline]
799
- fn eq ( & self , other : & String ) -> bool { PartialEq :: eq ( & * * self , & * * other) }
799
+ fn eq ( & self , other : & String ) -> bool { PartialEq :: eq ( & self [ .. ] , & other[ .. ] ) }
800
800
#[ inline]
801
- fn ne ( & self , other : & String ) -> bool { PartialEq :: ne ( & * * self , & * * other) }
801
+ fn ne ( & self , other : & String ) -> bool { PartialEq :: ne ( & self [ .. ] , & other[ .. ] ) }
802
802
}
803
803
804
804
macro_rules! impl_eq {
805
805
( $lhs: ty, $rhs: ty) => {
806
806
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
807
807
impl <' a> PartialEq <$rhs> for $lhs {
808
808
#[ inline]
809
- fn eq( & self , other: & $rhs) -> bool { PartialEq :: eq( & * * self , & * * other) }
809
+ fn eq( & self , other: & $rhs) -> bool { PartialEq :: eq( & self [ .. ] , & other[ .. ] ) }
810
810
#[ inline]
811
- fn ne( & self , other: & $rhs) -> bool { PartialEq :: ne( & * * self , & * * other) }
811
+ fn ne( & self , other: & $rhs) -> bool { PartialEq :: ne( & self [ .. ] , & other[ .. ] ) }
812
812
}
813
813
814
814
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
815
815
impl <' a> PartialEq <$lhs> for $rhs {
816
816
#[ inline]
817
- fn eq( & self , other: & $lhs) -> bool { PartialEq :: eq( & * * self , & * * other) }
817
+ fn eq( & self , other: & $lhs) -> bool { PartialEq :: eq( & self [ .. ] , & other[ .. ] ) }
818
818
#[ inline]
819
- fn ne( & self , other: & $lhs) -> bool { PartialEq :: ne( & * * self , & * * other) }
819
+ fn ne( & self , other: & $lhs) -> bool { PartialEq :: ne( & self [ .. ] , & other[ .. ] ) }
820
820
}
821
821
822
822
}
823
823
}
824
824
825
+ impl_eq ! { String , str }
825
826
impl_eq ! { String , & ' a str }
827
+ impl_eq ! { Cow <' a, str >, str }
826
828
impl_eq ! { Cow <' a, str >, String }
827
829
828
830
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
829
831
impl < ' a , ' b > PartialEq < & ' b str > for Cow < ' a , str > {
830
832
#[ inline]
831
- fn eq ( & self , other : & & ' b str ) -> bool { PartialEq :: eq ( & * * self , & * * other) }
833
+ fn eq ( & self , other : & & ' b str ) -> bool { PartialEq :: eq ( & self [ .. ] , & other[ .. ] ) }
832
834
#[ inline]
833
- fn ne ( & self , other : & & ' b str ) -> bool { PartialEq :: ne ( & * * self , & * * other) }
835
+ fn ne ( & self , other : & & ' b str ) -> bool { PartialEq :: ne ( & self [ .. ] , & other[ .. ] ) }
834
836
}
835
837
836
838
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
837
839
impl < ' a , ' b > PartialEq < Cow < ' a , str > > for & ' b str {
838
840
#[ inline]
839
- fn eq ( & self , other : & Cow < ' a , str > ) -> bool { PartialEq :: eq ( & * * self , & * * other) }
841
+ fn eq ( & self , other : & Cow < ' a , str > ) -> bool { PartialEq :: eq ( & self [ .. ] , & other[ .. ] ) }
840
842
#[ inline]
841
- fn ne ( & self , other : & Cow < ' a , str > ) -> bool { PartialEq :: ne ( & * * self , & * * other) }
843
+ fn ne ( & self , other : & Cow < ' a , str > ) -> bool { PartialEq :: ne ( & self [ .. ] , & other[ .. ] ) }
842
844
}
843
845
844
846
#[ unstable( feature = "collections" , reason = "waiting on Str stabilization" ) ]
0 commit comments