Skip to content

Commit e178999

Browse files
committed
core: More magic to make core build with --test
1 parent 2df03bf commit e178999

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

src/libcore/core.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,17 @@ export add, sub, mul, div, modulo, neg, bitand, bitor, bitxor;
6060
#[cfg(notest)]
6161
export shl, shr, index;
6262

63+
#[cfg(test)]
64+
use coreops(name = "core", vers = "0.3");
65+
66+
#[cfg(test)]
67+
import coreops::ops::{const, copy, send, owned};
68+
#[cfg(test)]
69+
import coreops::ops::{add, sub, mul, div, modulo, neg, bitand, bitor, bitxor};
70+
#[cfg(test)]
71+
import coreops::ops::{shl, shr, index};
72+
73+
6374
// Export the log levels as global constants. Higher levels mean
6475
// more-verbosity. Error is the bottom level, default logging level is
6576
// warn-and-below.

src/libcore/dvec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ impl extensions<A:copy> for dvec<A> {
311311
}
312312
}
313313

314-
impl extensions<A:copy> of ops::index<uint,A> for dvec<A> {
314+
impl extensions<A:copy> of index<uint,A> for dvec<A> {
315315
pure fn index(&&idx: uint) -> A {
316316
self.get_elt(idx)
317317
}

src/libcore/str.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1918,7 +1918,8 @@ impl extensions of unique_str for ~str {
19181918
}
19191919
}
19201920

1921-
impl extensions of ops::add<&str,~str> for ~str {
1921+
#[cfg(notest)]
1922+
impl extensions of add<&str,~str> for ~str {
19221923
#[inline(always)]
19231924
pure fn add(rhs: &str) -> ~str {
19241925
append(self, rhs)

src/libcore/vec.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,8 @@ impl extensions<T: copy> of vec_concat<T> for ~[T] {
12991299
}
13001300
}
13011301

1302-
impl extensions<T: copy> of ops::add<&[const T],~[T]> for ~[T] {
1302+
#[cfg(notest)]
1303+
impl extensions<T: copy> of add<&[const T],~[T]> for ~[T] {
13031304
#[inline(always)]
13041305
pure fn add(rhs: &[const T]) -> ~[T] {
13051306
append(self, rhs)
@@ -1313,7 +1314,7 @@ impl extensions<T: copy> of vec_concat<T> for ~[mut T] {
13131314
}
13141315
}
13151316

1316-
impl extensions<T: copy> of ops::add<&[const T],~[mut T]> for ~[mut T] {
1317+
impl extensions<T: copy> of add<&[const T],~[mut T]> for ~[mut T] {
13171318
#[inline(always)]
13181319
pure fn add(rhs: &[const T]) -> ~[mut T] {
13191320
append_mut(self, rhs)

0 commit comments

Comments
 (0)