about summary refs log tree commit diff
path: root/src/libcore/task.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-09-07 12:06:02 -0700
committerPatrick Walton <pcwalton@mimiga.net>2012-09-07 12:24:48 -0700
commitfeb014eb3c3aa1ccaae1df407801dffa090499fd (patch)
tree8ffeec6945de4843f9e0d150720596327530e00f /src/libcore/task.rs
parentac1f84c153a171e641233e5d2d11404a0b520986 (diff)
downloadrust-feb014eb3c3aa1ccaae1df407801dffa090499fd.tar.gz
rust-feb014eb3c3aa1ccaae1df407801dffa090499fd.zip
rustc: Add an "ne" method to the Eq trait, and implement it everywhere
Diffstat (limited to 'src/libcore/task.rs')
-rw-r--r--src/libcore/task.rs8
1 files changed, 5 insertions, 3 deletions
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