diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2012-09-07 12:06:02 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2012-09-07 12:24:48 -0700 |
| commit | feb014eb3c3aa1ccaae1df407801dffa090499fd (patch) | |
| tree | 8ffeec6945de4843f9e0d150720596327530e00f /src/libcore/ptr.rs | |
| parent | ac1f84c153a171e641233e5d2d11404a0b520986 (diff) | |
| download | rust-feb014eb3c3aa1ccaae1df407801dffa090499fd.tar.gz rust-feb014eb3c3aa1ccaae1df407801dffa090499fd.zip | |
rustc: Add an "ne" method to the Eq trait, and implement it everywhere
Diffstat (limited to 'src/libcore/ptr.rs')
| -rw-r--r-- | src/libcore/ptr.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index c7558ffba1c..6e8a2bb3611 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -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 |
