diff --git a/src/types.rs b/src/types.rs index e9b8e15303a..948e8fd063d 100644 --- a/src/types.rs +++ b/src/types.rs @@ -799,7 +799,7 @@ impl LintPass for InvalidUpcastComparisons { } } -#[derive(Copy, Clone, Debug, Eq, PartialEq)] +#[derive(Copy, Clone, Debug, Eq)] enum FullInt { S(i64), U(u64), @@ -820,6 +820,12 @@ impl FullInt { } } +impl PartialEq for FullInt { + fn eq(&self, other: &Self) -> bool { + self.partial_cmp(other).expect("partial_cmp only returns Some(_)") == Ordering::Equal + } +} + impl PartialOrd for FullInt { fn partial_cmp(&self, other: &Self) -> Option { Some(match (self, other) {