Fallout from the libcollections movement
This commit is contained in:
parent
6a585375a0
commit
760b93adc0
@ -2058,8 +2058,7 @@ illegal to copy and pass by value.
|
||||
Generic `type`, `struct`, and `enum` declarations follow the same pattern:
|
||||
|
||||
~~~~
|
||||
extern crate collections;
|
||||
type Set<T> = collections::HashMap<T, ()>;
|
||||
type Set<T> = std::collections::HashMap<T, ()>;
|
||||
|
||||
struct Stack<T> {
|
||||
elements: Vec<T>
|
||||
|
@ -28,8 +28,6 @@
|
||||
html_root_url = "http://doc.rust-lang.org/")]
|
||||
#![allow(missing_doc)]
|
||||
|
||||
extern crate collections;
|
||||
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::cmp;
|
||||
use std::intrinsics::{TyDesc, get_tydesc};
|
||||
|
@ -19,7 +19,6 @@ use core::ops;
|
||||
use core::slice;
|
||||
use core::uint;
|
||||
|
||||
use string::String;
|
||||
use vec::Vec;
|
||||
|
||||
#[deriving(Clone)]
|
||||
@ -980,26 +979,26 @@ impl<'a> Iterator<uint> for BitPositions<'a> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
extern crate test;
|
||||
use self::test::Bencher;
|
||||
use std::prelude::*;
|
||||
use std::uint;
|
||||
use std::rand;
|
||||
use std::rand::Rng;
|
||||
use test::Bencher;
|
||||
|
||||
use bitv::{Bitv, SmallBitv, BigBitv, BitvSet, from_bools, from_fn,
|
||||
from_bytes};
|
||||
use bitv;
|
||||
|
||||
use std::uint;
|
||||
use std::rand;
|
||||
use std::rand::Rng;
|
||||
use vec::Vec;
|
||||
|
||||
static BENCH_BITS : uint = 1 << 14;
|
||||
|
||||
#[test]
|
||||
fn test_to_str() {
|
||||
let zerolen = Bitv::new(0u, false);
|
||||
assert_eq!(zerolen.to_str(), "".to_string());
|
||||
assert_eq!(zerolen.to_str().as_slice(), "");
|
||||
|
||||
let eightbits = Bitv::new(8u, false);
|
||||
assert_eq!(eightbits.to_str(), "00000000".to_string());
|
||||
assert_eq!(eightbits.to_str().as_slice(), "00000000")
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -1022,7 +1021,7 @@ mod tests {
|
||||
let mut b = bitv::Bitv::new(2, false);
|
||||
b.set(0, true);
|
||||
b.set(1, false);
|
||||
assert_eq!(b.to_str(), "10".to_string());
|
||||
assert_eq!(b.to_str().as_slice(), "10");
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -1333,7 +1332,7 @@ mod tests {
|
||||
fn test_from_bytes() {
|
||||
let bitv = from_bytes([0b10110110, 0b00000000, 0b11111111]);
|
||||
let str = format!("{}{}{}", "10110110", "00000000", "11111111");
|
||||
assert_eq!(bitv.to_str(), str);
|
||||
assert_eq!(bitv.to_str().as_slice(), str.as_slice());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -1350,8 +1349,8 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_from_bools() {
|
||||
assert!(from_bools([true, false, true, true]).to_str() ==
|
||||
"1011".to_string());
|
||||
assert!(from_bools([true, false, true, true]).to_str().as_slice() ==
|
||||
"1011");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -777,6 +777,7 @@ impl<K: fmt::Show + Ord, V: fmt::Show> fmt::Show for BranchElt<K, V> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_btree {
|
||||
use std::prelude::*;
|
||||
|
||||
use super::{BTree, Node, LeafElt};
|
||||
|
||||
|
@ -41,11 +41,10 @@ pub trait Deque<T> : Mutable {
|
||||
|
||||
#[cfg(test)]
|
||||
pub mod bench {
|
||||
extern crate test;
|
||||
use self::test::Bencher;
|
||||
use std::container::MutableMap;
|
||||
use std::prelude::*;
|
||||
use std::rand;
|
||||
use std::rand::Rng;
|
||||
use test::Bencher;
|
||||
|
||||
pub fn insert_rand_n<M:MutableMap<uint,uint>>(n: uint,
|
||||
map: &mut M,
|
||||
|
@ -610,11 +610,14 @@ impl<A: Clone> Clone for DList<A> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
extern crate test;
|
||||
use self::test::Bencher;
|
||||
use deque::Deque;
|
||||
use std::prelude::*;
|
||||
use std::rand;
|
||||
use test::Bencher;
|
||||
use test;
|
||||
|
||||
use deque::Deque;
|
||||
use super::{DList, Node, ListInsertion};
|
||||
use vec::Vec;
|
||||
|
||||
pub fn check_links<T>(list: &DList<T>) {
|
||||
let mut len = 0u;
|
||||
|
@ -138,7 +138,7 @@ impl<E:CLike> Iterator<E> for Items<E> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
|
||||
use std::prelude::*;
|
||||
use std::mem;
|
||||
|
||||
use enum_set::{EnumSet, CLike};
|
||||
|
@ -68,6 +68,7 @@ use core::prelude::*;
|
||||
use alloc::owned::Box;
|
||||
use alloc::rc::Rc;
|
||||
use core::intrinsics::TypeId;
|
||||
use core::mem;
|
||||
|
||||
use vec::Vec;
|
||||
|
||||
@ -97,14 +98,16 @@ pub trait Writer {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fn id<T>(t: T) -> T { t }
|
||||
|
||||
macro_rules! impl_hash(
|
||||
( $($ty:ident)* ) => (
|
||||
( $($ty:ident, $uty:ident, $f:path;)* ) => (
|
||||
$(
|
||||
impl<S: Writer> Hash<S> for $ty {
|
||||
#[inline]
|
||||
fn hash(&self, state: &mut S) {
|
||||
let a: [u8, ..::core::$ty::BYTES] = unsafe {
|
||||
::core::mem::transmute(*self)
|
||||
mem::transmute($f(*self as $uty) as $ty)
|
||||
};
|
||||
state.write(a.as_slice())
|
||||
}
|
||||
@ -113,7 +116,28 @@ macro_rules! impl_hash(
|
||||
)
|
||||
)
|
||||
|
||||
impl_hash!( u8 u16 u32 u64 uint i8 i16 i32 i64 int )
|
||||
impl_hash!(
|
||||
u8, u8, id;
|
||||
u16, u16, mem::to_le16;
|
||||
u32, u32, mem::to_le32;
|
||||
u64, u64, mem::to_le64;
|
||||
i8, u8, id;
|
||||
i16, u16, mem::to_le16;
|
||||
i32, u32, mem::to_le32;
|
||||
i64, u64, mem::to_le64;
|
||||
)
|
||||
|
||||
#[cfg(target_word_size = "32")]
|
||||
impl_hash!(
|
||||
uint, u32, mem::to_le32;
|
||||
int, u32, mem::to_le32;
|
||||
)
|
||||
|
||||
#[cfg(target_word_size = "64")]
|
||||
impl_hash!(
|
||||
uint, u64, mem::to_le64;
|
||||
int, u64, mem::to_le64;
|
||||
)
|
||||
|
||||
impl<S: Writer> Hash<S> for bool {
|
||||
#[inline]
|
||||
@ -292,14 +316,11 @@ impl<S: Writer, T: Hash<S>, U: Hash<S>> Hash<S> for Result<T, U> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use mem;
|
||||
use io::{IoResult, Writer};
|
||||
use iter::{Iterator};
|
||||
use option::{Some, None};
|
||||
use result::Ok;
|
||||
use slice::ImmutableVector;
|
||||
use std::prelude::*;
|
||||
use std::mem;
|
||||
|
||||
use super::{Hash, Hasher};
|
||||
use slice::ImmutableVector;
|
||||
use super::{Hash, Hasher, Writer};
|
||||
|
||||
struct MyWriterHasher;
|
||||
|
||||
@ -317,11 +338,10 @@ mod tests {
|
||||
|
||||
impl Writer for MyWriter {
|
||||
// Most things we'll just add up the bytes.
|
||||
fn write(&mut self, buf: &[u8]) -> IoResult<()> {
|
||||
fn write(&mut self, buf: &[u8]) {
|
||||
for byte in buf.iter() {
|
||||
self.hash += *byte as u64;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -269,16 +269,15 @@ pub fn hash_with_keys<T: Hash<SipState>>(k0: u64, k1: u64, value: &T) -> u64 {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
extern crate test;
|
||||
use prelude::*;
|
||||
use num::ToStrRadix;
|
||||
use option::{Some, None};
|
||||
use test::Bencher;
|
||||
use std::prelude::*;
|
||||
use std::num::ToStrRadix;
|
||||
|
||||
use str::Str;
|
||||
use string::String;
|
||||
use slice::{Vector, ImmutableVector};
|
||||
use self::test::Bencher;
|
||||
|
||||
use super::super::Hash;
|
||||
use super::super::{Hash, Writer};
|
||||
use super::{SipState, hash, hash_with_keys};
|
||||
|
||||
// Hash just the bytes of the slice, without length prefix
|
||||
@ -399,7 +398,7 @@ mod tests {
|
||||
}
|
||||
|
||||
while t < 64 {
|
||||
debug!("siphash test {}", t);
|
||||
debug!("siphash test {}: {}", t, buf);
|
||||
let vec = u8to64_le!(vecs[t], 0);
|
||||
let out = hash_with_keys(k0, k1, &Bytes(buf.as_slice()));
|
||||
debug!("got {:?}, expected {:?}", out, vec);
|
||||
@ -412,10 +411,14 @@ mod tests {
|
||||
let v = to_hex_str(&vecs[t]);
|
||||
debug!("{}: ({}) => inc={} full={}", t, v, i, f);
|
||||
|
||||
assert!(f == i && f == v);
|
||||
debug!("full state {:?}", state_full);
|
||||
debug!("inc state {:?}", state_inc);
|
||||
|
||||
assert_eq!(f, i);
|
||||
assert_eq!(f, v);
|
||||
|
||||
buf.push(t as u8);
|
||||
state_inc.write_u8(t as u8);
|
||||
state_inc.write([t as u8]);
|
||||
|
||||
t += 1;
|
||||
}
|
||||
@ -542,21 +545,4 @@ officia deserunt mollit anim id est laborum.";
|
||||
assert_eq!(hash(&u), 5254097107239593357);
|
||||
})
|
||||
}
|
||||
|
||||
#[deriving(Hash)]
|
||||
struct Compound {
|
||||
x: u8,
|
||||
y: u64,
|
||||
}
|
||||
|
||||
#[bench]
|
||||
fn bench_compound_1(b: &mut Bencher) {
|
||||
let compound = Compound {
|
||||
x: 1,
|
||||
y: 2,
|
||||
};
|
||||
b.iter(|| {
|
||||
assert_eq!(hash(&compound), 12506681940457338191);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -26,8 +26,9 @@
|
||||
extern crate alloc;
|
||||
|
||||
#[cfg(test)] extern crate native;
|
||||
#[cfg(test)] extern crate std;
|
||||
#[cfg(test)] extern crate test;
|
||||
#[cfg(test)] extern crate debug;
|
||||
#[cfg(test)] #[phase(syntax, link)] extern crate std;
|
||||
#[cfg(test)] #[phase(syntax, link)] extern crate log;
|
||||
|
||||
pub use bitv::{Bitv, BitvSet};
|
||||
@ -66,10 +67,11 @@ mod unicode;
|
||||
fn expect<T>(a: core::option::Option<T>, b: &str) -> T {
|
||||
match a {
|
||||
core::option::Some(a) => a,
|
||||
core::option::None => fail!(b),
|
||||
core::option::None => fail!("{}", b),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
mod std {
|
||||
pub use core::fmt; // necessary for fail!()
|
||||
pub use core::option; // necessary for fail!()
|
||||
|
@ -14,7 +14,8 @@
|
||||
|
||||
use core::prelude::*;
|
||||
|
||||
use core::mem::{overwrite, zeroed, replace, swap};
|
||||
use core::mem::{zeroed, replace, swap};
|
||||
use core::ptr;
|
||||
|
||||
use slice;
|
||||
use vec::Vec;
|
||||
@ -240,7 +241,10 @@ impl<T: Ord> Extendable<T> for PriorityQueue<T> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::prelude::*;
|
||||
|
||||
use priority_queue::PriorityQueue;
|
||||
use vec::Vec;
|
||||
|
||||
#[test]
|
||||
fn test_iterator() {
|
||||
@ -344,8 +348,8 @@ mod tests {
|
||||
v.sort();
|
||||
data.sort();
|
||||
|
||||
assert_eq!(v, data);
|
||||
assert_eq!(heap.into_sorted_vec(), data);
|
||||
assert_eq!(v.as_slice(), data.as_slice());
|
||||
assert_eq!(heap.into_sorted_vec().as_slice(), data.as_slice());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -410,13 +410,14 @@ impl<T: fmt::Show> fmt::Show for RingBuf<T> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
extern crate test;
|
||||
use self::test::Bencher;
|
||||
use deque::Deque;
|
||||
use std::clone::Clone;
|
||||
use std::cmp::PartialEq;
|
||||
use std::fmt::Show;
|
||||
use std::prelude::*;
|
||||
use test::Bencher;
|
||||
use test;
|
||||
|
||||
use deque::Deque;
|
||||
use super::RingBuf;
|
||||
use vec::Vec;
|
||||
|
||||
#[test]
|
||||
fn test_simple() {
|
||||
|
@ -292,6 +292,7 @@ impl<'a, T: Clone> CloneableVector<T> for &'a [T] {
|
||||
fn to_owned(&self) -> ~[T] {
|
||||
use RawVec = core::raw::Vec;
|
||||
use core::num::{CheckedAdd, CheckedMul};
|
||||
use core::ptr;
|
||||
|
||||
let len = self.len();
|
||||
let data_size = len.checked_mul(&mem::size_of::<T>());
|
||||
@ -317,7 +318,7 @@ impl<'a, T: Clone> CloneableVector<T> for &'a [T] {
|
||||
try_finally(
|
||||
&mut i, (),
|
||||
|i, ()| while *i < len {
|
||||
mem::overwrite(
|
||||
ptr::write(
|
||||
&mut(*p.offset(*i as int)),
|
||||
self.unsafe_ref(*i).clone());
|
||||
*i += 1;
|
||||
@ -855,13 +856,17 @@ impl<T> Drop for MoveItems<T> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::*;
|
||||
use cmp::*;
|
||||
use mem;
|
||||
use owned::Box;
|
||||
use rand::{Rng, task_rng};
|
||||
use std::cell::Cell;
|
||||
use std::default::Default;
|
||||
use std::mem;
|
||||
use std::prelude::*;
|
||||
use std::rand::{Rng, task_rng};
|
||||
use std::rc::Rc;
|
||||
use std::unstable;
|
||||
use slice::*;
|
||||
|
||||
use vec::Vec;
|
||||
|
||||
fn square(n: uint) -> uint { n * n }
|
||||
|
||||
fn is_odd(n: &uint) -> bool { *n % 2u == 1u }
|
||||
@ -1099,9 +1104,9 @@ mod tests {
|
||||
#[test]
|
||||
fn test_swap_remove_noncopyable() {
|
||||
// Tests that we don't accidentally run destructors twice.
|
||||
let mut v = vec![::unstable::sync::Exclusive::new(()),
|
||||
::unstable::sync::Exclusive::new(()),
|
||||
::unstable::sync::Exclusive::new(())];
|
||||
let mut v = vec![unstable::sync::Exclusive::new(()),
|
||||
unstable::sync::Exclusive::new(()),
|
||||
unstable::sync::Exclusive::new(())];
|
||||
let mut _e = v.swap_remove(0);
|
||||
assert_eq!(v.len(), 2);
|
||||
_e = v.swap_remove(1);
|
||||
@ -1438,8 +1443,6 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_sort() {
|
||||
use realstd::slice::Vector;
|
||||
use realstd::clone::Clone;
|
||||
for len in range(4u, 25) {
|
||||
for _ in range(0, 100) {
|
||||
let mut v = task_rng().gen_iter::<uint>().take(len)
|
||||
@ -1632,8 +1635,6 @@ mod tests {
|
||||
#[test]
|
||||
#[should_fail]
|
||||
fn test_from_elem_fail() {
|
||||
use cell::Cell;
|
||||
use rc::Rc;
|
||||
|
||||
struct S {
|
||||
f: Cell<int>,
|
||||
@ -1655,7 +1656,6 @@ mod tests {
|
||||
#[test]
|
||||
#[should_fail]
|
||||
fn test_grow_fn_fail() {
|
||||
use rc::Rc;
|
||||
let mut v = vec![];
|
||||
v.grow_fn(100, |i| {
|
||||
if i == 50 {
|
||||
@ -1668,7 +1668,6 @@ mod tests {
|
||||
#[test]
|
||||
#[should_fail]
|
||||
fn test_permute_fail() {
|
||||
use rc::Rc;
|
||||
let v = [(box 0, Rc::new(0)), (box 0, Rc::new(0)),
|
||||
(box 0, Rc::new(0)), (box 0, Rc::new(0))];
|
||||
let mut i = 0;
|
||||
@ -1701,7 +1700,6 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_iterator() {
|
||||
use iter::*;
|
||||
let xs = [1, 2, 5, 10, 11];
|
||||
let mut it = xs.iter();
|
||||
assert_eq!(it.size_hint(), (5, Some(5)));
|
||||
@ -1720,7 +1718,6 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_random_access_iterator() {
|
||||
use iter::*;
|
||||
let xs = [1, 2, 5, 10, 11];
|
||||
let mut it = xs.iter();
|
||||
|
||||
@ -1759,7 +1756,6 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_iter_size_hints() {
|
||||
use iter::*;
|
||||
let mut xs = [1, 2, 5, 10, 11];
|
||||
assert_eq!(xs.iter().size_hint(), (5, Some(5)));
|
||||
assert_eq!(xs.mut_iter().size_hint(), (5, Some(5)));
|
||||
@ -1778,7 +1774,6 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_mut_iterator() {
|
||||
use iter::*;
|
||||
let mut xs = [1, 2, 3, 4, 5];
|
||||
for x in xs.mut_iter() {
|
||||
*x += 1;
|
||||
@ -1788,7 +1783,6 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_rev_iterator() {
|
||||
use iter::*;
|
||||
|
||||
let xs = [1, 2, 5, 10, 11];
|
||||
let ys = [11, 10, 5, 2, 1];
|
||||
@ -1802,7 +1796,6 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_mut_rev_iterator() {
|
||||
use iter::*;
|
||||
let mut xs = [1u, 2, 3, 4, 5];
|
||||
for (i,x) in xs.mut_iter().rev().enumerate() {
|
||||
*x += i;
|
||||
@ -1812,14 +1805,12 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_move_iterator() {
|
||||
use iter::*;
|
||||
let xs = box [1u,2,3,4,5];
|
||||
assert_eq!(xs.move_iter().fold(0, |a: uint, b: uint| 10*a + b), 12345);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_move_rev_iterator() {
|
||||
use iter::*;
|
||||
let xs = box [1u,2,3,4,5];
|
||||
assert_eq!(xs.move_iter().rev().fold(0, |a: uint, b: uint| 10*a + b), 54321);
|
||||
}
|
||||
@ -1995,7 +1986,6 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_vec_default() {
|
||||
use default::Default;
|
||||
macro_rules! t (
|
||||
($ty:ty) => {{
|
||||
let v: $ty = Default::default();
|
||||
@ -2030,7 +2020,6 @@ mod tests {
|
||||
#[test]
|
||||
#[should_fail]
|
||||
fn test_overflow_does_not_cause_segfault_managed() {
|
||||
use rc::Rc;
|
||||
let mut v = vec![Rc::new(1)];
|
||||
v.reserve_exact(-1);
|
||||
v.push(Rc::new(2));
|
||||
@ -2258,12 +2247,13 @@ mod tests {
|
||||
|
||||
#[cfg(test)]
|
||||
mod bench {
|
||||
extern crate test;
|
||||
use self::test::Bencher;
|
||||
use mem;
|
||||
use prelude::*;
|
||||
use ptr;
|
||||
use rand::{weak_rng, Rng};
|
||||
use std::prelude::*;
|
||||
use std::rand::{weak_rng, Rng};
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
use test::Bencher;
|
||||
|
||||
use vec::Vec;
|
||||
|
||||
#[bench]
|
||||
fn iterator(b: &mut Bencher) {
|
||||
|
@ -249,6 +249,7 @@ double_ended_iterator!(impl MutEntries -> (uint, &'a mut T), get_mut_ref)
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_map {
|
||||
use std::prelude::*;
|
||||
|
||||
use super::SmallIntMap;
|
||||
|
||||
|
@ -77,7 +77,6 @@ use core::iter::AdditiveIterator;
|
||||
use core::mem;
|
||||
|
||||
use hash;
|
||||
use slice::CloneableVector;
|
||||
use string::String;
|
||||
use vec::Vec;
|
||||
|
||||
@ -917,11 +916,13 @@ impl OwnedStr for String {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use iter::AdditiveIterator;
|
||||
use default::Default;
|
||||
use prelude::*;
|
||||
use std::prelude::*;
|
||||
use std::iter::AdditiveIterator;
|
||||
use std::default::Default;
|
||||
|
||||
use str::*;
|
||||
use string::String;
|
||||
use vec::Vec;
|
||||
|
||||
#[test]
|
||||
fn test_eq_slice() {
|
||||
@ -1042,7 +1043,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_concat() {
|
||||
fn t(v: &[String], s: &str) {
|
||||
assert_eq!(v.concat(), s.to_str().into_string());
|
||||
assert_eq!(v.concat().as_slice(), s);
|
||||
}
|
||||
t(["you".to_string(), "know".to_string(), "I'm".to_string(),
|
||||
"no".to_string(), "good".to_string()], "youknowI'mnogood");
|
||||
@ -1054,7 +1055,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_connect() {
|
||||
fn t(v: &[String], sep: &str, s: &str) {
|
||||
assert_eq!(v.connect(sep), s.to_str().into_string());
|
||||
assert_eq!(v.connect(sep).as_slice(), s);
|
||||
}
|
||||
t(["you".to_string(), "know".to_string(), "I'm".to_string(),
|
||||
"no".to_string(), "good".to_string()],
|
||||
@ -1067,7 +1068,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_concat_slices() {
|
||||
fn t(v: &[&str], s: &str) {
|
||||
assert_eq!(v.concat(), s.to_str().into_string());
|
||||
assert_eq!(v.concat().as_slice(), s);
|
||||
}
|
||||
t(["you", "know", "I'm", "no", "good"], "youknowI'mnogood");
|
||||
let v: &[&str] = [];
|
||||
@ -1078,7 +1079,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_connect_slices() {
|
||||
fn t(v: &[&str], sep: &str, s: &str) {
|
||||
assert_eq!(v.connect(sep), s.to_str().into_string());
|
||||
assert_eq!(v.connect(sep).as_slice(), s);
|
||||
}
|
||||
t(["you", "know", "I'm", "no", "good"],
|
||||
" ", "you know I'm no good");
|
||||
@ -1753,7 +1754,6 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_iterator() {
|
||||
use iter::*;
|
||||
let s = "ศไทย中华Việt Nam";
|
||||
let v = box ['ศ','ไ','ท','ย','中','华','V','i','ệ','t',' ','N','a','m'];
|
||||
|
||||
@ -1769,7 +1769,6 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_rev_iterator() {
|
||||
use iter::*;
|
||||
let s = "ศไทย中华Việt Nam";
|
||||
let v = box ['m', 'a', 'N', ' ', 't', 'ệ','i','V','华','中','ย','ท','ไ','ศ'];
|
||||
|
||||
@ -1825,7 +1824,6 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_char_indicesator() {
|
||||
use iter::*;
|
||||
let s = "ศไทย中华Việt Nam";
|
||||
let p = [0, 3, 6, 9, 12, 15, 18, 19, 20, 23, 24, 25, 26, 27];
|
||||
let v = ['ศ','ไ','ท','ย','中','华','V','i','ệ','t',' ','N','a','m'];
|
||||
@ -1843,7 +1841,6 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_char_indices_revator() {
|
||||
use iter::*;
|
||||
let s = "ศไทย中华Việt Nam";
|
||||
let p = [27, 26, 25, 24, 23, 20, 19, 18, 15, 12, 9, 6, 3, 0];
|
||||
let v = ['m', 'a', 'N', ' ', 't', 'ệ','i','V','华','中','ย','ท','ไ','ศ'];
|
||||
@ -2027,7 +2024,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_str_default() {
|
||||
use default::Default;
|
||||
use std::default::Default;
|
||||
fn t<S: Default + Str>() {
|
||||
let s: S = Default::default();
|
||||
assert_eq!(s.as_slice(), "");
|
||||
@ -2110,8 +2107,8 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_from_str() {
|
||||
let owned: Option<String> = from_str("string");
|
||||
assert_eq!(owned, Some("string".to_string()));
|
||||
let owned: Option<::std::string::String> = from_str("string");
|
||||
assert_eq!(owned.as_ref().map(|s| s.as_slice()), Some("string"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -2119,16 +2116,16 @@ mod tests {
|
||||
let s = Slice("abcde");
|
||||
assert_eq!(s.len(), 5);
|
||||
assert_eq!(s.as_slice(), "abcde");
|
||||
assert_eq!(s.to_str(), "abcde".to_string());
|
||||
assert_eq!(format!("{}", s), "abcde".to_string());
|
||||
assert_eq!(s.to_str().as_slice(), "abcde");
|
||||
assert_eq!(format!("{}", s).as_slice(), "abcde");
|
||||
assert!(s.lt(&Owned("bcdef".to_string())));
|
||||
assert_eq!(Slice(""), Default::default());
|
||||
|
||||
let o = Owned("abcde".to_string());
|
||||
assert_eq!(o.len(), 5);
|
||||
assert_eq!(o.as_slice(), "abcde");
|
||||
assert_eq!(o.to_str(), "abcde".to_string());
|
||||
assert_eq!(format!("{}", o), "abcde".to_string());
|
||||
assert_eq!(o.to_str().as_slice(), "abcde");
|
||||
assert_eq!(format!("{}", o).as_slice(), "abcde");
|
||||
assert!(o.lt(&Slice("bcdef")));
|
||||
assert_eq!(Owned("".to_string()), Default::default());
|
||||
|
||||
@ -2175,10 +2172,9 @@ mod tests {
|
||||
|
||||
#[cfg(test)]
|
||||
mod bench {
|
||||
extern crate test;
|
||||
use self::test::Bencher;
|
||||
use test::Bencher;
|
||||
use super::*;
|
||||
use prelude::*;
|
||||
use std::prelude::*;
|
||||
|
||||
#[bench]
|
||||
fn char_iterator(b: &mut Bencher) {
|
||||
|
@ -353,9 +353,9 @@ impl<'a, S: Str> Equiv<S> for String {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
extern crate test;
|
||||
use container::{Container, Mutable};
|
||||
use self::test::Bencher;
|
||||
use std::prelude::*;
|
||||
use test::Bencher;
|
||||
|
||||
use str::{Str, StrSlice};
|
||||
use super::String;
|
||||
|
||||
|
@ -1002,11 +1002,12 @@ impl<T: Ord> Extendable<T> for TreeSet<T> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_treemap {
|
||||
use super::{TreeMap, TreeNode};
|
||||
|
||||
use std::prelude::*;
|
||||
use std::rand::Rng;
|
||||
use std::rand;
|
||||
|
||||
use super::{TreeMap, TreeNode};
|
||||
|
||||
#[test]
|
||||
fn find_empty() {
|
||||
let m: TreeMap<int,int> = TreeMap::new();
|
||||
@ -1436,8 +1437,9 @@ mod test_treemap {
|
||||
|
||||
#[cfg(test)]
|
||||
mod bench {
|
||||
extern crate test;
|
||||
use self::test::Bencher;
|
||||
use std::prelude::*;
|
||||
use test::Bencher;
|
||||
|
||||
use super::TreeMap;
|
||||
use deque::bench::{insert_rand_n, insert_seq_n, find_rand_n, find_seq_n};
|
||||
|
||||
@ -1496,6 +1498,7 @@ mod bench {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_set {
|
||||
use std::prelude::*;
|
||||
|
||||
use super::{TreeMap, TreeSet};
|
||||
|
||||
|
@ -641,10 +641,12 @@ impl<'a> Iterator<uint> for SetItems<'a> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_map {
|
||||
use super::{TrieMap, TrieNode, Internal, External, Nothing};
|
||||
use std::prelude::*;
|
||||
use std::iter::range_step;
|
||||
use std::uint;
|
||||
|
||||
use super::{TrieMap, TrieNode, Internal, External, Nothing};
|
||||
|
||||
fn check_integrity<T>(trie: &TrieNode<T>) {
|
||||
assert!(trie.count != 0);
|
||||
|
||||
@ -917,10 +919,11 @@ mod test_map {
|
||||
|
||||
#[cfg(test)]
|
||||
mod bench_map {
|
||||
extern crate test;
|
||||
use super::TrieMap;
|
||||
use std::prelude::*;
|
||||
use std::rand::{weak_rng, Rng};
|
||||
use self::test::Bencher;
|
||||
use test::Bencher;
|
||||
|
||||
use super::TrieMap;
|
||||
|
||||
#[bench]
|
||||
fn bench_iter_small(b: &mut Bencher) {
|
||||
@ -1025,9 +1028,11 @@ mod bench_map {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_set {
|
||||
use super::TrieSet;
|
||||
use std::prelude::*;
|
||||
use std::uint;
|
||||
|
||||
use super::TrieSet;
|
||||
|
||||
#[test]
|
||||
fn test_sane_chunk() {
|
||||
let x = 1;
|
||||
|
@ -24,7 +24,7 @@ use core::num;
|
||||
use core::ptr;
|
||||
use core::uint;
|
||||
|
||||
use slice::{MutableTotalOrdVector, OwnedVector, MutableVectorAllocating};
|
||||
use slice::{MutableOrdVector, OwnedVector, MutableVectorAllocating};
|
||||
use slice::{Items, MutItems};
|
||||
|
||||
/// An owned, growable vector.
|
||||
@ -114,8 +114,7 @@ impl<T> Vec<T> {
|
||||
unsafe {
|
||||
let mut xs = Vec::with_capacity(length);
|
||||
while xs.len < length {
|
||||
mem::overwrite(xs.as_mut_slice().unsafe_mut_ref(xs.len),
|
||||
op(xs.len));
|
||||
ptr::write(xs.as_mut_slice().unsafe_mut_ref(xs.len), op(xs.len));
|
||||
xs.len += 1;
|
||||
}
|
||||
xs
|
||||
@ -211,8 +210,8 @@ impl<T: Clone> Vec<T> {
|
||||
unsafe {
|
||||
let mut xs = Vec::with_capacity(length);
|
||||
while xs.len < length {
|
||||
mem::overwrite(xs.as_mut_slice().unsafe_mut_ref(xs.len),
|
||||
value.clone());
|
||||
ptr::write(xs.as_mut_slice().unsafe_mut_ref(xs.len),
|
||||
value.clone());
|
||||
xs.len += 1;
|
||||
}
|
||||
xs
|
||||
@ -322,7 +321,7 @@ impl<T:Clone> Clone for Vec<T> {
|
||||
let this_slice = self.as_slice();
|
||||
while vector.len < len {
|
||||
unsafe {
|
||||
mem::overwrite(
|
||||
ptr::write(
|
||||
vector.as_mut_slice().unsafe_mut_ref(vector.len),
|
||||
this_slice.unsafe_ref(vector.len).clone());
|
||||
}
|
||||
@ -597,7 +596,7 @@ impl<T> Vec<T> {
|
||||
|
||||
unsafe {
|
||||
let end = (self.ptr as *T).offset(self.len as int) as *mut T;
|
||||
mem::overwrite(&mut *end, value);
|
||||
ptr::write(&mut *end, value);
|
||||
self.len += 1;
|
||||
}
|
||||
}
|
||||
@ -961,7 +960,7 @@ impl<T> Vec<T> {
|
||||
ptr::copy_memory(p.offset(1), &*p, len - index);
|
||||
// Write it in, overwriting the first copy of the `index`th
|
||||
// element.
|
||||
mem::overwrite(&mut *p, element);
|
||||
ptr::write(&mut *p, element);
|
||||
}
|
||||
self.set_len(len + 1);
|
||||
}
|
||||
@ -1578,10 +1577,10 @@ pub mod raw {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::*;
|
||||
use mem::size_of;
|
||||
use kinds::marker;
|
||||
use super::{unzip, raw, FromVec};
|
||||
use std::prelude::*;
|
||||
use std::mem::size_of;
|
||||
use std::kinds::marker;
|
||||
use super::{unzip, raw, FromVec, Vec};
|
||||
|
||||
#[test]
|
||||
fn test_small_vec_struct() {
|
||||
|
@ -921,19 +921,22 @@ fn waitpid(pid: pid_t, deadline: u64) -> IoResult<p::ProcessExit> {
|
||||
|
||||
// Register a new SIGCHLD handler, returning the reading half of the
|
||||
// self-pipe plus the old handler registered (return value of sigaction).
|
||||
//
|
||||
// Be sure to set up the self-pipe first because as soon as we reigster a
|
||||
// handler we're going to start receiving signals.
|
||||
fn register_sigchld() -> (libc::c_int, c::sigaction) {
|
||||
unsafe {
|
||||
let mut old: c::sigaction = mem::zeroed();
|
||||
let mut new: c::sigaction = mem::zeroed();
|
||||
new.sa_handler = sigchld_handler;
|
||||
new.sa_flags = c::SA_NOCLDSTOP;
|
||||
assert_eq!(c::sigaction(c::SIGCHLD, &new, &mut old), 0);
|
||||
|
||||
let mut pipes = [0, ..2];
|
||||
assert_eq!(libc::pipe(pipes.as_mut_ptr()), 0);
|
||||
util::set_nonblocking(pipes[0], true).unwrap();
|
||||
util::set_nonblocking(pipes[1], true).unwrap();
|
||||
WRITE_FD = pipes[1];
|
||||
|
||||
let mut old: c::sigaction = mem::zeroed();
|
||||
let mut new: c::sigaction = mem::zeroed();
|
||||
new.sa_handler = sigchld_handler;
|
||||
new.sa_flags = c::SA_NOCLDSTOP;
|
||||
assert_eq!(c::sigaction(c::SIGCHLD, &new, &mut old), 0);
|
||||
(pipes[0], old)
|
||||
}
|
||||
}
|
||||
|
@ -365,7 +365,6 @@
|
||||
#![feature(macro_rules, phase)]
|
||||
#![deny(missing_doc, deprecated_owned_vector)]
|
||||
|
||||
extern crate collections;
|
||||
#[cfg(test)]
|
||||
extern crate stdtest = "test";
|
||||
#[cfg(test)]
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use std::fmt;
|
||||
use std::from_str::from_str;
|
||||
use std::str::{MaybeOwned, Owned, Slice};
|
||||
|
@ -14,7 +14,7 @@ use metadata::cstore;
|
||||
use metadata::filesearch;
|
||||
use util::fs;
|
||||
|
||||
use collections::HashSet;
|
||||
use std::collections::HashSet;
|
||||
use std::os;
|
||||
use syntax::abi;
|
||||
|
||||
|
@ -31,7 +31,7 @@ use syntax::diagnostic::{ColorConfig, Auto, Always, Never};
|
||||
use syntax::parse;
|
||||
use syntax::parse::token::InternedString;
|
||||
|
||||
use collections::HashSet;
|
||||
use std::collections::HashSet;
|
||||
use getopts::{optopt, optmulti, optflag, optflagopt};
|
||||
use getopts;
|
||||
use lib::llvm::llvm;
|
||||
|
@ -32,7 +32,6 @@ This API is completely unstable and subject to change.
|
||||
default_type_params, phase)]
|
||||
|
||||
extern crate arena;
|
||||
extern crate collections;
|
||||
extern crate debug;
|
||||
extern crate flate;
|
||||
extern crate getopts;
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
use std::c_str::ToCStr;
|
||||
use std::cell::RefCell;
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use libc::{c_uint, c_ushort, c_void, free, uint64_t};
|
||||
use std::str::raw::from_c_str;
|
||||
|
||||
|
@ -23,7 +23,7 @@ use metadata::loader;
|
||||
use metadata::loader::CratePaths;
|
||||
|
||||
use std::rc::Rc;
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use syntax::ast;
|
||||
use syntax::abi;
|
||||
use syntax::attr;
|
||||
|
@ -20,7 +20,7 @@ use metadata::loader;
|
||||
use std::cell::RefCell;
|
||||
use std::c_vec::CVec;
|
||||
use std::rc::Rc;
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use syntax::ast;
|
||||
use syntax::crateid::CrateId;
|
||||
use syntax::codemap::Span;
|
||||
|
@ -33,7 +33,7 @@ use std::hash;
|
||||
use std::hash::Hash;
|
||||
use std::io::MemWriter;
|
||||
use std::str;
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use syntax::abi;
|
||||
use syntax::ast::*;
|
||||
use syntax::ast;
|
||||
|
@ -14,7 +14,7 @@ use std::cell::RefCell;
|
||||
use std::os;
|
||||
use std::io::fs;
|
||||
use std::unstable::dynamic_lib::DynamicLibrary;
|
||||
use collections::HashSet;
|
||||
use std::collections::HashSet;
|
||||
|
||||
use myfs = util::fs;
|
||||
|
||||
|
@ -32,7 +32,7 @@ use std::ptr;
|
||||
use std::slice;
|
||||
use std::str;
|
||||
|
||||
use collections::{HashMap, HashSet};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use flate;
|
||||
use time;
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
use std::cell::RefCell;
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use std::io::MemWriter;
|
||||
|
||||
use middle::ty::param_ty;
|
||||
|
@ -18,7 +18,7 @@ comments in the section "Moves and initialization" and in `doc.rs`.
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
use std::uint;
|
||||
use collections::{HashMap, HashSet};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use middle::borrowck::*;
|
||||
use middle::dataflow::DataFlowContext;
|
||||
use middle::dataflow::DataFlowOperator;
|
||||
|
@ -18,7 +18,7 @@ use middle::ty;
|
||||
use middle::typeck;
|
||||
use util::nodemap::NodeSet;
|
||||
|
||||
use collections::HashSet;
|
||||
use std::collections::HashSet;
|
||||
use syntax::ast;
|
||||
use syntax::ast_map;
|
||||
use syntax::ast_util::{local_def, def_id_of_def, is_local};
|
||||
|
@ -61,7 +61,7 @@
|
||||
//! Additionally, the algorithm is geared towards finding *any* solution rather
|
||||
//! than finding a number of solutions (there are normally quite a few).
|
||||
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use syntax::ast;
|
||||
|
||||
use driver::session;
|
||||
|
@ -31,7 +31,7 @@ use syntax::parse::token::InternedString;
|
||||
use syntax::visit::Visitor;
|
||||
use syntax::visit;
|
||||
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use std::iter::Enumerate;
|
||||
use std::slice;
|
||||
|
||||
|
@ -49,7 +49,7 @@ use util::ppaux::{ty_to_str};
|
||||
use util::nodemap::NodeSet;
|
||||
|
||||
use std::cmp;
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use std::i16;
|
||||
use std::i32;
|
||||
use std::i64;
|
||||
@ -60,7 +60,7 @@ use std::u16;
|
||||
use std::u32;
|
||||
use std::u64;
|
||||
use std::u8;
|
||||
use collections::SmallIntMap;
|
||||
use std::collections::SmallIntMap;
|
||||
use syntax::abi;
|
||||
use syntax::ast_map;
|
||||
use syntax::ast_util::IdVisitingOperation;
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
use middle::resolve;
|
||||
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use syntax::ast::*;
|
||||
use syntax::ast_util::{path_to_ident, walk_pat};
|
||||
use syntax::codemap::Span;
|
||||
|
@ -21,7 +21,7 @@ use middle::typeck;
|
||||
use middle::privacy;
|
||||
use util::nodemap::NodeSet;
|
||||
|
||||
use collections::HashSet;
|
||||
use std::collections::HashSet;
|
||||
use syntax::abi;
|
||||
use syntax::ast;
|
||||
use syntax::ast_map;
|
||||
|
@ -27,7 +27,7 @@ use middle::ty;
|
||||
use util::nodemap::NodeMap;
|
||||
|
||||
use std::cell::RefCell;
|
||||
use collections::{HashMap, HashSet};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use syntax::codemap::Span;
|
||||
use syntax::{ast, visit};
|
||||
use syntax::visit::{Visitor, FnKind};
|
||||
|
@ -31,7 +31,7 @@ use syntax::owned_slice::OwnedSlice;
|
||||
use syntax::visit;
|
||||
use syntax::visit::Visitor;
|
||||
|
||||
use collections::{HashMap, HashSet};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::mem::replace;
|
||||
use std::rc::{Rc, Weak};
|
||||
|
@ -222,7 +222,7 @@ use middle::ty;
|
||||
use util::common::indenter;
|
||||
use util::ppaux::{Repr, vec_map_to_str};
|
||||
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use std::cell::Cell;
|
||||
use std::rc::Rc;
|
||||
use syntax::ast;
|
||||
|
@ -19,7 +19,7 @@ use middle::trans::base;
|
||||
use middle::trans::common::*;
|
||||
use middle::trans::machine::llalign_of_pref;
|
||||
use middle::trans::type_::Type;
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use libc::{c_uint, c_ulonglong, c_char};
|
||||
use std::string::String;
|
||||
use syntax::codemap::Span;
|
||||
|
@ -30,7 +30,7 @@ use util::ppaux::Repr;
|
||||
use util::nodemap::NodeMap;
|
||||
|
||||
use arena::TypedArena;
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use libc::{c_uint, c_longlong, c_ulonglong, c_char};
|
||||
use std::c_str::ToCStr;
|
||||
use std::cell::{Cell, RefCell};
|
||||
|
@ -31,7 +31,7 @@ use std::cell::{Cell, RefCell};
|
||||
use std::c_str::ToCStr;
|
||||
use std::ptr;
|
||||
use std::rc::Rc;
|
||||
use collections::{HashMap, HashSet};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use syntax::ast;
|
||||
use syntax::parse::token::InternedString;
|
||||
|
||||
|
@ -145,8 +145,8 @@ use util::ppaux;
|
||||
use std::c_str::{CString, ToCStr};
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::rc::{Rc, Weak};
|
||||
use collections::HashMap;
|
||||
use collections::HashSet;
|
||||
use std::collections::HashMap;
|
||||
use std::collections::HashSet;
|
||||
use libc::{c_uint, c_ulonglong, c_longlong};
|
||||
use std::ptr;
|
||||
use std::string::String;
|
||||
|
@ -39,12 +39,12 @@ use std::cell::{Cell, RefCell};
|
||||
use std::cmp;
|
||||
use std::fmt::Show;
|
||||
use std::fmt;
|
||||
use std::hash::{Hash, sip};
|
||||
use std::hash::{Hash, sip, Writer};
|
||||
use std::iter::AdditiveIterator;
|
||||
use std::mem;
|
||||
use std::ops;
|
||||
use std::rc::Rc;
|
||||
use collections::{HashMap, HashSet};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use syntax::abi;
|
||||
use syntax::ast::*;
|
||||
use syntax::ast_util::{is_local, lit_is_str};
|
||||
@ -57,7 +57,7 @@ use syntax::parse::token::InternedString;
|
||||
use syntax::{ast, ast_map};
|
||||
use syntax::owned_slice::OwnedSlice;
|
||||
use syntax::util::small_vector::SmallVector;
|
||||
use collections::enum_set::{EnumSet, CLike};
|
||||
use std::collections::enum_set::{EnumSet, CLike};
|
||||
|
||||
pub type Disr = u64;
|
||||
|
||||
|
@ -19,7 +19,7 @@ use middle::typeck::check::{structure_of, valid_range_bounds};
|
||||
use middle::typeck::infer;
|
||||
use middle::typeck::require_same_types;
|
||||
|
||||
use collections::{HashMap, HashSet};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use syntax::ast;
|
||||
use syntax::ast_util;
|
||||
use syntax::parse::token;
|
||||
|
@ -96,7 +96,7 @@ use util::common::indenter;
|
||||
use util::ppaux;
|
||||
use util::ppaux::Repr;
|
||||
|
||||
use collections::HashSet;
|
||||
use std::collections::HashSet;
|
||||
use std::rc::Rc;
|
||||
use syntax::ast::{DefId, SelfValue, SelfRegion};
|
||||
use syntax::ast::{SelfUniq, SelfStatic};
|
||||
|
@ -116,7 +116,7 @@ use util::ppaux::{UserString, Repr};
|
||||
use util::nodemap::{FnvHashMap, NodeMap};
|
||||
|
||||
use std::cell::{Cell, RefCell};
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use std::mem::replace;
|
||||
use std::rc::Rc;
|
||||
use std::vec::Vec;
|
||||
|
@ -14,7 +14,7 @@ use middle::ty;
|
||||
use middle::ty_fold;
|
||||
use middle::ty_fold::TypeFolder;
|
||||
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use util::ppaux::Repr;
|
||||
use util::ppaux;
|
||||
|
||||
|
@ -29,7 +29,7 @@ use util::ppaux;
|
||||
use util::ppaux::Repr;
|
||||
|
||||
use std::rc::Rc;
|
||||
use collections::HashSet;
|
||||
use std::collections::HashSet;
|
||||
use syntax::ast;
|
||||
use syntax::ast_util;
|
||||
use syntax::codemap::Span;
|
||||
|
@ -45,7 +45,7 @@ use syntax::owned_slice::OwnedSlice;
|
||||
use syntax::parse::token;
|
||||
use syntax::visit;
|
||||
|
||||
use collections::HashSet;
|
||||
use std::collections::HashSet;
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
|
||||
|
@ -47,7 +47,7 @@ use util::ppaux;
|
||||
use util::ppaux::Repr;
|
||||
|
||||
use std::rc::Rc;
|
||||
use collections::{HashMap, HashSet};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
use syntax::abi;
|
||||
use syntax::ast::{StaticRegionTyParamBound, OtherRegionTyParamBound,
|
||||
|
@ -59,7 +59,7 @@ time of error detection.
|
||||
|
||||
*/
|
||||
|
||||
use collections::HashSet;
|
||||
use std::collections::HashSet;
|
||||
use middle::ty;
|
||||
use middle::ty::{Region, ReFree};
|
||||
use middle::typeck::infer;
|
||||
|
@ -24,7 +24,7 @@ use middle::typeck::infer::fold_regions_in_sig;
|
||||
use syntax::ast::{Many, Once, MutImmutable, MutMutable};
|
||||
use syntax::ast::{NormalFn, UnsafeFn, NodeId};
|
||||
use syntax::ast::{Onceness, FnStyle};
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use util::common::{indenter};
|
||||
use util::ppaux::mt_to_str;
|
||||
|
||||
|
@ -45,7 +45,7 @@ use middle::typeck::infer::sub::Sub;
|
||||
use middle::typeck::infer::to_str::InferStr;
|
||||
use util::common::indenter;
|
||||
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
|
||||
trait LatticeValue {
|
||||
fn sub(cf: CombineFields, a: &Self, b: &Self) -> ures;
|
||||
|
@ -20,7 +20,7 @@ use middle::typeck::infer::to_str::InferStr;
|
||||
use middle::typeck::infer::{cres, InferCtxt};
|
||||
use middle::typeck::infer::fold_regions_in_sig;
|
||||
use middle::typeck::infer::{TypeTrace, Subtype};
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use syntax::ast::{Many, Once, NodeId};
|
||||
use syntax::ast::{NormalFn, UnsafeFn};
|
||||
use syntax::ast::{Onceness, FnStyle};
|
||||
|
@ -21,7 +21,7 @@ pub use middle::typeck::infer::resolve::{resolve_ivar, resolve_all};
|
||||
pub use middle::typeck::infer::resolve::{resolve_nested_tvar};
|
||||
pub use middle::typeck::infer::resolve::{resolve_rvar};
|
||||
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use middle::ty::{TyVid, IntVid, FloatVid, RegionVid, Vid};
|
||||
use middle::ty;
|
||||
use middle::ty_fold;
|
||||
|
@ -26,7 +26,7 @@ use util::ppaux::{Repr};
|
||||
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::uint;
|
||||
use collections::{HashMap, HashSet};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use syntax::ast;
|
||||
|
||||
mod doc;
|
||||
|
@ -9,7 +9,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
|
||||
use collections::SmallIntMap;
|
||||
use std::collections::SmallIntMap;
|
||||
|
||||
use middle::ty::{Vid, expected_found, IntVarValue};
|
||||
use middle::ty;
|
||||
|
@ -192,7 +192,7 @@ represents the "variance transform" as defined in the paper:
|
||||
|
||||
*/
|
||||
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use arena;
|
||||
use arena::Arena;
|
||||
use middle::ty;
|
||||
|
@ -21,7 +21,7 @@ use syntax::parse::token::InternedString;
|
||||
use syntax::visit::Visitor;
|
||||
use syntax::visit;
|
||||
|
||||
use collections::HashSet;
|
||||
use std::collections::HashSet;
|
||||
|
||||
macro_rules! weak_lang_items( ($($name:ident, $item:ident, $sym:ident;)*) => (
|
||||
|
||||
|
@ -10,9 +10,8 @@
|
||||
|
||||
//! An efficient hash map for node IDs
|
||||
|
||||
use collections::{HashMap, HashSet};
|
||||
use std::hash::{Hasher, Hash};
|
||||
use std::io;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::hash::{Hasher, Hash, Writer};
|
||||
use syntax::ast;
|
||||
|
||||
pub type FnvHashMap<K, V> = HashMap<K, V, FnvHasher>;
|
||||
@ -27,14 +26,14 @@ pub type DefIdSet = FnvHashSet<ast::DefId>;
|
||||
// Hacks to get good names
|
||||
pub mod FnvHashMap {
|
||||
use std::hash::Hash;
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
pub fn new<K: Hash<super::FnvState> + Eq, V>() -> super::FnvHashMap<K, V> {
|
||||
HashMap::with_hasher(super::FnvHasher)
|
||||
}
|
||||
}
|
||||
pub mod FnvHashSet {
|
||||
use std::hash::Hash;
|
||||
use collections::HashSet;
|
||||
use std::collections::HashSet;
|
||||
pub fn new<V: Hash<super::FnvState> + Eq>() -> super::FnvHashSet<V> {
|
||||
HashSet::with_hasher(super::FnvHasher)
|
||||
}
|
||||
@ -82,13 +81,12 @@ impl Hasher<FnvState> for FnvHasher {
|
||||
}
|
||||
|
||||
impl Writer for FnvState {
|
||||
fn write(&mut self, bytes: &[u8]) -> io::IoResult<()> {
|
||||
fn write(&mut self, bytes: &[u8]) {
|
||||
let FnvState(mut hash) = *self;
|
||||
for byte in bytes.iter() {
|
||||
hash = hash ^ (*byte as u64);
|
||||
hash = hash * 0x100000001b3;
|
||||
}
|
||||
*self = FnvState(hash);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ use syntax;
|
||||
|
||||
use std::cell::RefCell;
|
||||
use std::os;
|
||||
use collections::{HashMap, HashSet};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
use visit_ast::RustdocVisitor;
|
||||
use clean;
|
||||
|
@ -31,7 +31,7 @@ use std::cell::RefCell;
|
||||
use std::fmt;
|
||||
use std::slice;
|
||||
use std::str;
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use html::toc::TocBuilder;
|
||||
use html::highlight;
|
||||
@ -412,4 +412,4 @@ mod tests {
|
||||
assert_eq!(parse_lang_string("{.sh .should_fail}"), (true,false,false,false))
|
||||
assert_eq!(parse_lang_string("{.example .rust}"), (false,false,false,false))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@
|
||||
//! These tasks are not parallelized (they haven't been a bottleneck yet), and
|
||||
//! both occur before the crate is rendered.
|
||||
|
||||
use collections::{HashMap, HashSet};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::fmt;
|
||||
use std::io::{fs, File, BufferedWriter, MemWriter, BufferedReader};
|
||||
use std::io;
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
#![feature(globs, struct_variant, managed_boxes, macro_rules, phase)]
|
||||
|
||||
extern crate collections;
|
||||
extern crate debug;
|
||||
extern crate getopts;
|
||||
extern crate libc;
|
||||
@ -403,7 +402,7 @@ fn json_output(krate: clean::Crate, res: Vec<plugins::PluginJson> ,
|
||||
// "crate": { parsed crate ... },
|
||||
// "plugins": { output of plugins ... }
|
||||
// }
|
||||
let mut json = box collections::TreeMap::new();
|
||||
let mut json = box std::collections::TreeMap::new();
|
||||
json.insert("schema".to_string(),
|
||||
json::String(SCHEMA_VERSION.to_string()));
|
||||
let plugins_json = box res.move_iter()
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use collections::HashSet;
|
||||
use std::collections::HashSet;
|
||||
use std::{str, io};
|
||||
use std::string::String;
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use collections::HashSet;
|
||||
use std::collections::HashSet;
|
||||
use rustc::util::nodemap::NodeSet;
|
||||
use std::cmp;
|
||||
use std::string::String;
|
||||
|
@ -17,7 +17,7 @@ use std::str;
|
||||
use std::string::String;
|
||||
use std::unstable::dynamic_lib::DynamicLibrary;
|
||||
|
||||
use collections::{HashSet, HashMap};
|
||||
use std::collections::{HashSet, HashMap};
|
||||
use testing;
|
||||
use rustc::back::link;
|
||||
use rustc::driver::config;
|
||||
|
@ -15,9 +15,9 @@ use std::default::Default;
|
||||
use std::hash::{Hash, Hasher};
|
||||
|
||||
use {Decodable, Encodable, Decoder, Encoder};
|
||||
use collections::{DList, RingBuf, TreeMap, TreeSet, Deque, HashMap, HashSet,
|
||||
TrieMap, TrieSet};
|
||||
use collections::enum_set::{EnumSet, CLike};
|
||||
use std::collections::{DList, RingBuf, TreeMap, TreeSet, Deque, HashMap, HashSet,
|
||||
TrieMap, TrieSet};
|
||||
use std::collections::enum_set::{EnumSet, CLike};
|
||||
|
||||
impl<
|
||||
E,
|
||||
|
@ -99,12 +99,9 @@ A basic `ToJson` example using a TreeMap of attribute name / attribute value:
|
||||
|
||||
|
||||
```rust
|
||||
extern crate collections;
|
||||
extern crate serialize;
|
||||
|
||||
use std::collections::TreeMap;
|
||||
use serialize::json;
|
||||
use serialize::json::ToJson;
|
||||
use collections::TreeMap;
|
||||
|
||||
pub struct MyStruct {
|
||||
attr1: u8,
|
||||
@ -190,12 +187,9 @@ This example use the ToJson impl to deserialize the JSON string.
|
||||
Example of `ToJson` trait implementation for TestStruct1.
|
||||
|
||||
```rust
|
||||
extern crate serialize;
|
||||
extern crate collections;
|
||||
|
||||
use std::collections::TreeMap;
|
||||
use serialize::json::ToJson;
|
||||
use serialize::{json, Encodable, Decodable};
|
||||
use collections::TreeMap;
|
||||
|
||||
#[deriving(Decodable, Encodable)] // generate Decodable, Encodable impl.
|
||||
pub struct TestStruct1 {
|
||||
@ -234,6 +228,7 @@ fn main() {
|
||||
*/
|
||||
|
||||
use std::char;
|
||||
use std::collections::{HashMap, TreeMap};
|
||||
use std::f64;
|
||||
use std::fmt;
|
||||
use std::io::MemWriter;
|
||||
@ -246,7 +241,6 @@ use std::string::String;
|
||||
use std::vec::Vec;
|
||||
|
||||
use Encodable;
|
||||
use collections::{HashMap, TreeMap};
|
||||
|
||||
/// Represents a json value
|
||||
#[deriving(Clone, PartialEq)]
|
||||
@ -2290,7 +2284,7 @@ mod tests {
|
||||
EOFWhileParsingValue, EOFWhileParsingString, KeyMustBeAString, ExpectedColon,
|
||||
TrailingCharacters};
|
||||
use std::io;
|
||||
use collections::TreeMap;
|
||||
use std::collections::TreeMap;
|
||||
|
||||
#[deriving(PartialEq, Encodable, Decodable, Show)]
|
||||
enum Animal {
|
||||
@ -3006,7 +3000,7 @@ mod tests {
|
||||
use std::str::from_utf8;
|
||||
use std::io::Writer;
|
||||
use std::io::MemWriter;
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
let mut hm: HashMap<uint, bool> = HashMap::new();
|
||||
hm.insert(1, true);
|
||||
let mut mem_buf = MemWriter::new();
|
||||
@ -3026,7 +3020,7 @@ mod tests {
|
||||
use std::str::from_utf8;
|
||||
use std::io::Writer;
|
||||
use std::io::MemWriter;
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
let mut hm: HashMap<uint, bool> = HashMap::new();
|
||||
hm.insert(1, true);
|
||||
let mut mem_buf = MemWriter::new();
|
||||
@ -3043,7 +3037,7 @@ mod tests {
|
||||
}
|
||||
#[test]
|
||||
fn test_hashmap_with_numeric_key_can_handle_double_quote_delimited_key() {
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use Decodable;
|
||||
let json_str = "{\"1\":true}";
|
||||
let json_obj = match from_str(json_str) {
|
||||
@ -3340,7 +3334,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_to_json() {
|
||||
use collections::{HashMap,TreeMap};
|
||||
use std::collections::{HashMap,TreeMap};
|
||||
use super::ToJson;
|
||||
|
||||
let list2 = List(vec!(Number(1.0_f64), Number(2.0_f64)));
|
||||
|
@ -29,8 +29,6 @@ extern crate test;
|
||||
#[phase(syntax, link)]
|
||||
extern crate log;
|
||||
|
||||
extern crate collections;
|
||||
|
||||
pub use self::serialize::{Decoder, Encoder, Decodable, Encodable,
|
||||
DecoderHelpers, EncoderHelpers};
|
||||
|
||||
|
@ -38,7 +38,7 @@ mod table {
|
||||
use mem::{overwrite, transmute};
|
||||
use num::{CheckedMul, is_power_of_two};
|
||||
use ops::Drop;
|
||||
use option::{Some, None, Option, Expect};
|
||||
use option::{Some, None, Option};
|
||||
use ptr::RawPtr;
|
||||
use ptr::set_memory;
|
||||
use ptr;
|
||||
@ -254,6 +254,7 @@ mod table {
|
||||
|
||||
/// Creates a new raw table from a given capacity. All buckets are
|
||||
/// initially empty.
|
||||
#[allow(experimental)]
|
||||
pub fn new(capacity: uint) -> RawTable<K, V> {
|
||||
unsafe {
|
||||
let ret = RawTable::new_uninitialized(capacity);
|
||||
@ -410,18 +411,21 @@ mod table {
|
||||
assert_eq!(size_of::<SafeHash>(), size_of::<u64>())
|
||||
}
|
||||
|
||||
/// Iterator over shared references to entries in a table.
|
||||
pub struct Entries<'a, K, V> {
|
||||
table: &'a RawTable<K, V>,
|
||||
idx: uint,
|
||||
elems_seen: uint,
|
||||
}
|
||||
|
||||
/// Iterator over mutable references to entries in a table.
|
||||
pub struct MutEntries<'a, K, V> {
|
||||
table: &'a mut RawTable<K, V>,
|
||||
idx: uint,
|
||||
elems_seen: uint,
|
||||
}
|
||||
|
||||
/// Iterator over the entries in a table, consuming the table.
|
||||
pub struct MoveEntries<K, V> {
|
||||
table: RawTable<K, V>,
|
||||
idx: uint,
|
||||
@ -694,7 +698,7 @@ impl DefaultResizePolicy {
|
||||
/// # Example
|
||||
///
|
||||
/// ```rust
|
||||
/// use collections::HashMap;
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// // type inference lets us omit an explicit type signature (which
|
||||
/// // would be `HashMap<&str, &str>` in this example).
|
||||
@ -1274,7 +1278,7 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
|
||||
/// # Example
|
||||
///
|
||||
/// ```rust
|
||||
/// use collections::HashMap;
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// // map some strings to vectors of strings
|
||||
/// let mut map = HashMap::new();
|
||||
@ -1639,7 +1643,7 @@ impl<T: Eq + Hash<S>, S, H: Hasher<S> + Default> Extendable<T> for HashSet<T, H>
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: TotalEq + Hash<S>, S, H: Hasher<S> + Default> Default for HashSet<T, H> {
|
||||
impl<T: Eq + Hash<S>, S, H: Hasher<S> + Default> Default for HashSet<T, H> {
|
||||
fn default() -> HashSet<T, H> {
|
||||
HashSet::with_hasher(Default::default())
|
||||
}
|
||||
@ -1654,11 +1658,13 @@ pub type SetAlgebraItems<'a, T, H> =
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_map {
|
||||
use prelude::*;
|
||||
|
||||
use super::HashMap;
|
||||
use std::cmp::Equiv;
|
||||
use std::hash::Hash;
|
||||
use std::iter::{Iterator,range_inclusive,range_step_inclusive};
|
||||
use std::cell::RefCell;
|
||||
use cmp::Equiv;
|
||||
use hash;
|
||||
use iter::{Iterator,range_inclusive,range_step_inclusive};
|
||||
use cell::RefCell;
|
||||
|
||||
struct KindaIntLike(int);
|
||||
|
||||
@ -1668,7 +1674,7 @@ mod test_map {
|
||||
this == *other
|
||||
}
|
||||
}
|
||||
impl<S: Writer> Hash<S> for KindaIntLike {
|
||||
impl<S: hash::Writer> hash::Hash<S> for KindaIntLike {
|
||||
fn hash(&self, state: &mut S) {
|
||||
let KindaIntLike(this) = *self;
|
||||
this.hash(state)
|
||||
@ -2146,9 +2152,11 @@ mod test_map {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_set {
|
||||
use prelude::*;
|
||||
|
||||
use super::HashSet;
|
||||
use std::container::Container;
|
||||
use std::slice::ImmutableEqVector;
|
||||
use container::Container;
|
||||
use slice::ImmutableEqVector;
|
||||
|
||||
#[test]
|
||||
fn test_disjoint() {
|
||||
@ -2389,8 +2397,10 @@ mod test_set {
|
||||
#[cfg(test)]
|
||||
mod bench {
|
||||
extern crate test;
|
||||
use prelude::*;
|
||||
|
||||
use self::test::Bencher;
|
||||
use std::iter::{range_inclusive};
|
||||
use iter::{range_inclusive};
|
||||
|
||||
#[bench]
|
||||
fn new_drop(b : &mut Bencher) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
//! # Example
|
||||
//!
|
||||
//! ```rust
|
||||
//! use collections::LruCache;
|
||||
//! use std::collections::LruCache;
|
||||
//!
|
||||
//! let mut cache: LruCache<int, int> = LruCache::new(2);
|
||||
//! cache.put(1, 10);
|
||||
@ -37,7 +37,7 @@
|
||||
//! assert!(cache.get(&2).is_none());
|
||||
//! ```
|
||||
|
||||
use cmp::{Eq, TotalEq};
|
||||
use cmp::{PartialEq, Eq};
|
||||
use collections::HashMap;
|
||||
use container::{Container, Mutable, MutableMap};
|
||||
use fmt;
|
||||
@ -256,6 +256,7 @@ impl<K, V> Drop for LruCache<K, V> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use prelude::*;
|
||||
use super::LruCache;
|
||||
|
||||
fn assert_opt_eq<V: PartialEq>(opt: Option<&V>, v: V) {
|
||||
|
@ -20,8 +20,8 @@ use parse::token::InternedString;
|
||||
use parse::token;
|
||||
use crateid::CrateId;
|
||||
|
||||
use collections::HashSet;
|
||||
use collections::bitv::BitvSet;
|
||||
use std::collections::HashSet;
|
||||
use std::collections::BitvSet;
|
||||
|
||||
local_data_key!(used_attrs: BitvSet)
|
||||
|
||||
|
@ -19,7 +19,7 @@ use parse::token;
|
||||
use parse::token::{InternedString, intern, str_to_ident};
|
||||
use util::small_vector::SmallVector;
|
||||
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
|
||||
// new-style macro! tt code:
|
||||
//
|
||||
|
@ -18,7 +18,7 @@ use ext::deriving::generic::*;
|
||||
use ext::deriving::generic::ty::*;
|
||||
use parse::token;
|
||||
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use std::string::String;
|
||||
|
||||
pub fn expand_deriving_show(cx: &mut ExtCtxt,
|
||||
|
@ -19,7 +19,7 @@ use parse::token;
|
||||
use rsparse = parse;
|
||||
|
||||
use parse = fmt_macros;
|
||||
use collections::{HashMap, HashSet};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
#[deriving(PartialEq)]
|
||||
enum ArgumentType {
|
||||
|
@ -19,8 +19,7 @@ use ast::{Ident, Mrk, Name, SyntaxContext};
|
||||
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
|
||||
// the SCTable contains a table of SyntaxContext_'s. It
|
||||
// represents a flattened tree structure, to avoid having
|
||||
@ -267,7 +266,7 @@ mod tests {
|
||||
use super::{resolve, xor_push, new_mark_internal, new_sctable_internal};
|
||||
use super::{new_rename_internal, marksof_internal, resolve_internal};
|
||||
use super::{SCTable, EmptyCtxt, Mark, Rename, IllegalCtxt};
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[test]
|
||||
fn xorpush_test () {
|
||||
|
@ -22,7 +22,7 @@ use parse::token::{Token, EOF, Nonterminal};
|
||||
use parse::token;
|
||||
|
||||
use std::rc::Rc;
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
|
||||
/* This is an Earley-like parser, without support for in-grammar nonterminals,
|
||||
only by calling out to the main rust parser for named nonterminals (which it
|
||||
|
@ -18,7 +18,7 @@ use parse::token;
|
||||
use parse::lexer::TokenAndSpan;
|
||||
|
||||
use std::rc::Rc;
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
|
||||
///an unzipping of `TokenTree`s
|
||||
#[deriving(Clone)]
|
||||
|
@ -32,7 +32,6 @@ This API is completely unstable and subject to change.
|
||||
|
||||
extern crate serialize;
|
||||
extern crate term;
|
||||
extern crate collections;
|
||||
#[phase(syntax, link)]
|
||||
extern crate log;
|
||||
extern crate fmt_macros;
|
||||
|
@ -9,7 +9,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
use std::default::Default;
|
||||
use std::hash::Hash;
|
||||
use std::hash;
|
||||
use std::{mem, raw, ptr, slice};
|
||||
use serialize::{Encodable, Decodable, Encoder, Decoder};
|
||||
|
||||
@ -107,7 +107,7 @@ impl<T: Clone> Clone for OwnedSlice<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<S: Writer, T: Hash<S>> Hash<S> for OwnedSlice<T> {
|
||||
impl<S: hash::Writer, T: hash::Hash<S>> hash::Hash<S> for OwnedSlice<T> {
|
||||
fn hash(&self, state: &mut S) {
|
||||
self.as_slice().hash(state)
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ use parse::token;
|
||||
use parse::{new_sub_parser_from_file, ParseSess};
|
||||
use owned_slice::OwnedSlice;
|
||||
|
||||
use collections::HashSet;
|
||||
use std::collections::HashSet;
|
||||
use std::mem::replace;
|
||||
use std::rc::Rc;
|
||||
use std::string::String;
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
use ast::Name;
|
||||
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use std::cell::RefCell;
|
||||
use std::cmp::Equiv;
|
||||
use std::fmt;
|
||||
|
@ -52,7 +52,6 @@
|
||||
#![deny(missing_doc)]
|
||||
|
||||
#[phase(syntax, link)] extern crate log;
|
||||
extern crate collections;
|
||||
|
||||
pub use terminfo::TerminfoTerminal;
|
||||
#[cfg(windows)]
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
//! Terminfo database interface.
|
||||
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use std::io::IoResult;
|
||||
use std::os;
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
//! ncurses-compatible compiled terminfo format parsing (term(5))
|
||||
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
use std::io;
|
||||
use std::str;
|
||||
use super::super::TermInfo;
|
||||
|
@ -35,14 +35,13 @@
|
||||
#![feature(asm, macro_rules, phase)]
|
||||
#![deny(deprecated_owned_vector)]
|
||||
|
||||
extern crate collections;
|
||||
extern crate getopts;
|
||||
extern crate regex;
|
||||
extern crate serialize;
|
||||
extern crate term;
|
||||
extern crate time;
|
||||
|
||||
use collections::TreeMap;
|
||||
use std::collections::TreeMap;
|
||||
use stats::Stats;
|
||||
use time::precise_time_ns;
|
||||
use getopts::{OptGroup, optflag, optopt};
|
||||
|
@ -10,13 +10,13 @@
|
||||
|
||||
#![allow(missing_doc)]
|
||||
|
||||
use std::collections::hashmap;
|
||||
use std::fmt::Show;
|
||||
use std::hash::Hash;
|
||||
use std::io;
|
||||
use std::mem;
|
||||
use std::num;
|
||||
use std::num::Zero;
|
||||
use collections::hashmap;
|
||||
use std::fmt::Show;
|
||||
use std::num;
|
||||
|
||||
fn local_cmp<T:Float>(x: T, y: T) -> Ordering {
|
||||
// arbitrarily decide that NaNs are larger than everything.
|
||||
|
@ -19,13 +19,10 @@
|
||||
html_root_url = "http://doc.rust-lang.org/")]
|
||||
#![feature(default_type_params)]
|
||||
|
||||
extern crate collections;
|
||||
|
||||
use collections::HashMap;
|
||||
use std::cmp::PartialEq;
|
||||
use std::collections::HashMap;
|
||||
use std::fmt;
|
||||
use std::from_str::FromStr;
|
||||
use std::hash::Hash;
|
||||
use std::hash;
|
||||
use std::io::BufReader;
|
||||
use std::string::String;
|
||||
use std::uint;
|
||||
@ -870,13 +867,13 @@ impl fmt::Show for Path {
|
||||
}
|
||||
}
|
||||
|
||||
impl<S: Writer> Hash<S> for Url {
|
||||
impl<S: hash::Writer> hash::Hash<S> for Url {
|
||||
fn hash(&self, state: &mut S) {
|
||||
self.to_str().hash(state)
|
||||
}
|
||||
}
|
||||
|
||||
impl<S: Writer> Hash<S> for Path {
|
||||
impl<S: hash::Writer> hash::Hash<S> for Path {
|
||||
fn hash(&self, state: &mut S) {
|
||||
self.to_str().hash(state)
|
||||
}
|
||||
@ -973,7 +970,7 @@ mod tests {
|
||||
decode, encode, from_str, encode_component, decode_component,
|
||||
path_from_str, UserInfo, get_scheme};
|
||||
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[test]
|
||||
fn test_url_parse() {
|
||||
|
@ -73,7 +73,7 @@ use std::char::Char;
|
||||
use std::default::Default;
|
||||
use std::fmt;
|
||||
use std::from_str::FromStr;
|
||||
use std::hash::Hash;
|
||||
use std::hash;
|
||||
use std::mem::{transmute,transmute_copy};
|
||||
use std::num::FromStrRadix;
|
||||
use std::rand;
|
||||
@ -120,7 +120,7 @@ pub struct Uuid {
|
||||
bytes: UuidBytes
|
||||
}
|
||||
|
||||
impl<S: Writer> Hash<S> for Uuid {
|
||||
impl<S: hash::Writer> hash::Hash<S> for Uuid {
|
||||
fn hash(&self, state: &mut S) {
|
||||
self.bytes.hash(state)
|
||||
}
|
||||
@ -519,8 +519,6 @@ impl rand::Rand for Uuid {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
extern crate collections;
|
||||
|
||||
use super::{Uuid, VariantMicrosoft, VariantNCS, VariantRFC4122,
|
||||
Version1Mac, Version2Dce, Version3Md5, Version4Random,
|
||||
Version5Sha1};
|
||||
@ -810,7 +808,7 @@ mod test {
|
||||
|
||||
#[test]
|
||||
fn test_iterbytes_impl_for_uuid() {
|
||||
use self::collections::HashSet;
|
||||
use std::collections::HashSet;
|
||||
let mut set = HashSet::new();
|
||||
let id1 = Uuid::new_v4();
|
||||
let id2 = Uuid::new_v4();
|
||||
|
@ -10,5 +10,5 @@
|
||||
|
||||
// no-prefer-dynamic
|
||||
|
||||
#![crate_id = "collections#0.11.0-pre"]
|
||||
#![crate_id = "url#0.11.0-pre"]
|
||||
#![crate_type = "dylib"]
|
||||
|
@ -10,5 +10,5 @@
|
||||
|
||||
// no-prefer-dynamic
|
||||
|
||||
#![crate_id = "collections#0.11.0-pre"]
|
||||
#![crate_id = "url#0.11.0-pre"]
|
||||
#![crate_type = "rlib"]
|
||||
|
@ -12,10 +12,8 @@
|
||||
#![crate_id="req"]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
extern crate collections;
|
||||
|
||||
use std::cell::RefCell;
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
|
||||
pub type header_map = HashMap<String, @RefCell<Vec<@String>>>;
|
||||
|
||||
|
@ -10,8 +10,6 @@
|
||||
|
||||
#![feature(managed_boxes)]
|
||||
|
||||
extern crate collections;
|
||||
|
||||
use collections::HashMap;
|
||||
use std::collections::HashMap;
|
||||
|
||||
pub type map = @HashMap<uint, uint>;
|
||||
|
@ -8,13 +8,11 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern crate collections;
|
||||
extern crate rand;
|
||||
extern crate time;
|
||||
|
||||
use collections::{TrieMap, TreeMap, HashMap, HashSet};
|
||||
use std::collections::{TrieMap, TreeMap, HashMap, HashSet};
|
||||
use std::os;
|
||||
use rand::{Rng, IsaacRng, SeedableRng};
|
||||
use std::rand::{Rng, IsaacRng, SeedableRng};
|
||||
use std::uint;
|
||||
|
||||
fn timed(label: &str, f: ||) {
|
||||
|
@ -14,9 +14,9 @@ extern crate collections;
|
||||
extern crate rand;
|
||||
extern crate time;
|
||||
|
||||
use collections::bitv::BitvSet;
|
||||
use collections::TreeSet;
|
||||
use collections::HashSet;
|
||||
use std::collections::bitv::BitvSet;
|
||||
use std::collections::TreeSet;
|
||||
use std::collections::HashSet;
|
||||
use std::os;
|
||||
use std::uint;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user