rust/src/libcore/unit.rs

25 lines
465 B
Rust
Raw Normal View History

/*!
Functions for the unit type.
*/
2012-08-30 12:14:54 -05:00
2012-09-25 14:04:02 -05:00
// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];
2012-08-30 12:14:54 -05:00
use cmp::{Eq, Ord};
impl () : Eq {
pure fn eq(_other: &()) -> bool { true }
pure fn ne(_other: &()) -> bool { false }
}
2012-08-30 12:14:54 -05:00
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 }
}
2012-08-30 12:14:54 -05:00