@@ -876,7 +876,7 @@ impl ::core::cmp::PartialEq for Enum1 {
876
876
fn eq(&self, other: &Enum1) -> bool {
877
877
match (self, other) {
878
878
(Enum1::Single { x: __self_0 }, Enum1::Single { x: __arg1_0 }) =>
879
- * __self_0 == * __arg1_0,
879
+ __self_0 == __arg1_0,
880
880
}
881
881
}
882
882
}
@@ -1119,10 +1119,10 @@ impl ::core::cmp::PartialEq for Mixed {
1119
1119
__self_discr == __arg1_discr &&
1120
1120
match (self, other) {
1121
1121
(Mixed::R(__self_0), Mixed::R(__arg1_0)) =>
1122
- * __self_0 == * __arg1_0,
1122
+ __self_0 == __arg1_0,
1123
1123
(Mixed::S { d1: __self_0, d2: __self_1 }, Mixed::S {
1124
1124
d1: __arg1_0, d2: __arg1_1 }) =>
1125
- * __self_0 == * __arg1_0 && * __self_1 == * __arg1_1,
1125
+ __self_0 == __arg1_0 && __self_1 == __arg1_1,
1126
1126
_ => true,
1127
1127
}
1128
1128
}
@@ -1245,11 +1245,11 @@ impl ::core::cmp::PartialEq for Fielded {
1245
1245
__self_discr == __arg1_discr &&
1246
1246
match (self, other) {
1247
1247
(Fielded::X(__self_0), Fielded::X(__arg1_0)) =>
1248
- * __self_0 == * __arg1_0,
1248
+ __self_0 == __arg1_0,
1249
1249
(Fielded::Y(__self_0), Fielded::Y(__arg1_0)) =>
1250
- * __self_0 == * __arg1_0,
1250
+ __self_0 == __arg1_0,
1251
1251
(Fielded::Z(__self_0), Fielded::Z(__arg1_0)) =>
1252
- * __self_0 == * __arg1_0,
1252
+ __self_0 == __arg1_0,
1253
1253
_ => unsafe { ::core::intrinsics::unreachable() }
1254
1254
}
1255
1255
}
@@ -1368,9 +1368,9 @@ impl<T: ::core::cmp::PartialEq, U: ::core::cmp::PartialEq>
1368
1368
__self_discr == __arg1_discr &&
1369
1369
match (self, other) {
1370
1370
(EnumGeneric::One(__self_0), EnumGeneric::One(__arg1_0)) =>
1371
- * __self_0 == * __arg1_0,
1371
+ __self_0 == __arg1_0,
1372
1372
(EnumGeneric::Two(__self_0), EnumGeneric::Two(__arg1_0)) =>
1373
- * __self_0 == * __arg1_0,
1373
+ __self_0 == __arg1_0,
1374
1374
_ => unsafe { ::core::intrinsics::unreachable() }
1375
1375
}
1376
1376
}
@@ -1426,6 +1426,30 @@ impl<T: ::core::cmp::Ord, U: ::core::cmp::Ord> ::core::cmp::Ord for
1426
1426
}
1427
1427
}
1428
1428
1429
+ // An enum that has variant, which does't implement `Copy`.
1430
+ enum NonCopyEnum {
1431
+
1432
+ // The `dyn NonCopyTrait` implements `PartialEq`, but it doesn't require `Copy`.
1433
+ // So we cannot generate `PartialEq` with dereference.
1434
+ NonCopyField(Box<dyn NonCopyTrait>),
1435
+ }
1436
+ #[automatically_derived]
1437
+ impl ::core::marker::StructuralPartialEq for NonCopyEnum { }
1438
+ #[automatically_derived]
1439
+ impl ::core::cmp::PartialEq for NonCopyEnum {
1440
+ #[inline]
1441
+ fn eq(&self, other: &NonCopyEnum) -> bool {
1442
+ match (self, other) {
1443
+ (NonCopyEnum::NonCopyField(__self_0),
1444
+ NonCopyEnum::NonCopyField(__arg1_0)) => __self_0 == __arg1_0,
1445
+ }
1446
+ }
1447
+ }
1448
+ trait NonCopyTrait {}
1449
+ impl PartialEq for dyn NonCopyTrait {
1450
+ fn eq(&self, _other: &Self) -> bool { true }
1451
+ }
1452
+
1429
1453
// A union. Most builtin traits are not derivable for unions.
1430
1454
pub union Union {
1431
1455
pub b: bool,
0 commit comments