From 80c71c839acde882e53ee9505a05b81e4af33ab7 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Fri, 8 Mar 2013 20:05:20 -0500 Subject: [PATCH] add a TotalOrd impl for the unit type --- src/libcore/nil.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 @@ */ #[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 } +}