Skip to content

Commit dfbe697

Browse files
committed
core: Fix compilation of intrinsic ops when testing
1 parent 725a73c commit dfbe697

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/libcore/core.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ mod tuple;
166166

167167
// Ubiquitous-utility-type modules
168168

169+
#[cfg(notest)]
169170
mod ops;
170171
mod cmp;
171172
mod num;

src/libcore/core.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ import float::num;
3030
import f32::num;
3131
import f64::num;
3232
import num::num;
33-
import ops::{const, copy, send, owned};
34-
import ops::{add, sub, mul, div, modulo, neg, bitand, bitor, bitxor, shl};
35-
import ops::{shr, index};
3633

3734
export path, option, some, none, unreachable;
3835
export extensions;
@@ -45,8 +42,20 @@ export immutable_copyable_vector, iter_trait_extensions, vec_concat;
4542
export base_iter, copyable_iter, extended_iter;
4643
export tuple_ops, extended_tuple_ops;
4744
export ptr;
45+
4846
// The following exports are the core operators and kinds
47+
// The compiler has special knowlege of these so we must not duplicate them
48+
// when compiling for testing
49+
#[cfg(notest)]
50+
import ops::{const, copy, send, owned};
51+
#[cfg(notest)]
52+
import ops::{add, sub, mul, div, modulo, neg, bitand, bitor, bitxor, shl};
53+
#[cfg(notest)]
54+
import ops::{shr, index};
55+
56+
#[cfg(notest)]
4957
export const, copy, send, owned;
58+
#[cfg(notest)]
5059
export add, sub, mul, div, modulo, neg, bitops, index;
5160

5261
// Export the log levels as global constants. Higher levels mean

0 commit comments

Comments
 (0)