rustc: Add an "ne" method to the Eq trait, and implement it everywhere
This commit is contained in:
parent
ac1f84c153
commit
feb014eb3c
76 changed files with 218 additions and 60 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue