about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcore/cmp.rs14
-rw-r--r--src/libcore/int-template.rs20
-rw-r--r--src/libcore/uint-template.rs20
3 files changed, 27 insertions, 27 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)
 }
diff --git a/src/libcore/int-template.rs b/src/libcore/int-template.rs
index 953a7a9494d..b8d1b76908c 100644
--- a/src/libcore/int-template.rs
+++ b/src/libcore/int-template.rs
@@ -1,4 +1,5 @@
 import T = inst::T;
+import cmp::{Eq, Ord};
 import num::from_int;
 
 export min_value, max_value;
@@ -62,20 +63,15 @@ pure fn abs(i: T) -> T {
     if is_negative(i) { -i } else { i }
 }
 
-#[cfg(notest)]
-mod impls {
-    import cmp::{Eq, Ord};
-
-    impl T: Ord {
-        pure fn lt(&&other: T) -> bool {
-            return self < other;
-        }
+impl T: Ord {
+    pure fn lt(&&other: T) -> bool {
+        return self < other;
     }
+}
 
-    impl T: Eq {
-        pure fn eq(&&other: T) -> bool {
-            return self == other;
-        }
+impl T: Eq {
+    pure fn eq(&&other: T) -> bool {
+        return self == other;
     }
 }
 
diff --git a/src/libcore/uint-template.rs b/src/libcore/uint-template.rs
index 48681661ee7..1aa46e62825 100644
--- a/src/libcore/uint-template.rs
+++ b/src/libcore/uint-template.rs
@@ -1,4 +1,5 @@
 import T = inst::T;
+import cmp::{Eq, Ord};
 
 export min_value, max_value;
 export min, max;
@@ -55,20 +56,15 @@ pure fn compl(i: T) -> T {
     max_value ^ i
 }
 
-#[cfg(notest)]
-mod impls {
-    import cmp::{Eq, Ord};
-
-    impl T: Ord {
-        pure fn lt(&&other: T) -> bool {
-            return self < other;
-        }
+impl T: Ord {
+    pure fn lt(&&other: T) -> bool {
+        return self < other;
     }
+}
 
-    impl T: Eq {
-        pure fn eq(&&other: T) -> bool {
-            return self == other;
-        }
+impl T: Eq {
+    pure fn eq(&&other: T) -> bool {
+        return self == other;
     }
 }