@@ -1043,6 +1043,7 @@ pub fn max_by_key<T, F: FnMut(&T) -> K, K: Ord>(v1: T, v2: T, mut f: F) -> T {
10431043mod impls {
10441044 use crate :: cmp:: Ordering :: { self , Equal , Greater , Less } ;
10451045 use crate :: hint:: unreachable_unchecked;
1046+ use crate :: marker:: { StructuralEq , StructuralPartialEq } ;
10461047
10471048 macro_rules! partial_eq_impl {
10481049 ( $( $t: ty) * ) => ( $(
@@ -1209,6 +1210,9 @@ mod impls {
12091210
12101211 // & pointers
12111212
1213+ #[ unstable( feature = "structural_match" , issue = "31434" ) ]
1214+ impl < A : ?Sized > StructuralPartialEq for & A where A : StructuralPartialEq { }
1215+
12121216 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
12131217 impl < A : ?Sized , B : ?Sized > PartialEq < & B > for & A
12141218 where
@@ -1259,11 +1263,18 @@ mod impls {
12591263 Ord :: cmp ( * self , * other)
12601264 }
12611265 }
1266+
1267+ #[ unstable( feature = "structural_match" , issue = "31434" ) ]
1268+ impl < A : ?Sized > StructuralEq for & A where A : StructuralEq { }
1269+
12621270 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
12631271 impl < A : ?Sized > Eq for & A where A : Eq { }
12641272
12651273 // &mut pointers
12661274
1275+ #[ unstable( feature = "structural_match" , issue = "31434" ) ]
1276+ impl < A : ?Sized > StructuralPartialEq for & mut A where A : StructuralPartialEq { }
1277+
12671278 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
12681279 impl < A : ?Sized , B : ?Sized > PartialEq < & mut B > for & mut A
12691280 where
@@ -1314,6 +1325,10 @@ mod impls {
13141325 Ord :: cmp ( * self , * other)
13151326 }
13161327 }
1328+
1329+ #[ unstable( feature = "structural_match" , issue = "31434" ) ]
1330+ impl < A : ?Sized > StructuralEq for & mut A where A : StructuralEq { }
1331+
13171332 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
13181333 impl < A : ?Sized > Eq for & mut A where A : Eq { }
13191334
0 commit comments