Skip to content

Commit b45d30d

Browse files
committed
Fix fallout of removing import_shadowing in tests.
1 parent f95e0c2 commit b45d30d

File tree

33 files changed

+97
-116
lines changed

33 files changed

+97
-116
lines changed

src/libcollections/bench.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::prelude::*;
11+
use prelude::*;
1212
use std::rand;
1313
use std::rand::Rng;
1414
use test::Bencher;

src/libcollections/binary_heap.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,10 +617,9 @@ impl<T: Ord> Extend<T> for BinaryHeap<T> {
617617

618618
#[cfg(test)]
619619
mod tests {
620-
use std::prelude::*;
620+
use prelude::*;
621621

622622
use super::BinaryHeap;
623-
use vec::Vec;
624623

625624
#[test]
626625
fn test_iterator() {

src/libcollections/bit.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,16 +1686,15 @@ impl<'a> Iterator<uint> for TwoBitPositions<'a> {
16861686

16871687
#[cfg(test)]
16881688
mod tests {
1689-
use std::prelude::*;
1690-
use std::iter::range_step;
1689+
use prelude::*;
1690+
use core::iter::range_step;
1691+
use core::u32;
16911692
use std::rand;
16921693
use std::rand::Rng;
1693-
use std::u32;
16941694
use test::{Bencher, black_box};
16951695

16961696
use super::{Bitv, BitvSet, from_fn, from_bytes};
16971697
use bitv;
1698-
use vec::Vec;
16991698

17001699
static BENCH_BITS : uint = 1 << 14;
17011700

@@ -2038,7 +2037,7 @@ mod tests {
20382037
#[test]
20392038
fn test_from_bytes() {
20402039
let bitv = from_bytes(&[0b10110110, 0b00000000, 0b11111111]);
2041-
let str = format!("{}{}{}", "10110110", "00000000", "11111111");
2040+
let str = concat!("10110110", "00000000", "11111111");
20422041
assert_eq!(bitv.to_string(), str);
20432042
}
20442043

src/libcollections/btree/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
13351335

13361336
#[cfg(test)]
13371337
mod test {
1338-
use std::prelude::*;
1338+
use prelude::*;
13391339

13401340
use super::{BTreeMap, Occupied, Vacant};
13411341

@@ -1537,7 +1537,7 @@ mod test {
15371537

15381538
#[cfg(test)]
15391539
mod bench {
1540-
use std::prelude::*;
1540+
use prelude::*;
15411541
use std::rand::{weak_rng, Rng};
15421542
use test::{Bencher, black_box};
15431543

src/libcollections/btree/set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ impl<'a, T: Ord> Iterator<&'a T> for UnionItems<'a, T> {
726726

727727
#[cfg(test)]
728728
mod test {
729-
use std::prelude::*;
729+
use prelude::*;
730730

731731
use super::BTreeSet;
732732
use std::hash;

src/libcollections/dlist.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,14 +788,14 @@ impl<S: Writer, A: Hash<S>> Hash<S> for DList<A> {
788788

789789
#[cfg(test)]
790790
mod tests {
791-
use std::prelude::*;
791+
use prelude::*;
792792
use std::rand;
793793
use std::hash;
794+
use std::task::spawn;
794795
use test::Bencher;
795796
use test;
796797

797798
use super::{DList, Node, ListInsertion};
798-
use vec::Vec;
799799

800800
pub fn check_links<T>(list: &DList<T>) {
801801
let mut len = 0u;

src/libcollections/enum_set.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,9 @@ impl<E:CLike> Extend<E> for EnumSet<E> {
295295

296296
#[cfg(test)]
297297
mod test {
298-
use std::prelude::*;
299298
use self::Foo::*;
300-
use std::mem;
299+
use prelude::*;
300+
use core::mem;
301301

302302
use super::{EnumSet, CLike};
303303

src/libcollections/lib.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,41 @@ mod std {
9595
pub use core::kinds; // deriving(Copy)
9696
pub use core::hash; // deriving(Hash)
9797
}
98+
99+
#[cfg(test)]
100+
mod prelude {
101+
// from core.
102+
pub use core::borrow::IntoCow;
103+
pub use core::char::Char;
104+
pub use core::clone::Clone;
105+
pub use core::cmp::{PartialEq, Eq, Equiv, PartialOrd, Ord};
106+
pub use core::cmp::Ordering::{Less, Equal, Greater};
107+
pub use core::iter::range;
108+
pub use core::iter::{FromIterator, Extend, IteratorExt};
109+
pub use core::iter::{Iterator, DoubleEndedIterator, RandomAccessIterator};
110+
pub use core::iter::{IteratorCloneExt, CloneIteratorExt, DoubleEndedIteratorExt};
111+
pub use core::iter::{IteratorOrdExt, MutableDoubleEndedIterator, ExactSizeIterator};
112+
pub use core::kinds::{Copy, Send, Sized, Sync};
113+
pub use core::mem::drop;
114+
pub use core::ops::{Drop, Fn, FnMut, FnOnce};
115+
pub use core::option::Option;
116+
pub use core::option::Option::{Some, None};
117+
pub use core::ptr::RawPtr;
118+
pub use core::result::Result;
119+
pub use core::result::Result::{Ok, Err};
120+
121+
// in core and collections (may differ).
122+
pub use slice::{PartialEqSliceExt, OrdSliceExt};
123+
pub use slice::{AsSlice, SliceExt};
124+
pub use str::{from_str, Str, StrPrelude};
125+
126+
// from other crates.
127+
pub use alloc::boxed::Box;
128+
pub use unicode::char::UnicodeChar;
129+
130+
// from collections.
131+
pub use slice::{CloneSliceExt, VectorVector};
132+
pub use str::{IntoMaybeOwned, UnicodeStrPrelude, StrAllocating, StrVector};
133+
pub use string::{String, ToString};
134+
pub use vec::Vec;
135+
}

src/libcollections/ring_buf.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,18 +1260,17 @@ impl<T: fmt::Show> fmt::Show for RingBuf<T> {
12601260

12611261
#[cfg(test)]
12621262
mod tests {
1263-
use core::iter;
12641263
use self::Taggy::*;
12651264
use self::Taggypar::*;
1266-
use std::cmp;
1265+
use prelude::*;
1266+
use core::cmp;
1267+
use core::iter;
12671268
use std::fmt::Show;
1268-
use std::prelude::*;
12691269
use std::hash;
12701270
use test::Bencher;
12711271
use test;
12721272

12731273
use super::RingBuf;
1274-
use vec::Vec;
12751274

12761275
#[test]
12771276
#[allow(deprecated)]
@@ -1791,7 +1790,7 @@ mod tests {
17911790

17921791
#[test]
17931792
fn test_from_iter() {
1794-
use std::iter;
1793+
use core::iter;
17951794
let v = vec!(1i,2,3,4,5,6,7);
17961795
let deq: RingBuf<int> = v.iter().map(|&x| x).collect();
17971796
let u: Vec<int> = deq.iter().map(|&x| x).collect();

src/libcollections/slice.rs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,16 +1343,13 @@ pub mod raw {
13431343
#[cfg(test)]
13441344
mod tests {
13451345
use std::boxed::Box;
1346-
use std::cell::Cell;
1347-
use std::default::Default;
1348-
use std::mem;
1349-
use std::prelude::*;
1346+
use prelude::*;
1347+
use core::cell::Cell;
1348+
use core::default::Default;
1349+
use core::mem;
13501350
use std::rand::{Rng, task_rng};
13511351
use std::rc::Rc;
1352-
use std::rt;
1353-
use slice::*;
1354-
1355-
use vec::Vec;
1352+
use super::ElementSwaps;
13561353

13571354
fn square(n: uint) -> uint { n * n }
13581355

@@ -2764,14 +2761,12 @@ mod tests {
27642761

27652762
#[cfg(test)]
27662763
mod bench {
2767-
use std::prelude::*;
2764+
use prelude::*;
2765+
use core::mem;
2766+
use core::ptr;
27682767
use std::rand::{weak_rng, Rng};
2769-
use std::mem;
2770-
use std::ptr;
27712768
use test::{Bencher, black_box};
27722769

2773-
use vec::Vec;
2774-
27752770
#[bench]
27762771
fn iterator(b: &mut Bencher) {
27772772
// peculiar numbers to stop LLVM from optimising the summation

0 commit comments

Comments
 (0)