Skip to content

Commit 15b4734

Browse files
committed
Remove unused Constructor: PartialEq impl
1 parent 5ad7454 commit 15b4734

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

compiler/rustc_pattern_analysis/src/constructor.rs

-42
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@
151151
use std::cmp::{self, max, min, Ordering};
152152
use std::fmt;
153153
use std::iter::once;
154-
use std::mem;
155154

156155
use smallvec::SmallVec;
157156

@@ -745,47 +744,6 @@ impl<Cx: TypeCx> fmt::Debug for Constructor<Cx> {
745744
}
746745
}
747746

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-
789747
impl<Cx: TypeCx> Constructor<Cx> {
790748
pub(crate) fn is_non_exhaustive(&self) -> bool {
791749
matches!(self, NonExhaustive)

0 commit comments

Comments
 (0)