Skip to content

Commit 20d5ab3

Browse files
committed
---
yaml --- r: 120774 b: refs/heads/dist-snap c: 925ff65 h: refs/heads/master v: v3
1 parent 93d6af0 commit 20d5ab3

Some content is hidden

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

77 files changed

+1216
-1224
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 1813e5aa1a03b0596b8de7abd1af31edf5d6098f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 0935beba717bf6d3b54ad1b2eace359dea5dfca0
9+
refs/heads/dist-snap: 925ff6511887d917c09c61cb9d41f97ce7eab942
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/mk/crates.mk

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ DEPS_core :=
6060
DEPS_rlibc :=
6161
DEPS_alloc := core libc native:jemalloc
6262
DEPS_debug := std
63-
DEPS_std := core libc alloc native:rustrt native:backtrace
63+
DEPS_std := core rand libc alloc native:rustrt native:backtrace
6464
DEPS_graphviz := std
65-
DEPS_green := std rand native:context_switch
65+
DEPS_green := std native:context_switch
6666
DEPS_rustuv := std native:uv native:uv_support
6767
DEPS_native := std
6868
DEPS_syntax := std term serialize collections log fmt_macros debug
@@ -77,16 +77,16 @@ DEPS_glob := std
7777
DEPS_serialize := std collections log
7878
DEPS_term := std collections log
7979
DEPS_semver := std
80-
DEPS_uuid := std serialize rand
80+
DEPS_uuid := std serialize
8181
DEPS_sync := std alloc
8282
DEPS_getopts := std
83-
DEPS_collections := std rand debug
83+
DEPS_collections := std debug
8484
DEPS_fourcc := syntax std
8585
DEPS_hexfloat := syntax std
86-
DEPS_num := std rand
86+
DEPS_num := std
8787
DEPS_test := std collections getopts serialize term time regex
8888
DEPS_time := std serialize sync
89-
DEPS_rand := std
89+
DEPS_rand := core
9090
DEPS_url := std collections
9191
DEPS_workcache := std serialize collections log
9292
DEPS_log := std sync
@@ -104,6 +104,7 @@ TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
104104
ONLY_RLIB_core := 1
105105
ONLY_RLIB_rlibc := 1
106106
ONLY_RLIB_alloc := 1
107+
ONLY_RLIB_rand := 1
107108

108109
################################################################################
109110
# You should not need to edit below this line

branches/dist-snap/src/doc/guide-tasks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,10 @@ Here is a small example showing how to use Arcs. We wish to run concurrently sev
329329
a single large vector of floats. Each task needs the full vector to perform its duty.
330330

