@@ -1043,6 +1043,7 @@ pub fn max_by_key<T, F: FnMut(&T) -> K, K: Ord>(v1: T, v2: T, mut f: F) -> T {
1043
1043
mod impls {
1044
1044
use crate :: cmp:: Ordering :: { self , Equal , Greater , Less } ;
1045
1045
use crate :: hint:: unreachable_unchecked;
1046
+ use crate :: marker:: { StructuralEq , StructuralPartialEq } ;
1046
1047
1047
1048
macro_rules! partial_eq_impl {
1048
1049
( $( $t: ty) * ) => ( $(
@@ -1209,6 +1210,9 @@ mod impls {
1209
1210
1210
1211
// & pointers
1211
1212
1213
+ #[ unstable( feature = "structural_match" , issue = "31434" ) ]
1214
+ impl < A : ?Sized > StructuralPartialEq for & A where A : StructuralPartialEq { }
1215
+
1212
1216
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1213
1217
impl < A : ?Sized , B : ?Sized > PartialEq < & B > for & A
1214
1218
where
@@ -1259,11 +1263,18 @@ mod impls {
1259
1263
Ord :: cmp ( * self , * other)
1260
1264
}
1261
1265
}
1266
+
1267
+ #[ unstable( feature = "structural_match" , issue = "31434" ) ]
1268
+ impl < A : ?Sized > StructuralEq for & A where A : StructuralEq { }
1269
+
1262
1270
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1263
1271
impl < A : ?Sized > Eq for & A where A : Eq { }
1264
1272
1265
1273
// &mut pointers
1266
1274
1275
+ #[ unstable( feature = "structural_match" , issue = "31434" ) ]
1276
+ impl < A : ?Sized > StructuralPartialEq for & mut A where A : StructuralPartialEq { }
1277
+
1267
1278
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1268
1279
impl < A : ?Sized , B : ?Sized > PartialEq < & mut B > for & mut A
1269
1280
where
@@ -1314,6 +1325,10 @@ mod impls {
1314
1325
Ord :: cmp ( * self , * other)
1315
1326
}
1316
1327
}
1328
+
1329
+ #[ unstable( feature = "structural_match" , issue = "31434" ) ]
1330
+ impl < A : ?Sized > StructuralEq for & mut A where A : StructuralEq { }
1331
+
1317
1332
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1318
1333
impl < A : ?Sized > Eq for & mut A where A : Eq { }
1319
1334
0 commit comments