rust/src/libcore/unit.rs
2012-11-28 12:33:00 -08:00

24 lines
507 B
Rust

/*!
Functions for the unit type.
*/
// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];
use cmp::{Eq, Ord};
impl () : Eq {
pure fn eq(&self, _other: &()) -> bool { true }
pure fn ne(&self, _other: &()) -> bool { false }
}
impl () : Ord {
pure fn lt(&self, _other: &()) -> bool { false }
pure fn le(&self, _other: &()) -> bool { true }
pure fn ge(&self, _other: &()) -> bool { true }
pure fn gt(&self, _other: &()) -> bool { false }
}