331331
~~~
332-
extern crate rand;
333332
extern crate sync;
334333
335334
use sync::Arc;
335+
use std::rand;
336336
337337
fn pnorm(nums: &[f64], p: uint) -> f64 {
338338
nums.iter().fold(0.0, |a, b| a + b.powf(p as f64)).powf(1.0 / (p as f64))
@@ -358,7 +358,7 @@ created by the line
358358

359359
~~~
360360
# extern crate sync;
361-
# extern crate rand;
361+
# use std::rand;
362362
# use sync::Arc;
363363
# fn main() {
364364
# let numbers = Vec::from_fn(1000000, |_| rand::random::<f64>());
@@ -372,7 +372,7 @@ reference to the underlying vector as if it were local.
372372

373373
~~~
374374
# extern crate sync;
375-
# extern crate rand;
375+
# use std::rand;
376376
# use sync::Arc;
377377
# fn pnorm(nums: &[f64], p: uint) -> f64 { 4.0 }
378378
# fn main() {

branches/dist-snap/src/doc/rust.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,6 @@ Unsafe operations are those that potentially violate the memory-safety guarantee
10361036
The following language level features cannot be used in the safe subset of Rust:
10371037

10381038
- Dereferencing a [raw pointer](#pointer-types).
1039-
- Reading or writing a [mutable static variable](#mutable-statics).
10401039
- Calling an unsafe function (including an intrinsic or foreign function).
10411040

10421041
##### Unsafe functions

branches/dist-snap/src/libcollections/bitv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,8 @@ mod tests {
980980
use bitv;
981981

982982
use std::uint;
983-
use rand;
984-
use rand::Rng;
983+
use std::rand;
984+
use std::rand::Rng;
985985

986986
static BENCH_BITS : uint = 1 << 14;
987987

branches/dist-snap/src/libcollections/deque.rs

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

5050
pub fn insert_rand_n<M:MutableMap<uint,uint>>(n: uint,
5151
map: &mut M,

branches/dist-snap/src/libcollections/dlist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ mod tests {
610610
extern crate test;
611611
use self::test::Bencher;
612612
use deque::Deque;
613-
use rand;
613+
use std::rand;
614614
use super::{DList, Node, ListInsertion};
615615

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

branches/dist-snap/src/libcollections/hashmap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ use std::iter::{range, range_inclusive};
2424
use std::mem::replace;
2525
use std::num;
2626
use std::option::{Option, Some, None};
27-
use rand;
28-
use rand::Rng;
27+
use std::rand;
28+
use std::rand::Rng;
2929
use std::result::{Ok, Err};
3030
use std::slice::ImmutableVector;
3131

branches/dist-snap/src/libcollections/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
#![deny(deprecated_owned_vector)]
2626

27-
extern crate rand;
2827
extern crate debug;
2928

3029
#[cfg(test)] extern crate test;

branches/dist-snap/src/libcollections/treemap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,8 +1000,8 @@ impl<T: TotalOrd> Extendable<T> for TreeSet<T> {
10001000
mod test_treemap {
10011001
use super::{TreeMap, TreeNode};
10021002

1003-
use rand::Rng;
1004-
use rand;
1003+
use std::rand::Rng;
1004+
use std::rand;
10051005

10061006
#[test]
10071007
fn find_empty() {

branches/dist-snap/src/libcollections/trie.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ mod test_map {
915915
mod bench_map {
916916
extern crate test;
917917
use super::TrieMap;
918-
use rand::{weak_rng, Rng};
918+
use std::rand::{weak_rng, Rng};
919919
use self::test::Bencher;
920920

921921
#[bench]

branches/dist-snap/src/libcore/any.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ mod tests {
119119
use prelude::*;
120120
use super::*;
121121
use realstd::owned::{Box, AnyOwnExt};
122-
use realstd::str::{Str, StrAllocating};
122+
use realstd::str::Str;
123123

124124
#[deriving(Eq, Show)]
125125
struct Test;

branches/dist-snap/src/libcore/char.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ mod test {
607607
use slice::ImmutableVector;
608608
use option::{Some, None};
609609
use realstd::string::String;
610-
use realstd::str::{Str, StrAllocating};
610+
use realstd::str::Str;
611611

612612
#[test]
613613
fn test_is_lowercase() {

branches/dist-snap/src/libcore/cmp.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
//! assert!(SketchyNum {num: 25} != SketchyNum {num: 57});
3838
//! ```
3939
40-
pub use PartialEq = cmp::Eq;
41-
pub use PartialOrd = cmp::Ord;
42-
4340
/// Trait for values that can be compared for equality and inequality.
4441
///
4542
/// This trait allows partial equality, where types can be unordered instead of

branches/dist-snap/src/libcore/fmt/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,6 @@ pub fn argument<'a, T>(f: extern "Rust" fn(&T, &mut Formatter) -> Result,
596596
#[cfg(test)]
597597
pub fn format(args: &Arguments) -> ::realstd::string::String {
598598
use str;
599-
use realstd::str::StrAllocating;
600599
use realstd::io::MemWriter;
601600

602601
fn mywrite<T: ::realstd::io::Writer>(t: &mut T, b: &[u8]) {

branches/dist-snap/src/libcore/fmt/num.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ mod tests {
194194
use fmt::radix;
195195
use super::{Binary, Octal, Decimal, LowerHex, UpperHex};
196196
use super::{GenericRadix, Radix};
197-
use realstd::str::{Str, StrAllocating};
197+
use realstd::str::Str;
198198

199199
#[test]
200200
fn test_radix_base() {
@@ -399,71 +399,71 @@ mod bench {
399399
mod uint {
400400
use super::test::Bencher;
401401
use fmt::radix;
402-
use rand::{XorShiftRng, Rng};
402+
use realstd::rand::{weak_rng, Rng};
403403

404404
#[bench]
405405
fn format_bin(b: &mut Bencher) {
406-
let mut rng = XorShiftRng::new().unwrap();
406+
let mut rng = weak_rng();
407407
b.iter(|| { format!("{:t}", rng.gen::<uint>()); })
408408
}
409409

410410
#[bench]
411411
fn format_oct(b: &mut Bencher) {
412-
let mut rng = XorShiftRng::new().unwrap();
412+
let mut rng = weak_rng();
413413
b.iter(|| { format!("{:o}", rng.gen::<uint>()); })
414414
}
415415

416416
#[bench]
417417
fn format_dec(b: &mut Bencher) {
418-
let mut rng = XorShiftRng::new().unwrap();
418+
let mut rng = weak_rng();
419419
b.iter(|| { format!("{:u}", rng.gen::<uint>()); })
420420
}
421421

422422
#[bench]
423423
fn format_hex(b: &mut Bencher) {
424-
let mut rng = XorShiftRng::new().unwrap();
424+
let mut rng = weak_rng();
425425
b.iter(|| { format!("{:x}", rng.gen::<uint>()); })
426426
}
427427

428428
#[bench]
429429
fn format_base_36(b: &mut Bencher) {
430-
let mut rng = XorShiftRng::new().unwrap();
430+
let mut rng = weak_rng();
431431
b.iter(|| { format!("{}", radix(rng.gen::<uint>(), 36)); })
432432
}
433433
}
434434

435435
mod int {
436436
use super::test::Bencher;
437437
use fmt::radix;
438-
use rand::{XorShiftRng, Rng};
438+
use realstd::rand::{weak_rng, Rng};
439439

440440
#[bench]
441441
fn format_bin(b: &mut Bencher) {
442-
let mut rng = XorShiftRng::new().unwrap();
442+
let mut rng = weak_rng();
443443
b.iter(|| { format!("{:t}", rng.gen::<int>()); })
444444
}
445445

446446
#[bench]
447447
fn format_oct(b: &mut Bencher) {
448-
let mut rng = XorShiftRng::new().unwrap();
448+
let mut rng = weak_rng();
449449
b.iter(|| { format!("{:o}", rng.gen::<int>()); })
450450
}
451451

452452
#[bench]
453453
fn format_dec(b: &mut Bencher) {
454-
let mut rng = XorShiftRng::new().unwrap();
454+
let mut rng = weak_rng();
455455
b.iter(|| { format!("{:d}", rng.gen::<int>()); })
456456
}
457457

458458
#[bench]
459459
fn format_hex(b: &mut Bencher) {
460-
let mut rng = XorShiftRng::new().unwrap();
460+
let mut rng = weak_rng();
461461
b.iter(|| { format!("{:x}", rng.gen::<int>()); })
462462
}
463463

464464
#[bench]
465465
fn format_base_36(b: &mut Bencher) {
466-
let mut rng = XorShiftRng::new().unwrap();
466+
let mut rng = weak_rng();
467467
b.iter(|| { format!("{}", radix(rng.gen::<int>(), 36)); })
468468
}
469469
}

branches/dist-snap/src/libcore/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
#[cfg(test)] extern crate realcore = "core";
6060
#[cfg(test)] extern crate libc;
6161
#[cfg(test)] extern crate native;
62-
#[cfg(test)] extern crate rand;
6362
#[cfg(test)] extern crate realstd = "std";
6463

6564
#[cfg(test)] pub use cmp = realcore::cmp;

branches/dist-snap/src/libcore/result.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,11 +637,10 @@ pub fn fold_<T,E,Iter:Iterator<Result<T,E>>>(iterator: Iter) -> Result<(),E> {
637637
#[cfg(test)]
638638
mod tests {
639639
use realstd::vec::Vec;
640-
use realstd::string::String;
641640

642641
use result::{collect, fold, fold_};
643642
use prelude::*;
644-
use realstd::str::{Str, StrAllocating};
643+
use realstd::str::Str;
645644
use iter::range;
646645

647646
pub fn op1() -> Result<int, &'static str> { Ok(666) }

branches/dist-snap/src/libcore/tuple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ mod tests {
294294
use super::*;
295295
use clone::Clone;
296296
use cmp::*;
297-
use realstd::str::{Str, StrAllocating};
297+
use realstd::str::Str;
298298

299299
#[test]
300300
fn test_clone() {

branches/dist-snap/src/libflate/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,9 @@ pub fn inflate_bytes_zlib(bytes: &[u8]) -> Option<CVec<u8>> {
108108

109109
#[cfg(test)]
110110
mod tests {
111-
extern crate rand;
112-
113111
use super::{inflate_bytes, deflate_bytes};
114-
use self::rand::Rng;
112+
use std::rand;
113+
use std::rand::Rng;
115114

116115
#[test]
117116
#[allow(deprecated_owned_vector)]
@@ -120,7 +119,8 @@ mod tests {
120119
let mut words = vec!();
121120
for _ in range(0, 20) {
122121
let range = r.gen_range(1u, 10);
123-
words.push(r.gen_vec::<u8>(range));
122+
let v = r.gen_iter::<u8>().take(range).collect::<Vec<u8>>();
123+
words.push(v);
124124
}
125125
for _ in range(0, 20) {
126126
let mut input = vec![];

branches/dist-snap/src/libgreen/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@
212212

213213
#[cfg(test)] #[phase(syntax, link)] extern crate log;
214214
#[cfg(test)] extern crate rustuv;
215-
extern crate rand;
216215
extern crate libc;
217216
extern crate alloc;
218217

branches/dist-snap/src/libgreen/sched.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use std::sync::deque;
1717
use std::unstable::mutex::NativeMutex;
1818
use std::raw;
1919

20-
use rand::{XorShiftRng, Rng, Rand};
20+
use std::rand::{XorShiftRng, Rng, Rand};
2121

2222
use TaskState;
2323
use context::Context;
@@ -977,8 +977,9 @@ impl ClosureConverter for UnsafeTaskReceiver {
977977
// worry there.
978978
#[cfg(windows)]
979979
fn new_sched_rng() -> XorShiftRng {
980-
match XorShiftRng::new() {
981-
Ok(r) => r,
980+
use std::rand::OSRng;
981+
match OSRng::new() {
982+
Ok(mut r) => r.gen(),
982983
Err(e) => {
983984
rtabort!("sched: failed to create seeded RNG: {}", e)
984985
}
@@ -988,7 +989,7 @@ fn new_sched_rng() -> XorShiftRng {
988989
fn new_sched_rng() -> XorShiftRng {
989990
use libc;
990991
use std::mem;
991-
use rand::SeedableRng;
992+
use std::rand::SeedableRng;
992993

993994
let fd = "/dev/urandom".with_c_str(|name| {
994995
unsafe { libc::open(name, libc::O_RDONLY, 0) }

branches/dist-snap/src/libnum/bigint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ mod biguint_tests {
13721372
use std::num::{Zero, One, FromStrRadix, ToStrRadix};
13731373
use std::num::{ToPrimitive, FromPrimitive};
13741374
use std::num::CheckedDiv;
1375-
use rand::{task_rng};
1375+
use std::rand::task_rng;
13761376
use std::u64;
13771377

13781378
#[test]
@@ -2220,7 +2220,7 @@ mod bigint_tests {
22202220
use std::num::CheckedDiv;
22212221
use std::num::{Zero, One, FromStrRadix, ToStrRadix};
22222222
use std::num::{ToPrimitive, FromPrimitive};
2223-
use rand::{task_rng};
2223+
use std::rand::task_rng;
22242224
use std::u64;
22252225

22262226
#[test]

0 commit comments

Comments
 (0)