Skip to content

Commit 198caa8

Browse files
committed
Update users for the std::rand -> librand move.
1 parent 15e2898 commit 198caa8

File tree

70 files changed

+131
-64
lines changed

Some content is hidden

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

70 files changed

+131
-64
lines changed

src/doc/guide-tasks.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ concurrency at this writing:
5050
* [`sync::DuplexStream`] - An extension of `pipes::stream` that allows both sending and receiving,
5151
* [`sync::SyncChan`] - An extension of `pipes::stream` that provides synchronous message sending,
5252
* [`sync::SyncPort`] - An extension of `pipes::stream` that acknowledges each message received,
53-
* [`sync::rendezvous`] - Creates a stream whose channel, upon sending a message, blocks until the
53+
* [`sync::rendezvous`] - Creates a stream whose channel, upon sending a message, blocks until the
5454
message is received.
5555
* [`sync::Arc`] - The Arc (atomically reference counted) type, for safely sharing immutable data,
5656
* [`sync::RWArc`] - A dual-mode Arc protected by a reader-writer lock,
5757
* [`sync::MutexArc`] - An Arc with mutable data protected by a blocking mutex,
5858
* [`sync::Semaphore`] - A counting, blocking, bounded-waiting semaphore,
59-
* [`sync::Mutex`] - A blocking, bounded-waiting, mutual exclusion lock with an associated
59+
* [`sync::Mutex`] - A blocking, bounded-waiting, mutual exclusion lock with an associated
6060
FIFO condition variable,
6161
* [`sync::RWLock`] - A blocking, no-starvation, reader-writer lock with an associated condvar,
6262
* [`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
343343

344344
~~~
345345
# extern crate sync;
346+
extern crate rand;
346347
# use std::vec;
347-
# use std::rand;
348348
use sync::Arc;
349349
350350
fn pnorm(nums: &~[f64], p: uint) -> f64 {
@@ -376,9 +376,9 @@ created by the line
376376

377377
~~~
378378
# extern crate sync;
379+
# extern crate rand;
379380
# use sync::Arc;
380381
# use std::vec;
381-
# use std::rand;
382382
# fn main() {
383383
# let numbers = vec::from_fn(1000000, |_| rand::random::<f64>());
384384
let numbers_arc=Arc::new(numbers);
@@ -389,9 +389,9 @@ and a clone of it is sent to each task
389389

390390
~~~
391391
# extern crate sync;
392+
# extern crate rand;
392393
# use sync::Arc;
393394
# use std::vec;
394-
# use std::rand;
395395
# fn main() {
396396
# let numbers=vec::from_fn(1000000, |_| rand::random::<f64>());
397397
# let numbers_arc = Arc::new(numbers);
@@ -406,9 +406,9 @@ Each task recovers the underlying data by
406406

407407
~~~
408408
# extern crate sync;
409+
# extern crate rand;
409410
# use sync::Arc;
410411
# use std::vec;
411-
# use std::rand;
412412
# fn main() {
413413
# let numbers=vec::from_fn(1000000, |_| rand::random::<f64>());
414414
# let numbers_arc=Arc::new(numbers);

src/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2529,7 +2529,7 @@ of type `ABC` can be randomly generated and converted to a string:
25292529
#[deriving(Eq)]
25302530
struct Circle { radius: f64 }
25312531
2532-
#[deriving(Rand, Show)]
2532+
#[deriving(Clone, Show)]
25332533
enum ABC { A, B, C }
25342534
~~~
25352535

src/etc/generate-deriving-span-tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
4040
#[feature(struct_variant)];
4141
extern crate extra;
42+
extern crate rand;
4243
4344
{error_deriving}
4445
struct Error;

src/libcollections/bitv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,8 +947,8 @@ mod tests {
947947

948948
use std::uint;
949949
use std::vec;
950-
use std::rand;
951-
use std::rand::Rng;
950+
use rand;
951+
use rand::Rng;
952952

953953
static BENCH_BITS : uint = 1 << 14;
954954

src/libcollections/deque.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ pub mod bench {
4444
extern crate test;
4545
use self::test::BenchHarness;
4646
use std::container::MutableMap;
47-
use std::{vec, rand};
48-
use std::rand::Rng;
47+
use std::vec;
48+
use rand;
49+
use rand::Rng;
4950

5051
pub fn insert_rand_n<M:MutableMap<uint,uint>>(n: uint,
5152
map: &mut M,

src/libcollections/dlist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ mod tests {
633633
extern crate test;
634634
use self::test::BenchHarness;
635635
use deque::Deque;
636-
use std::rand;
636+
use rand;
637637
use super::{DList, Node, ListInsertion};
638638

639639
pub fn check_links<T>(list: &DList<T>) {

src/libcollections/hashmap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ use std::iter::{FilterMap, Chain, Repeat, Zip};
6161
use std::iter;
6262
use std::mem::replace;
6363
use std::num;
64-
use std::rand::Rng;
65-
use std::rand;
64+
use rand::Rng;
65+
use rand;
6666
use std::vec::{Items, MutItems};
6767
use std::vec_ng::Vec;
6868
use std::vec_ng;

src/libcollections/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#[allow(unrecognized_lint)];
2424
#[allow(default_type_param_usage)];
2525

26+
extern crate rand;
27+
2628
#[cfg(test)] extern crate test;
2729

2830
pub use bitv::Bitv;

src/libcollections/treemap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,8 +1009,8 @@ mod test_treemap {
10091009

10101010
use super::{TreeMap, TreeNode};
10111011

1012-
use std::rand::Rng;
1013-
use std::rand;
1012+
use rand::Rng;
1013+
use rand;
10141014

10151015
#[test]
10161016
fn find_empty() {

src/libcollections/trie.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ mod test_map {
898898
mod bench_map {
899899
extern crate test;
900900
use super::TrieMap;
901-
use std::rand::{weak_rng, Rng};
901+
use rand::{weak_rng, Rng};
902902
use self::test::BenchHarness;
903903

904904
#[bench]

0 commit comments

Comments
 (0)