about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-08-30 10:14:54 -0700
committerPatrick Walton <pcwalton@mimiga.net>2012-08-30 10:14:54 -0700
commit45e46f5fc0e78f5855e8870a6e3eb2a0a7e5ae50 (patch)
tree51159a6eed80e917f337be24050a1c7e197bb012
parenta1c11cab2dc56483cf9fe6d25af43b2f602d5155 (diff)
downloadrust-45e46f5fc0e78f5855e8870a6e3eb2a0a7e5ae50.tar.gz
rust-45e46f5fc0e78f5855e8870a6e3eb2a0a7e5ae50.zip
libcore: Add missing unit.rs
-rw-r--r--src/libcore/unit.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libcore/unit.rs b/src/libcore/unit.rs
new file mode 100644
index 00000000000..e4ca11bbd8a
--- /dev/null
+++ b/src/libcore/unit.rs
@@ -0,0 +1,17 @@
+/**
+ * Functions for the unit type.
+ */
+
+use cmp::{Eq, Ord};
+
+impl () : Eq {
+    pure fn eq(&&_other: ()) -> bool { true }
+}
+
+impl () : Ord {
+    pure fn lt(&&_other: ()) -> bool { false }
+    pure fn le(&&_other: ()) -> bool { true }
+    pure fn ge(&&_other: ()) -> bool { true }
+    pure fn gt(&&_other: ()) -> bool { false }
+}
+