From feb014eb3c3aa1ccaae1df407801dffa090499fd Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 7 Sep 2012 12:06:02 -0700 Subject: rustc: Add an "ne" method to the Eq trait, and implement it everywhere --- src/libcore/task.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/libcore/task.rs') diff --git a/src/libcore/task.rs b/src/libcore/task.rs index 04197506d5d..f4514ecd367 100644 --- a/src/libcore/task.rs +++ b/src/libcore/task.rs @@ -85,9 +85,8 @@ enum Task { } impl Task : cmp::Eq { - pure fn eq(&&other: Task) -> bool { - *self == *other - } + pure fn eq(&&other: Task) -> bool { *self == *other } + pure fn ne(&&other: Task) -> bool { !self.eq(other) } } /** @@ -113,6 +112,7 @@ impl TaskResult: Eq { (Success, _) | (Failure, _) => false } } + pure fn ne(&&other: TaskResult) -> bool { !self.eq(other) } } /// A message type for notifying of task lifecycle events @@ -131,6 +131,7 @@ impl Notification : cmp::Eq { } } } + pure fn ne(&&other: Notification) -> bool { !self.eq(other) } } /// Scheduler modes @@ -1324,6 +1325,7 @@ impl LocalData: Eq { let ptr_b: (uint, uint) = unsafe::reinterpret_cast(&other); return ptr_a == ptr_b; } + pure fn ne(&&other: LocalData) -> bool { !self.eq(other) } } // We use dvec because it's the best data structure in core. If TLS is used -- cgit 1.4.1-3-g733a5