From e178999833b9b484c3a5defcccfee2ed7f57e7d9 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sat, 28 Jul 2012 16:05:38 -0700 Subject: core: More magic to make core build with --test --- src/libcore/core.rs | 11 +++++++++++ src/libcore/dvec.rs | 2 +- src/libcore/str.rs | 3 ++- src/libcore/vec.rs | 5 +++-- 4 files changed, 17 insertions(+), 4 deletions(-) (limited to 'src/libcore') diff --git a/src/libcore/core.rs b/src/libcore/core.rs index f015db98328..448f800f566 100644 --- a/src/libcore/core.rs +++ b/src/libcore/core.rs @@ -60,6 +60,17 @@ export add, sub, mul, div, modulo, neg, bitand, bitor, bitxor; #[cfg(notest)] export shl, shr, index; +#[cfg(test)] +use coreops(name = "core", vers = "0.3"); + +#[cfg(test)] +import coreops::ops::{const, copy, send, owned}; +#[cfg(test)] +import coreops::ops::{add, sub, mul, div, modulo, neg, bitand, bitor, bitxor}; +#[cfg(test)] +import coreops::ops::{shl, shr, index}; + + // Export the log levels as global constants. Higher levels mean // more-verbosity. Error is the bottom level, default logging level is // warn-and-below. diff --git a/src/libcore/dvec.rs b/src/libcore/dvec.rs index 1a1aeeadeb6..838eeee7dc4 100644 --- a/src/libcore/dvec.rs +++ b/src/libcore/dvec.rs @@ -311,7 +311,7 @@ impl extensions for dvec { } } -impl extensions of ops::index for dvec { +impl extensions of index for dvec { pure fn index(&&idx: uint) -> A { self.get_elt(idx) } diff --git a/src/libcore/str.rs b/src/libcore/str.rs index c56af8442f6..85de50c5a0f 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -1918,7 +1918,8 @@ impl extensions of unique_str for ~str { } } -impl extensions of ops::add<&str,~str> for ~str { +#[cfg(notest)] +impl extensions of add<&str,~str> for ~str { #[inline(always)] pure fn add(rhs: &str) -> ~str { append(self, rhs) diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs index a97c8f8601a..9698e229d20 100644 --- a/src/libcore/vec.rs +++ b/src/libcore/vec.rs @@ -1299,7 +1299,8 @@ impl extensions of vec_concat for ~[T] { } } -impl extensions of ops::add<&[const T],~[T]> for ~[T] { +#[cfg(notest)] +impl extensions of add<&[const T],~[T]> for ~[T] { #[inline(always)] pure fn add(rhs: &[const T]) -> ~[T] { append(self, rhs) @@ -1313,7 +1314,7 @@ impl extensions of vec_concat for ~[mut T] { } } -impl extensions of ops::add<&[const T],~[mut T]> for ~[mut T] { +impl extensions of add<&[const T],~[mut T]> for ~[mut T] { #[inline(always)] pure fn add(rhs: &[const T]) -> ~[mut T] { append_mut(self, rhs) -- cgit 1.4.1-3-g733a5