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 } +}