Skip to content

Commit cb4ab76

Browse files
committed
Adding missing imports for tests, and gate off others
1 parent bc3bee4 commit cb4ab76

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+141
-109
lines changed

src/libcore/bool.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
//! Boolean logic
1313
14-
use cmp;
1514
use option::{None, Option, Some};
15+
#[cfg(notest)] use cmp;
1616

1717
/// Negation / inverse
1818
pub pure fn not(v: bool) -> bool { !v }
@@ -80,7 +80,7 @@ impl cmp::Eq for bool {
8080
#[test]
8181
pub fn test_bool_from_str() {
8282
do all_values |v| {
83-
assert Some(v) == from_str(bool::to_str(v))
83+
assert Some(v) == from_str(to_str(v))
8484
}
8585
}
8686

src/libcore/char.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010

1111
//! Utilities for manipulating the char type
1212
13-
use cmp::Eq;
1413
use option::{None, Option, Some};
1514
use str;
1615
use u32;
1716
use uint;
1817
use unicode;
1918

19+
#[cfg(notest)] use cmp::Eq;
20+
2021
/*
2122
Lu Uppercase_Letter an uppercase letter
2223
Ll Lowercase_Letter a lowercase letter
@@ -304,8 +305,8 @@ fn test_to_digit() {
304305

305306
#[test]
306307
fn test_is_ascii() {
307-
assert str::all(~"banana", char::is_ascii);
308-
assert ! str::all(~"ประเทศไทย中华Việt Nam", char::is_ascii);
308+
assert str::all(~"banana", is_ascii);
309+
assert ! str::all(~"ประเทศไทย中华Việt Nam", is_ascii);
309310
}
310311

311312
#[test]

src/libcore/flate.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ use libc::{c_void, size_t, c_int};
1919
use ptr;
2020
use vec;
2121

22+
#[cfg(test)] use rand;
23+
2224
extern mod rustrt {
2325
unsafe fn tdefl_compress_mem_to_heap(psrc_buf: *const c_void,
2426
src_buf_len: size_t,

src/libcore/logging.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@
1010

1111
//! Logging
1212
13-
use cast::transmute;
14-
use io;
1513
use libc;
16-
use repr;
17-
use vec;
1814

1915
#[nolink]
2016
extern mod rustrt {
@@ -48,6 +44,11 @@ pub fn console_off() {
4844
#[cfg(notest)]
4945
#[lang="log_type"]
5046
pub fn log_type<T>(level: u32, object: &T) {
47+
use cast::transmute;
48+
use io;
49+
use repr;
50+
use vec;
51+
5152
let bytes = do io::with_bytes_writer |writer| {
5253
repr::write_repr(writer, object);
5354
};

src/libcore/nil.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Functions for the unit type.
1414
1515
*/
1616

17+
#[cfg(notest)]
1718
use cmp::{Eq, Ord};
1819

1920
#[cfg(notest)]

src/libcore/num/f32.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@
1111
//! Operations and constants for `f32`
1212
1313
use cmath;
14-
use cmp;
1514
use libc::{c_float, c_int};
1615
use num::NumCast;
1716
use num::strconv;
1817
use num;
19-
use ops;
2018
use option::Option;
2119
use unstable::intrinsics::floorf32;
2220
use from_str;
2321
use to_str;
2422

23+
#[cfg(notest)] use cmp;
24+
#[cfg(notest)] use ops;
25+
2526
pub use cmath::c_float_targ_consts::*;
2627

2728
macro_rules! delegate(

src/libcore/num/f64.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@
1111
//! Operations and constants for `f64`
1212
1313
use cmath;
14-
use cmp;
1514
use libc::{c_double, c_int};
1615
use num::NumCast;
1716
use num::strconv;
1817
use num;
19-
use ops;
2018
use option::Option;
2119
use unstable::intrinsics::floorf64;
2220
use to_str;
2321
use from_str;
2422

23+
#[cfg(notest)] use cmp;
24+
#[cfg(notest)] use ops;
25+
2526
pub use cmath::c_double_targ_consts::*;
2627
pub use cmp::{min, max};
2728

src/libcore/num/float.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@
2020

2121
// PORT this must match in width according to architecture
2222

23-
use cmp::{Eq, Ord};
2423
use f64;
2524
use num::NumCast;
2625
use num::strconv;
2726
use num;
28-
use ops;
2927
use option::{None, Option, Some};
3028
use to_str;
3129
use from_str;
3230

31+
#[cfg(notest)] use cmp::{Eq, Ord};
32+
#[cfg(notest)] use ops;
33+
3334
pub use f64::{add, sub, mul, div, rem, lt, le, eq, ne, ge, gt};
3435
pub use f64::logarithm;
3536
pub use f64::{acos, asin, atan2, cbrt, ceil, copysign, cosh, floor};

src/libcore/num/int-template.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
use T = self::inst::T;
1212

13-
use cmp::{Eq, Ord};
1413
use to_str::ToStr;
1514
use from_str::FromStr;
1615
use num::{ToStrRadix, FromStrRadix};

src/libcore/num/uint-template.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use T = self::inst::T;
1212
use T_SIGNED = self::inst::T_SIGNED;
1313

14-
use cmp::{Eq, Ord};
1514
use to_str::ToStr;
1615
use from_str::FromStr;
1716
use num::{ToStrRadix, FromStrRadix};
@@ -20,6 +19,8 @@ use num;
2019
use option::{None, Option, Some};
2120
use prelude::*;
2221

22+
#[cfg(notest)] use cmp::{Eq, Ord};
23+
2324
pub use cmp::{min, max};
2425

2526
pub const bits : uint = inst::bits;

0 commit comments

Comments
 (0)