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