1
Fork 0

rustc: Add an "ne" method to the Eq trait, and implement it everywhere

This commit is contained in:
Patrick Walton 2012-09-07 12:06:02 -07:00
parent ac1f84c153
commit feb014eb3c
76 changed files with 218 additions and 60 deletions

View file

@ -188,6 +188,7 @@ impl<T> *const T : Eq {
let b: uint = unsafe::reinterpret_cast(&other);
return a == b;
}
pure fn ne(&&other: *const T) -> bool { !self.eq(other) }
}
// Comparison for pointers
@ -216,9 +217,8 @@ impl<T> *const T : Ord {
// Equality for region pointers
impl<T:Eq> &const T : Eq {
pure fn eq(&&other: &const T) -> bool {
return *self == *other;
}
pure fn eq(&&other: &const T) -> bool { return *self == *other; }
pure fn ne(&&other: &const T) -> bool { return *self != *other; }
}
// Comparison for region pointers