diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2012-08-27 15:44:12 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2012-08-27 15:44:44 -0700 |
| commit | 381a628c4c49d2cbfabe8a60216809d45e316704 (patch) | |
| tree | b374a2dc9137c62cd05a02c645ee0373c37c8442 /src/libcore/cmp.rs | |
| parent | 1cd97ee47dacdd96ca34847fb0a5c7e47c7fd9af (diff) | |
| download | rust-381a628c4c49d2cbfabe8a60216809d45e316704.tar.gz rust-381a628c4c49d2cbfabe8a60216809d45e316704.zip | |
libcore: Fix build harder
Diffstat (limited to 'src/libcore/cmp.rs')
| -rw-r--r-- | src/libcore/cmp.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index 0f27f4ddfb1..318ef6e630e 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -4,29 +4,37 @@ /// Interfaces used for comparison. +// Awful hack to work around duplicate lang items in core test. #[cfg(notest)] #[lang="ord"] trait Ord { pure fn lt(&&other: self) -> bool; } +#[cfg(test)] +trait Ord { + pure fn lt(&&other: self) -> bool; +} + #[cfg(notest)] #[lang="eq"] trait Eq { pure fn eq(&&other: self) -> bool; } -#[cfg(notest)] +#[cfg(test)] +trait Eq { + pure fn eq(&&other: self) -> bool; +} + pure fn lt<T: Ord>(v1: &T, v2: &T) -> bool { v1.lt(*v2) } -#[cfg(notest)] pure fn le<T: Ord Eq>(v1: &T, v2: &T) -> bool { v1.lt(*v2) || v1.eq(*v2) } -#[cfg(notest)] pure fn eq<T: Eq>(v1: &T, v2: &T) -> bool { v1.eq(*v2) } |
