Reverted to manual implementation of PartialEq for FullInt

This commit is contained in:
Taylor Cramer 2016-03-28 21:52:36 -07:00 committed by mcarton
parent cf451d3bba
commit 90a6117729

View File

@ -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<Ordering> {
Some(match (self, other) {