about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-03-08 20:05:20 -0500
committerDaniel Micay <danielmicay@gmail.com>2013-03-10 13:54:51 -0400
commit80c71c839acde882e53ee9505a05b81e4af33ab7 (patch)
tree4a934c419f0cb3a9d985c8055a192a519d14ae1a /src
parenteaed16cea6c83c49bfb3d4a663f9b715f86d1f37 (diff)
downloadrust-80c71c839acde882e53ee9505a05b81e4af33ab7.tar.gz
rust-80c71c839acde882e53ee9505a05b81e4af33ab7.zip
add a TotalOrd impl for the unit type
Diffstat (limited to 'src')
-rw-r--r--src/libcore/nil.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libcore/nil.rs b/src/libcore/nil.rs
index cf2af7e38cc..742e5a047d6 100644
--- a/src/libcore/nil.rs
+++ b/src/libcore/nil.rs
@@ -15,7 +15,7 @@ Functions for the unit type.
 */
 
 #[cfg(notest)]
-use cmp::{Eq, Ord};
+use cmp::{Eq, Ord, TotalOrd, Ordering, Equal};
 
 #[cfg(notest)]
 impl Eq for () {
@@ -37,3 +37,8 @@ impl Ord for () {
     pure fn gt(&self, _other: &()) -> bool { false }
 }
 
+#[cfg(notest)]
+impl TotalOrd for () {
+    #[inline(always)]
+    pure fn cmp(&self, _other: &()) -> Ordering { Equal }
+}