about summary refs log tree commit diff
path: root/src/libcore/unit.rs
blob: 27960a09b2460a3e8aab45c14f40ccd005249559 (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
37
38
39
40
41
42
43
44
45
46
47
48
/*!

Functions for the unit type.

*/

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use cmp::{Eq, Ord};

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

impl () : Ord {
    #[cfg(stage0)]
    pure fn lt(_other: &()) -> bool { false }
    #[cfg(stage1)]
    #[cfg(stage2)]
    pure fn lt(&self, _other: &()) -> bool { false }
    #[cfg(stage0)]
    pure fn le(_other: &()) -> bool { true }
    #[cfg(stage1)]
    #[cfg(stage2)]
    pure fn le(&self, _other: &()) -> bool { true }
    #[cfg(stage0)]
    pure fn ge(_other: &()) -> bool { true }
    #[cfg(stage1)]
    #[cfg(stage2)]
    pure fn ge(&self, _other: &()) -> bool { true }
    #[cfg(stage0)]
    pure fn gt(_other: &()) -> bool { false }
    #[cfg(stage1)]
    #[cfg(stage2)]
    pure fn gt(&self, _other: &()) -> bool { false }
}