Reverted to manual implementation of PartialEq for FullInt
This commit is contained in:
parent
cf451d3bba
commit
90a6117729
@ -799,7 +799,7 @@ impl LintPass for InvalidUpcastComparisons {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
#[derive(Copy, Clone, Debug, Eq)]
|
||||||
enum FullInt {
|
enum FullInt {
|
||||||
S(i64),
|
S(i64),
|
||||||
U(u64),
|
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 {
|
impl PartialOrd for FullInt {
|
||||||
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
||||||
Some(match (self, other) {
|
Some(match (self, other) {
|
||||||
|
Loading…
Reference in New Issue
Block a user