diff --git a/tests/ord_struct.rs b/tests/ord_struct.rs index aeedfcf..59d077b 100644 --- a/tests/ord_struct.rs +++ b/tests/ord_struct.rs @@ -536,14 +536,21 @@ fn bound_4() { let phantom = PhantomData::; #[derive(Educe)] - #[educe(Ord, PartialEq)] + #[educe(Ord)] struct Struct { f1: T, // PhantomData is Eq (all PhantomData are equal to all others) f2: PhantomData, } + impl PartialEq for Struct { + fn eq(&self, other: &Struct) -> bool { + self.f1.eq(&other.f1) + } + } + impl Eq for Struct {} + impl PartialOrd for Struct { fn partial_cmp(&self, other: &Struct) -> Option { self.f1.partial_cmp(&other.f1) @@ -551,10 +558,17 @@ fn bound_4() { } #[derive(Educe)] - #[educe(Ord, PartialEq)] + #[educe(Ord)] struct Tuple(T, PhantomData); + impl PartialEq for Tuple { + fn eq(&self, other: &Tuple) -> bool { + self.0.eq(&other.0) + } + } + impl Eq for Tuple {} + impl PartialOrd for Tuple { fn partial_cmp(&self, other: &Tuple) -> Option { self.0.partial_cmp(&other.0)