From 198caa87cd870f8fd52bf0bd5fe471cf439c12f0 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Sun, 2 Mar 2014 11:33:24 +1100 Subject: [PATCH] Update users for the std::rand -> librand move. --- src/doc/guide-tasks.md | 12 ++++---- src/doc/tutorial.md | 2 +- src/etc/generate-deriving-span-tests.py | 1 + src/libcollections/bitv.rs | 4 +-- src/libcollections/deque.rs | 5 ++-- src/libcollections/dlist.rs | 2 +- src/libcollections/hashmap.rs | 4 +-- src/libcollections/lib.rs | 2 ++ src/libcollections/treemap.rs | 4 +-- src/libcollections/trie.rs | 2 +- src/libextra/lib.rs | 5 ++-- src/libextra/tempfile.rs | 4 +-- src/libflate/lib.rs | 5 ++-- src/libgreen/lib.rs | 2 ++ src/libgreen/sched.rs | 5 ++-- src/libnum/bigint.rs | 6 ++-- src/libnum/lib.rs | 2 ++ src/librustc/util/sha2.rs | 6 ++-- src/libserialize/base64.rs | 3 +- src/libsync/arc.rs | 28 +++++++++++-------- src/libsyntax/ext/deriving/generic.rs | 2 +- src/libuuid/lib.rs | 8 ++++-- src/test/bench/core-map.rs | 3 +- src/test/bench/core-set.rs | 2 +- src/test/bench/core-std.rs | 4 +-- src/test/bench/noise.rs | 4 ++- src/test/compile-fail/box-static-bound.rs | 1 - ...deriving-span-Clone-enum-struct-variant.rs | 1 + .../compile-fail/deriving-span-Clone-enum.rs | 1 + .../deriving-span-Clone-struct.rs | 1 + .../deriving-span-Clone-tuple-struct.rs | 1 + .../deriving-span-Default-struct.rs | 1 + .../deriving-span-Default-tuple-struct.rs | 1 + .../deriving-span-Eq-enum-struct-variant.rs | 1 + .../compile-fail/deriving-span-Eq-enum.rs | 1 + .../compile-fail/deriving-span-Eq-struct.rs | 1 + .../deriving-span-Eq-tuple-struct.rs | 1 + .../deriving-span-Hash-enum-struct-variant.rs | 2 +- .../compile-fail/deriving-span-Hash-enum.rs | 2 +- .../compile-fail/deriving-span-Hash-struct.rs | 2 +- .../deriving-span-Hash-tuple-struct.rs | 2 +- .../deriving-span-Ord-enum-struct-variant.rs | 1 + .../compile-fail/deriving-span-Ord-enum.rs | 1 + .../compile-fail/deriving-span-Ord-struct.rs | 1 + .../deriving-span-Ord-tuple-struct.rs | 1 + .../deriving-span-Rand-enum-struct-variant.rs | 1 + .../compile-fail/deriving-span-Rand-enum.rs | 1 + .../compile-fail/deriving-span-Rand-struct.rs | 1 + .../deriving-span-Rand-tuple-struct.rs | 1 + .../deriving-span-Show-enum-struct-variant.rs | 1 + .../compile-fail/deriving-span-Show-enum.rs | 1 + .../compile-fail/deriving-span-Show-struct.rs | 1 + .../deriving-span-Show-tuple-struct.rs | 1 + ...riving-span-TotalEq-enum-struct-variant.rs | 1 + .../deriving-span-TotalEq-enum.rs | 1 + .../deriving-span-TotalEq-struct.rs | 1 + .../deriving-span-TotalEq-tuple-struct.rs | 1 + ...iving-span-TotalOrd-enum-struct-variant.rs | 1 + .../deriving-span-TotalOrd-enum.rs | 1 + .../deriving-span-TotalOrd-struct.rs | 1 + .../deriving-span-TotalOrd-tuple-struct.rs | 1 + .../compile-fail/deriving-span-Zero-struct.rs | 1 + .../deriving-span-Zero-tuple-struct.rs | 1 + .../run-make/unicode-input/multiple_files.rs | 4 ++- .../run-make/unicode-input/span_length.rs | 4 ++- .../run-pass/deriving-encodable-decodable.rs | 3 +- src/test/run-pass/deriving-global.rs | 2 ++ src/test/run-pass/deriving-rand.rs | 4 ++- src/test/run-pass/morestack6.rs | 5 ++-- src/test/run-pass/vector-sort-failure-safe.rs | 5 +++- 70 files changed, 131 insertions(+), 64 deletions(-) diff --git a/src/doc/guide-tasks.md b/src/doc/guide-tasks.md index 0d27071494f..e20baa32c1a 100644 --- a/src/doc/guide-tasks.md +++ b/src/doc/guide-tasks.md @@ -50,13 +50,13 @@ concurrency at this writing: * [`sync::DuplexStream`] - An extension of `pipes::stream` that allows both sending and receiving, * [`sync::SyncChan`] - An extension of `pipes::stream` that provides synchronous message sending, * [`sync::SyncPort`] - An extension of `pipes::stream` that acknowledges each message received, -* [`sync::rendezvous`] - Creates a stream whose channel, upon sending a message, blocks until the +* [`sync::rendezvous`] - Creates a stream whose channel, upon sending a message, blocks until the message is received. * [`sync::Arc`] - The Arc (atomically reference counted) type, for safely sharing immutable data, * [`sync::RWArc`] - A dual-mode Arc protected by a reader-writer lock, * [`sync::MutexArc`] - An Arc with mutable data protected by a blocking mutex, * [`sync::Semaphore`] - A counting, blocking, bounded-waiting semaphore, -* [`sync::Mutex`] - A blocking, bounded-waiting, mutual exclusion lock with an associated +* [`sync::Mutex`] - A blocking, bounded-waiting, mutual exclusion lock with an associated FIFO condition variable, * [`sync::RWLock`] - A blocking, no-starvation, reader-writer lock with an associated condvar, * [`sync::Barrier`] - A barrier enables multiple tasks to synchronize the beginning @@ -343,8 +343,8 @@ a single large vector of floats. Each task needs the full vector to perform its ~~~ # extern crate sync; + extern crate rand; # use std::vec; -# use std::rand; use sync::Arc; fn pnorm(nums: &~[f64], p: uint) -> f64 { @@ -376,9 +376,9 @@ created by the line ~~~ # extern crate sync; +# extern crate rand; # use sync::Arc; # use std::vec; -# use std::rand; # fn main() { # let numbers = vec::from_fn(1000000, |_| rand::random::()); let numbers_arc=Arc::new(numbers); @@ -389,9 +389,9 @@ and a clone of it is sent to each task ~~~ # extern crate sync; +# extern crate rand; # use sync::Arc; # use std::vec; -# use std::rand; # fn main() { # let numbers=vec::from_fn(1000000, |_| rand::random::()); # let numbers_arc = Arc::new(numbers); @@ -406,9 +406,9 @@ Each task recovers the underlying data by ~~~ # extern crate sync; +# extern crate rand; # use sync::Arc; # use std::vec; -# use std::rand; # fn main() { # let numbers=vec::from_fn(1000000, |_| rand::random::()); # let numbers_arc=Arc::new(numbers); diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md index de3f39ef81d..8f37aecfc34 100644 --- a/src/doc/tutorial.md +++ b/src/doc/tutorial.md @@ -2529,7 +2529,7 @@ of type `ABC` can be randomly generated and converted to a string: #[deriving(Eq)] struct Circle { radius: f64 } -#[deriving(Rand, Show)] +#[deriving(Clone, Show)] enum ABC { A, B, C } ~~~ diff --git a/src/etc/generate-deriving-span-tests.py b/src/etc/generate-deriving-span-tests.py index cf895d2b6de..260c1c89124 100755 --- a/src/etc/generate-deriving-span-tests.py +++ b/src/etc/generate-deriving-span-tests.py @@ -39,6 +39,7 @@ TEMPLATE = """// Copyright {year} The Rust Project Developers. See the COPYRIGHT #[feature(struct_variant)]; extern crate extra; +extern crate rand; {error_deriving} struct Error; diff --git a/src/libcollections/bitv.rs b/src/libcollections/bitv.rs index 116bb80d8c0..87e9c3f238a 100644 --- a/src/libcollections/bitv.rs +++ b/src/libcollections/bitv.rs @@ -947,8 +947,8 @@ mod tests { use std::uint; use std::vec; - use std::rand; - use std::rand::Rng; + use rand; + use rand::Rng; static BENCH_BITS : uint = 1 << 14; diff --git a/src/libcollections/deque.rs b/src/libcollections/deque.rs index ac3861f4e36..f84354f9b00 100644 --- a/src/libcollections/deque.rs +++ b/src/libcollections/deque.rs @@ -44,8 +44,9 @@ pub mod bench { extern crate test; use self::test::BenchHarness; use std::container::MutableMap; - use std::{vec, rand}; - use std::rand::Rng; + use std::vec; + use rand; + use rand::Rng; pub fn insert_rand_n>(n: uint, map: &mut M, diff --git a/src/libcollections/dlist.rs b/src/libcollections/dlist.rs index 9193d319310..a3b65609b0a 100644 --- a/src/libcollections/dlist.rs +++ b/src/libcollections/dlist.rs @@ -633,7 +633,7 @@ mod tests { extern crate test; use self::test::BenchHarness; use deque::Deque; - use std::rand; + use rand; use super::{DList, Node, ListInsertion}; pub fn check_links(list: &DList) { diff --git a/src/libcollections/hashmap.rs b/src/libcollections/hashmap.rs index 1d73fae11b0..4a9f95dcb72 100644 --- a/src/libcollections/hashmap.rs +++ b/src/libcollections/hashmap.rs @@ -61,8 +61,8 @@ use std::iter::{FilterMap, Chain, Repeat, Zip}; use std::iter; use std::mem::replace; use std::num; -use std::rand::Rng; -use std::rand; +use rand::Rng; +use rand; use std::vec::{Items, MutItems}; use std::vec_ng::Vec; use std::vec_ng; diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index fb8cd61b703..a087180d9a5 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -23,6 +23,8 @@ #[allow(unrecognized_lint)]; #[allow(default_type_param_usage)]; +extern crate rand; + #[cfg(test)] extern crate test; pub use bitv::Bitv; diff --git a/src/libcollections/treemap.rs b/src/libcollections/treemap.rs index 6388b4c7c52..5965417bac7 100644 --- a/src/libcollections/treemap.rs +++ b/src/libcollections/treemap.rs @@ -1009,8 +1009,8 @@ mod test_treemap { use super::{TreeMap, TreeNode}; - use std::rand::Rng; - use std::rand; + use rand::Rng; + use rand; #[test] fn find_empty() { diff --git a/src/libcollections/trie.rs b/src/libcollections/trie.rs index 5d285e7d29e..2232af98eb3 100644 --- a/src/libcollections/trie.rs +++ b/src/libcollections/trie.rs @@ -898,7 +898,7 @@ mod test_map { mod bench_map { extern crate test; use super::TrieMap; - use std::rand::{weak_rng, Rng}; + use rand::{weak_rng, Rng}; use self::test::BenchHarness; #[bench] diff --git a/src/libextra/lib.rs b/src/libextra/lib.rs index 6861f527b1d..673eb7e76de 100644 --- a/src/libextra/lib.rs +++ b/src/libextra/lib.rs @@ -34,9 +34,10 @@ Rust extras are part of the standard Rust distribution. #[deny(non_camel_case_types)]; #[deny(missing_doc)]; -extern crate sync; -extern crate serialize; extern crate collections; +extern crate rand; +extern crate serialize; +extern crate sync; extern crate time; // Utility modules diff --git a/src/libextra/tempfile.rs b/src/libextra/tempfile.rs index 5948f356a65..4e4d80ae292 100644 --- a/src/libextra/tempfile.rs +++ b/src/libextra/tempfile.rs @@ -12,8 +12,8 @@ use std::os; -use std::rand::Rng; -use std::rand; +use rand::Rng; +use rand; use std::io; use std::io::fs; diff --git a/src/libflate/lib.rs b/src/libflate/lib.rs index 1a14432be6a..17c96f1c5ab 100644 --- a/src/libflate/lib.rs +++ b/src/libflate/lib.rs @@ -90,9 +90,10 @@ pub fn inflate_bytes_zlib(bytes: &[u8]) -> CVec { #[cfg(test)] mod tests { + extern crate rand; + use super::{inflate_bytes, deflate_bytes}; - use std::rand; - use std::rand::Rng; + use self::rand::Rng; #[test] fn test_flate_round_trip() { diff --git a/src/libgreen/lib.rs b/src/libgreen/lib.rs index 59477b6734a..22dd4c74936 100644 --- a/src/libgreen/lib.rs +++ b/src/libgreen/lib.rs @@ -175,6 +175,8 @@ #[feature(macro_rules)]; #[allow(visible_private_types)]; +extern crate rand; + use std::mem::replace; use std::os; use std::rt::crate_map; diff --git a/src/libgreen/sched.rs b/src/libgreen/sched.rs index a128ee4a250..aae0034263e 100644 --- a/src/libgreen/sched.rs +++ b/src/libgreen/sched.rs @@ -9,7 +9,6 @@ // except according to those terms. use std::cast; -use std::rand::{XorShiftRng, Rng, Rand}; use std::rt::local::Local; use std::rt::rtio::{RemoteCallback, PausableIdleCallback, Callback, EventLoop}; use std::rt::task::BlockedTask; @@ -18,6 +17,8 @@ use std::sync::deque; use std::unstable::mutex::NativeMutex; use std::raw; +use rand::{XorShiftRng, Rng, Rand}; + use TaskState; use context::Context; use coroutine::Coroutine; @@ -957,7 +958,7 @@ fn new_sched_rng() -> XorShiftRng { fn new_sched_rng() -> XorShiftRng { use std::libc; use std::mem; - use std::rand::SeedableRng; + use rand::SeedableRng; let fd = "/dev/urandom".with_c_str(|name| { unsafe { libc::open(name, libc::O_RDONLY, 0) } diff --git a/src/libnum/bigint.rs b/src/libnum/bigint.rs index ea8720751d8..c6203b3f234 100644 --- a/src/libnum/bigint.rs +++ b/src/libnum/bigint.rs @@ -24,7 +24,7 @@ use std::from_str::FromStr; use std::num::CheckedDiv; use std::num::{Bitwise, ToPrimitive, FromPrimitive}; use std::num::{Zero, One, ToStrRadix, FromStrRadix}; -use std::rand::Rng; +use rand::Rng; use std::str; use std::uint; use std::vec; @@ -1470,7 +1470,7 @@ mod biguint_tests { use std::num::{Zero, One, FromStrRadix, ToStrRadix}; use std::num::{ToPrimitive, FromPrimitive}; use std::num::CheckedDiv; - use std::rand::{task_rng}; + use rand::{task_rng}; use std::str; use std::u64; use std::vec; @@ -2205,7 +2205,7 @@ mod bigint_tests { use std::num::CheckedDiv; use std::num::{Zero, One, FromStrRadix, ToStrRadix}; use std::num::{ToPrimitive, FromPrimitive}; - use std::rand::{task_rng}; + use rand::{task_rng}; use std::u64; #[test] diff --git a/src/libnum/lib.rs b/src/libnum/lib.rs index 8e42b01f14c..8ff042ba362 100644 --- a/src/libnum/lib.rs +++ b/src/libnum/lib.rs @@ -15,6 +15,8 @@ #[crate_type = "dylib"]; #[license = "MIT/ASL2"]; +extern crate rand; + pub mod bigint; pub mod rational; pub mod complex; diff --git a/src/librustc/util/sha2.rs b/src/librustc/util/sha2.rs index c5e75b52bf3..5dbebbb4db1 100644 --- a/src/librustc/util/sha2.rs +++ b/src/librustc/util/sha2.rs @@ -524,12 +524,14 @@ static H256: [u32, ..8] = [ #[cfg(test)] mod tests { + extern crate rand; + use super::{Digest, Sha256, FixedBuffer}; use std::num::Bounded; use std::vec; use std::vec_ng::Vec; - use std::rand::isaac::IsaacRng; - use std::rand::Rng; + use self::rand::isaac::IsaacRng; + use self::rand::Rng; use serialize::hex::FromHex; // A normal addition - no overflow occurs diff --git a/src/libserialize/base64.rs b/src/libserialize/base64.rs index ea9a922f224..a09b03ec58a 100644 --- a/src/libserialize/base64.rs +++ b/src/libserialize/base64.rs @@ -263,6 +263,7 @@ impl<'a> FromBase64 for &'a str { #[cfg(test)] mod tests { extern crate test; + extern crate rand; use self::test::BenchHarness; use base64::{Config, FromBase64, ToBase64, STANDARD, URL_SAFE}; @@ -335,7 +336,7 @@ mod tests { #[test] fn test_base64_random() { - use std::rand::{task_rng, random, Rng}; + use self::rand::{task_rng, random, Rng}; use std::vec; for _ in range(0, 1000) { diff --git a/src/libsync/arc.rs b/src/libsync/arc.rs index 17a35f33170..b50d527e3f5 100644 --- a/src/libsync/arc.rs +++ b/src/libsync/arc.rs @@ -18,23 +18,27 @@ * With simple pipes, without Arc, a copy would have to be made for each task. * * ```rust + * extern crate sync; + * extern crate rand; * use sync::Arc; - * use std::{rand, vec}; + * use std::vec; * - * let numbers = vec::from_fn(100, |i| (i as f32) * rand::random()); - * let shared_numbers = Arc::new(numbers); + * fn main() { + * let numbers = vec::from_fn(100, |i| (i as f32) * rand::random()); + * let shared_numbers = Arc::new(numbers); * - * for _ in range(0, 10) { - * let (port, chan) = Chan::new(); - * chan.send(shared_numbers.clone()); + * for _ in range(0, 10) { + * let (port, chan) = Chan::new(); + * chan.send(shared_numbers.clone()); * - * spawn(proc() { - * let shared_numbers = port.recv(); - * let local_numbers = shared_numbers.get(); + * spawn(proc() { + * let shared_numbers = port.recv(); + * let local_numbers = shared_numbers.get(); * - * // Work with the local numbers - * }); - * } + * // Work with the local numbers + * }); + * } + * } * ``` */ diff --git a/src/libsyntax/ext/deriving/generic.rs b/src/libsyntax/ext/deriving/generic.rs index 1dc474551cf..bc314bc204b 100644 --- a/src/libsyntax/ext/deriving/generic.rs +++ b/src/libsyntax/ext/deriving/generic.rs @@ -216,7 +216,7 @@ pub struct TraitDef<'a> { pub struct MethodDef<'a> { /// name of the method name: &'a str, - /// List of generics, e.g. `R: std::rand::Rng` + /// List of generics, e.g. `R: rand::Rng` generics: LifetimeBounds<'a>, /// Whether there is a self argument (outer Option) i.e. whether diff --git a/src/libuuid/lib.rs b/src/libuuid/lib.rs index 8dbdedc1848..407da784b68 100644 --- a/src/libuuid/lib.rs +++ b/src/libuuid/lib.rs @@ -62,6 +62,8 @@ Examples of string representations: // test harness access #[cfg(test)] extern crate test; + +extern crate rand; extern crate serialize; use std::cast::{transmute,transmute_copy}; @@ -71,11 +73,11 @@ use std::fmt; use std::from_str::FromStr; use std::hash::{Hash, sip}; use std::num::FromStrRadix; -use std::rand::Rng; -use std::rand; use std::str; use std::vec; +use rand::Rng; + use serialize::{Encoder, Encodable, Decoder, Decodable}; /// A 128-bit (16 byte) buffer containing the ID @@ -519,12 +521,12 @@ impl rand::Rand for Uuid { #[cfg(test)] mod test { extern crate collections; + extern crate rand; use super::{Uuid, VariantMicrosoft, VariantNCS, VariantRFC4122, Version1Mac, Version2Dce, Version3Md5, Version4Random, Version5Sha1}; use std::str; - use std::rand; use std::io::MemWriter; #[test] diff --git a/src/test/bench/core-map.rs b/src/test/bench/core-map.rs index 1830a888345..fcea5222e10 100644 --- a/src/test/bench/core-map.rs +++ b/src/test/bench/core-map.rs @@ -9,11 +9,12 @@ // except according to those terms. extern crate collections; +extern crate rand; extern crate time; use collections::{TrieMap, TreeMap, HashMap, HashSet}; use std::os; -use std::rand::{Rng, IsaacRng, SeedableRng}; +use rand::{Rng, IsaacRng, SeedableRng}; use std::uint; use std::vec; diff --git a/src/test/bench/core-set.rs b/src/test/bench/core-set.rs index d1c311d2a7d..96f3c6814ab 100644 --- a/src/test/bench/core-set.rs +++ b/src/test/bench/core-set.rs @@ -11,13 +11,13 @@ // except according to those terms. extern crate collections; +extern crate rand; extern crate time; use collections::bitv::BitvSet; use collections::TreeSet; use collections::HashSet; use std::os; -use std::rand; use std::uint; struct Results { diff --git a/src/test/bench/core-std.rs b/src/test/bench/core-std.rs index 7b23e27e82a..2700b72ae98 100644 --- a/src/test/bench/core-std.rs +++ b/src/test/bench/core-std.rs @@ -12,13 +12,13 @@ #[feature(macro_rules)]; +extern crate rand; extern crate time; use time::precise_time_s; +use rand::Rng; use std::mem::swap; use std::os; -use std::rand::Rng; -use std::rand; use std::str; use std::vec; use std::io::File; diff --git a/src/test/bench/noise.rs b/src/test/bench/noise.rs index 42918ae5aa0..4954f083b36 100644 --- a/src/test/bench/noise.rs +++ b/src/test/bench/noise.rs @@ -11,8 +11,10 @@ // Multi-language Perlin noise benchmark. // See https://github.com/nsf/pnoise for timings and alternative implementations. +extern crate rand; + use std::f32::consts::PI; -use std::rand::{Rng, StdRng}; +use rand::{Rng, StdRng}; struct Vec2 { x: f32, diff --git a/src/test/compile-fail/box-static-bound.rs b/src/test/compile-fail/box-static-bound.rs index 45a42f82145..1ec5dfa2da9 100644 --- a/src/test/compile-fail/box-static-bound.rs +++ b/src/test/compile-fail/box-static-bound.rs @@ -19,4 +19,3 @@ fn g(x: T) -> @T { } fn main() {} - diff --git a/src/test/compile-fail/deriving-span-Clone-enum-struct-variant.rs b/src/test/compile-fail/deriving-span-Clone-enum-struct-variant.rs index 89839c06f3b..6f3ce6abe1a 100644 --- a/src/test/compile-fail/deriving-span-Clone-enum-struct-variant.rs +++ b/src/test/compile-fail/deriving-span-Clone-enum-struct-variant.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/compile-fail/deriving-span-Clone-enum.rs b/src/test/compile-fail/deriving-span-Clone-enum.rs index 4c47e77dd81..c138c259a0f 100644 --- a/src/test/compile-fail/deriving-span-Clone-enum.rs +++ b/src/test/compile-fail/deriving-span-Clone-enum.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/compile-fail/deriving-span-Clone-struct.rs b/src/test/compile-fail/deriving-span-Clone-struct.rs index 1a2eb3fc640..9226c4a7960 100644 --- a/src/test/compile-fail/deriving-span-Clone-struct.rs +++ b/src/test/compile-fail/deriving-span-Clone-struct.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/compile-fail/deriving-span-Clone-tuple-struct.rs b/src/test/compile-fail/deriving-span-Clone-tuple-struct.rs index 03fb284b50b..e49bd45f4d0 100644 --- a/src/test/compile-fail/deriving-span-Clone-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-Clone-tuple-struct.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/compile-fail/deriving-span-Default-struct.rs b/src/test/compile-fail/deriving-span-Default-struct.rs index 21da9fef398..5da4ae5ca42 100644 --- a/src/test/compile-fail/deriving-span-Default-struct.rs +++ b/src/test/compile-fail/deriving-span-Default-struct.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/compile-fail/deriving-span-Default-tuple-struct.rs b/src/test/compile-fail/deriving-span-Default-tuple-struct.rs index 2cfc7e2a259..3f44ea926b5 100644 --- a/src/test/compile-fail/deriving-span-Default-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-Default-tuple-struct.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/compile-fail/deriving-span-Eq-enum-struct-variant.rs b/src/test/compile-fail/deriving-span-Eq-enum-struct-variant.rs index ce3d84a2e9b..482954b39f7 100644 --- a/src/test/compile-fail/deriving-span-Eq-enum-struct-variant.rs +++ b/src/test/compile-fail/deriving-span-Eq-enum-struct-variant.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/compile-fail/deriving-span-Eq-enum.rs b/src/test/compile-fail/deriving-span-Eq-enum.rs index c59a81fd147..5221869a285 100644 --- a/src/test/compile-fail/deriving-span-Eq-enum.rs +++ b/src/test/compile-fail/deriving-span-Eq-enum.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/compile-fail/deriving-span-Eq-struct.rs b/src/test/compile-fail/deriving-span-Eq-struct.rs index b797a0d7790..a063628993e 100644 --- a/src/test/compile-fail/deriving-span-Eq-struct.rs +++ b/src/test/compile-fail/deriving-span-Eq-struct.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/compile-fail/deriving-span-Eq-tuple-struct.rs b/src/test/compile-fail/deriving-span-Eq-tuple-struct.rs index fb4d850ed11..efa92c0a29a 100644 --- a/src/test/compile-fail/deriving-span-Eq-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-Eq-tuple-struct.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/compile-fail/deriving-span-Hash-enum-struct-variant.rs b/src/test/compile-fail/deriving-span-Hash-enum-struct-variant.rs index 182c669cbea..b08f7305cfc 100644 --- a/src/test/compile-fail/deriving-span-Hash-enum-struct-variant.rs +++ b/src/test/compile-fail/deriving-span-Hash-enum-struct-variant.rs @@ -12,8 +12,8 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; -use std::hash::Hash; struct Error; diff --git a/src/test/compile-fail/deriving-span-Hash-enum.rs b/src/test/compile-fail/deriving-span-Hash-enum.rs index 7617e0a33c3..6fe0094c8d2 100644 --- a/src/test/compile-fail/deriving-span-Hash-enum.rs +++ b/src/test/compile-fail/deriving-span-Hash-enum.rs @@ -12,8 +12,8 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; -use std::hash::Hash; struct Error; diff --git a/src/test/compile-fail/deriving-span-Hash-struct.rs b/src/test/compile-fail/deriving-span-Hash-struct.rs index f20da9a9d16..0ae28d084ec 100644 --- a/src/test/compile-fail/deriving-span-Hash-struct.rs +++ b/src/test/compile-fail/deriving-span-Hash-struct.rs @@ -12,8 +12,8 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; -use std::hash::Hash; struct Error; diff --git a/src/test/compile-fail/deriving-span-Hash-tuple-struct.rs b/src/test/compile-fail/deriving-span-Hash-tuple-struct.rs index 9b7ae50b738..1b69abb3e16 100644 --- a/src/test/compile-fail/deriving-span-Hash-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-Hash-tuple-struct.rs @@ -12,8 +12,8 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; -use std::hash::Hash; struct Error; diff --git a/src/test/compile-fail/deriving-span-Ord-enum-struct-variant.rs b/src/test/compile-fail/deriving-span-Ord-enum-struct-variant.rs index 319ba14c31c..edfc949970f 100644 --- a/src/test/compile-fail/deriving-span-Ord-enum-struct-variant.rs +++ b/src/test/compile-fail/deriving-span-Ord-enum-struct-variant.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; #[deriving(Eq)] struct Error; diff --git a/src/test/compile-fail/deriving-span-Ord-enum.rs b/src/test/compile-fail/deriving-span-Ord-enum.rs index 0067546d1aa..13da4454c3e 100644 --- a/src/test/compile-fail/deriving-span-Ord-enum.rs +++ b/src/test/compile-fail/deriving-span-Ord-enum.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; #[deriving(Eq)] struct Error; diff --git a/src/test/compile-fail/deriving-span-Ord-struct.rs b/src/test/compile-fail/deriving-span-Ord-struct.rs index a64f51f142d..bab38983dfb 100644 --- a/src/test/compile-fail/deriving-span-Ord-struct.rs +++ b/src/test/compile-fail/deriving-span-Ord-struct.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; #[deriving(Eq)] struct Error; diff --git a/src/test/compile-fail/deriving-span-Ord-tuple-struct.rs b/src/test/compile-fail/deriving-span-Ord-tuple-struct.rs index d289a426932..bb211d7781e 100644 --- a/src/test/compile-fail/deriving-span-Ord-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-Ord-tuple-struct.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; #[deriving(Eq)] struct Error; diff --git a/src/test/compile-fail/deriving-span-Rand-enum-struct-variant.rs b/src/test/compile-fail/deriving-span-Rand-enum-struct-variant.rs index 615112c129e..9338e23fbb4 100644 --- a/src/test/compile-fail/deriving-span-Rand-enum-struct-variant.rs +++ b/src/test/compile-fail/deriving-span-Rand-enum-struct-variant.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/compile-fail/deriving-span-Rand-enum.rs b/src/test/compile-fail/deriving-span-Rand-enum.rs index a1943941e41..1a978176d79 100644 --- a/src/test/compile-fail/deriving-span-Rand-enum.rs +++ b/src/test/compile-fail/deriving-span-Rand-enum.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/compile-fail/deriving-span-Rand-struct.rs b/src/test/compile-fail/deriving-span-Rand-struct.rs index 00d9c1de5c5..7f628503980 100644 --- a/src/test/compile-fail/deriving-span-Rand-struct.rs +++ b/src/test/compile-fail/deriving-span-Rand-struct.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/compile-fail/deriving-span-Rand-tuple-struct.rs b/src/test/compile-fail/deriving-span-Rand-tuple-struct.rs index c61a7c76bfb..9b11c027846 100644 --- a/src/test/compile-fail/deriving-span-Rand-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-Rand-tuple-struct.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/compile-fail/deriving-span-Show-enum-struct-variant.rs b/src/test/compile-fail/deriving-span-Show-enum-struct-variant.rs index e22b51d19e5..972f60bf2c9 100644 --- a/src/test/compile-fail/deriving-span-Show-enum-struct-variant.rs +++ b/src/test/compile-fail/deriving-span-Show-enum-struct-variant.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/compile-fail/deriving-span-Show-enum.rs b/src/test/compile-fail/deriving-span-Show-enum.rs index fffbd49a2bb..ba3fd1766b2 100644 --- a/src/test/compile-fail/deriving-span-Show-enum.rs +++ b/src/test/compile-fail/deriving-span-Show-enum.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/compile-fail/deriving-span-Show-struct.rs b/src/test/compile-fail/deriving-span-Show-struct.rs index 45afd4454e8..1e38c9dda5b 100644 --- a/src/test/compile-fail/deriving-span-Show-struct.rs +++ b/src/test/compile-fail/deriving-span-Show-struct.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/compile-fail/deriving-span-Show-tuple-struct.rs b/src/test/compile-fail/deriving-span-Show-tuple-struct.rs index 1a199974eba..7347b324a23 100644 --- a/src/test/compile-fail/deriving-span-Show-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-Show-tuple-struct.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/compile-fail/deriving-span-TotalEq-enum-struct-variant.rs b/src/test/compile-fail/deriving-span-TotalEq-enum-struct-variant.rs index 7fc030bdb36..4d362678283 100644 --- a/src/test/compile-fail/deriving-span-TotalEq-enum-struct-variant.rs +++ b/src/test/compile-fail/deriving-span-TotalEq-enum-struct-variant.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; #[deriving(Eq)] struct Error; diff --git a/src/test/compile-fail/deriving-span-TotalEq-enum.rs b/src/test/compile-fail/deriving-span-TotalEq-enum.rs index 166311e030b..66f84612f81 100644 --- a/src/test/compile-fail/deriving-span-TotalEq-enum.rs +++ b/src/test/compile-fail/deriving-span-TotalEq-enum.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; #[deriving(Eq)] struct Error; diff --git a/src/test/compile-fail/deriving-span-TotalEq-struct.rs b/src/test/compile-fail/deriving-span-TotalEq-struct.rs index f96c41a3865..ba29180e5e6 100644 --- a/src/test/compile-fail/deriving-span-TotalEq-struct.rs +++ b/src/test/compile-fail/deriving-span-TotalEq-struct.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; #[deriving(Eq)] struct Error; diff --git a/src/test/compile-fail/deriving-span-TotalEq-tuple-struct.rs b/src/test/compile-fail/deriving-span-TotalEq-tuple-struct.rs index 4b825adb8cf..6dbd1e3cee9 100644 --- a/src/test/compile-fail/deriving-span-TotalEq-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-TotalEq-tuple-struct.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; #[deriving(Eq)] struct Error; diff --git a/src/test/compile-fail/deriving-span-TotalOrd-enum-struct-variant.rs b/src/test/compile-fail/deriving-span-TotalOrd-enum-struct-variant.rs index 7be90a2aa76..54f7667be30 100644 --- a/src/test/compile-fail/deriving-span-TotalOrd-enum-struct-variant.rs +++ b/src/test/compile-fail/deriving-span-TotalOrd-enum-struct-variant.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; #[deriving(Eq, Ord, TotalEq)] struct Error; diff --git a/src/test/compile-fail/deriving-span-TotalOrd-enum.rs b/src/test/compile-fail/deriving-span-TotalOrd-enum.rs index ba97b28d18c..6f51522d1a6 100644 --- a/src/test/compile-fail/deriving-span-TotalOrd-enum.rs +++ b/src/test/compile-fail/deriving-span-TotalOrd-enum.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; #[deriving(Eq, Ord, TotalEq)] struct Error; diff --git a/src/test/compile-fail/deriving-span-TotalOrd-struct.rs b/src/test/compile-fail/deriving-span-TotalOrd-struct.rs index 014a5b97e36..b659e4cee22 100644 --- a/src/test/compile-fail/deriving-span-TotalOrd-struct.rs +++ b/src/test/compile-fail/deriving-span-TotalOrd-struct.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; #[deriving(Eq, Ord, TotalEq)] struct Error; diff --git a/src/test/compile-fail/deriving-span-TotalOrd-tuple-struct.rs b/src/test/compile-fail/deriving-span-TotalOrd-tuple-struct.rs index 7e4d5b2201b..d4f30946d8e 100644 --- a/src/test/compile-fail/deriving-span-TotalOrd-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-TotalOrd-tuple-struct.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; #[deriving(Eq, Ord, TotalEq)] struct Error; diff --git a/src/test/compile-fail/deriving-span-Zero-struct.rs b/src/test/compile-fail/deriving-span-Zero-struct.rs index 7256b1179db..2e00c92f469 100644 --- a/src/test/compile-fail/deriving-span-Zero-struct.rs +++ b/src/test/compile-fail/deriving-span-Zero-struct.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/compile-fail/deriving-span-Zero-tuple-struct.rs b/src/test/compile-fail/deriving-span-Zero-tuple-struct.rs index d483a86fddb..9487c6ced62 100644 --- a/src/test/compile-fail/deriving-span-Zero-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-Zero-tuple-struct.rs @@ -12,6 +12,7 @@ #[feature(struct_variant)]; extern crate extra; +extern crate rand; struct Error; diff --git a/src/test/run-make/unicode-input/multiple_files.rs b/src/test/run-make/unicode-input/multiple_files.rs index 80371aa9840..45bb29f617f 100644 --- a/src/test/run-make/unicode-input/multiple_files.rs +++ b/src/test/run-make/unicode-input/multiple_files.rs @@ -8,8 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +extern crate rand; +use rand::{task_rng, Rng}; + use std::{char, os, str}; -use std::rand::{task_rng, Rng}; use std::io::{File, Process}; // creates unicode_input_multiple_files_{main,chars}.rs, where the diff --git a/src/test/run-make/unicode-input/span_length.rs b/src/test/run-make/unicode-input/span_length.rs index 3227f672bcd..1ae6838be5b 100644 --- a/src/test/run-make/unicode-input/span_length.rs +++ b/src/test/run-make/unicode-input/span_length.rs @@ -8,8 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +extern crate rand; +use rand::{task_rng, Rng}; + use std::{char, os, str}; -use std::rand::{task_rng, Rng}; use std::io::{File, Process}; // creates a file with `fn main() { }` and checks the diff --git a/src/test/run-pass/deriving-encodable-decodable.rs b/src/test/run-pass/deriving-encodable-decodable.rs index ac4101ae5b1..75567efa470 100644 --- a/src/test/run-pass/deriving-encodable-decodable.rs +++ b/src/test/run-pass/deriving-encodable-decodable.rs @@ -16,10 +16,11 @@ #[feature(struct_variant, managed_boxes)]; +extern crate rand; extern crate serialize; use std::io::MemWriter; -use std::rand::{random, Rand}; +use rand::{random, Rand}; use serialize::{Encodable, Decodable}; use serialize::ebml; use serialize::ebml::writer::Encoder; diff --git a/src/test/run-pass/deriving-global.rs b/src/test/run-pass/deriving-global.rs index 174081786a7..a174b2c7ab1 100644 --- a/src/test/run-pass/deriving-global.rs +++ b/src/test/run-pass/deriving-global.rs @@ -22,6 +22,8 @@ // except according to those terms. extern crate serialize; // {En,De}codable +extern crate rand; // Rand + mod submod { // if any of these are implemented without global calls for any // function calls, then being in a submodule will (correctly) diff --git a/src/test/run-pass/deriving-rand.rs b/src/test/run-pass/deriving-rand.rs index 8277c0459c9..c43d8a26fd9 100644 --- a/src/test/run-pass/deriving-rand.rs +++ b/src/test/run-pass/deriving-rand.rs @@ -9,9 +9,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-fast #7103 `extern crate` does not work on check-fast + #[feature(struct_variant)]; -use std::rand; +extern crate rand; #[deriving(Rand)] struct A; diff --git a/src/test/run-pass/morestack6.rs b/src/test/run-pass/morestack6.rs index 1c4ff92907d..349b1ff7b44 100644 --- a/src/test/run-pass/morestack6.rs +++ b/src/test/run-pass/morestack6.rs @@ -13,7 +13,8 @@ // This test attempts to force the dynamic linker to resolve // external symbols as close to the red zone as possible. -use std::rand; +extern crate rand; + use std::task; mod rustrt { @@ -59,7 +60,7 @@ fn runtest2(f: extern fn(), frame_backoff: u32, last_stk: *u8) -> u32 { } pub fn main() { - use std::rand::Rng; + use rand::Rng; let fns = ~[ calllink01, calllink02, diff --git a/src/test/run-pass/vector-sort-failure-safe.rs b/src/test/run-pass/vector-sort-failure-safe.rs index 2c4a8aece19..e307ae36f96 100644 --- a/src/test/run-pass/vector-sort-failure-safe.rs +++ b/src/test/run-pass/vector-sort-failure-safe.rs @@ -8,8 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-fast #7103 `extern crate` does not work on check-fast +extern crate rand; + use std::task; -use std::rand::{task_rng, Rng}; +use rand::{task_rng, Rng}; static MAX_LEN: uint = 20; static mut drop_counts: [uint, .. MAX_LEN] = [0, .. MAX_LEN];