about summary refs log tree commit diff
path: root/src/libcore/unit.rs
blob: 30f1f5ab99c22e5db16d4fa4e76198dcc800d1fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*!

Functions for the unit type.

*/

use cmp::{Eq, Ord};

#[cfg(stage0)]
impl () : Eq {
    pure fn eq(&&_other: ()) -> bool { true }
    pure fn ne(&&_other: ()) -> bool { false }
}
#[cfg(stage1)]
#[cfg(stage2)]
impl () : Eq {
    pure fn eq(_other: &()) -> bool { true }
    pure fn ne(_other: &()) -> bool { false }
}

#[cfg(stage0)]
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 }
}
#[cfg(stage1)]
#[cfg(stage2)]
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 }
}