|
151 | 151 | use std::cmp::{self, max, min, Ordering};
|
152 | 152 | use std::fmt;
|
153 | 153 | use std::iter::once;
|
154 |
| -use std::mem; |
155 | 154 |
|
156 | 155 | use smallvec::SmallVec;
|
157 | 156 |
|
@@ -745,47 +744,6 @@ impl<Cx: TypeCx> fmt::Debug for Constructor<Cx> {
|
745 | 744 | }
|
746 | 745 | }
|
747 | 746 |
|
748 |
| -impl<Cx: TypeCx> PartialEq for Constructor<Cx> { |
749 |
| - fn eq(&self, other: &Self) -> bool { |
750 |
| - (mem::discriminant(self) == mem::discriminant(other)) |
751 |
| - && match (self, other) { |
752 |
| - (Constructor::Struct, Constructor::Struct) => true, |
753 |
| - (Constructor::Variant(self_variant), Constructor::Variant(other_variant)) => { |
754 |
| - self_variant == other_variant |
755 |
| - } |
756 |
| - (Constructor::Ref, Constructor::Ref) => true, |
757 |
| - (Constructor::Slice(self_slice), Constructor::Slice(other_slice)) => { |
758 |
| - self_slice == other_slice |
759 |
| - } |
760 |
| - (Constructor::UnionField, Constructor::UnionField) => true, |
761 |
| - (Constructor::Bool(self_b), Constructor::Bool(other_b)) => self_b == other_b, |
762 |
| - (Constructor::IntRange(self_range), Constructor::IntRange(other_range)) => { |
763 |
| - self_range == other_range |
764 |
| - } |
765 |
| - ( |
766 |
| - Constructor::F32Range(self_lo, self_hi, self_end), |
767 |
| - Constructor::F32Range(other_lo, other_hi, other_end), |
768 |
| - ) => self_lo == other_lo && self_hi == other_hi && self_end == other_end, |
769 |
| - ( |
770 |
| - Constructor::F64Range(self_lo, self_hi, self_end), |
771 |
| - Constructor::F64Range(other_lo, other_hi, other_end), |
772 |
| - ) => self_lo == other_lo && self_hi == other_hi && self_end == other_end, |
773 |
| - (Constructor::Str(self_value), Constructor::Str(other_value)) => { |
774 |
| - self_value == other_value |
775 |
| - } |
776 |
| - (Constructor::Opaque(self_inner), Constructor::Opaque(other_inner)) => { |
777 |
| - self_inner == other_inner |
778 |
| - } |
779 |
| - (Constructor::Or, Constructor::Or) => true, |
780 |
| - (Constructor::Wildcard, Constructor::Wildcard) => true, |
781 |
| - (Constructor::NonExhaustive, Constructor::NonExhaustive) => true, |
782 |
| - (Constructor::Hidden, Constructor::Hidden) => true, |
783 |
| - (Constructor::Missing, Constructor::Missing) => true, |
784 |
| - _ => unreachable!(), |
785 |
| - } |
786 |
| - } |
787 |
| -} |
788 |
| - |
789 | 747 | impl<Cx: TypeCx> Constructor<Cx> {
|
790 | 748 | pub(crate) fn is_non_exhaustive(&self) -> bool {
|
791 | 749 | matches!(self, NonExhaustive)
|
|
0 commit comments