|
1 | | -diff --git a/library/alloc/Cargo.toml b/library/alloc/Cargo.toml |
2 | | -index 265020209eb..86e12f323d8 100644 |
3 | | ---- a/library/alloc/Cargo.toml |
4 | | -+++ b/library/alloc/Cargo.toml |
5 | | -@@ -13,8 +13,8 @@ core = { path = "../core" } |
6 | | - compiler_builtins = { version = "0.1.40", features = ['rustc-dep-of-std'] } |
7 | | - |
8 | | - [dev-dependencies] |
9 | | --rand = "0.7" |
10 | | --rand_xorshift = "0.2" |
11 | | -+rand = "0.8" |
12 | | -+rand_xorshift = "0.3" |
13 | | - |
14 | | - [[test]] |
15 | | - name = "collectionstests" |
16 | | -diff --git a/library/alloc/benches/slice.rs b/library/alloc/benches/slice.rs |
17 | | -index bd6f38f2f10..ed586492663 100644 |
18 | | ---- a/library/alloc/benches/slice.rs |
19 | | -+++ b/library/alloc/benches/slice.rs |
20 | | -@@ -1,6 +1,6 @@ |
21 | | - use std::{mem, ptr}; |
22 | | - |
23 | | --use rand::distributions::{Alphanumeric, Standard}; |
24 | | -+use rand::distributions::{Alphanumeric, Standard, DistString}; |
25 | | - use rand::Rng; |
26 | | - use test::{black_box, Bencher}; |
27 | | - |
28 | | -@@ -218,7 +218,7 @@ fn gen_strings(len: usize) -> Vec<String> { |
29 | | - let mut v = vec![]; |
30 | | - for _ in 0..len { |
31 | | - let n = rng.gen::<usize>() % 20 + 1; |
32 | | -- v.push((&mut rng).sample_iter(&Alphanumeric).take(n).collect()); |
33 | | -+ v.push(Alphanumeric.sample_string(&mut rng, n)); |
34 | | - } |
35 | | - v |
36 | | - } |
37 | | -diff --git a/library/alloc/tests/slice.rs b/library/alloc/tests/slice.rs |
38 | | -index 21f894343be..a7bdf08055c 100644 |
39 | | ---- a/library/alloc/tests/slice.rs |
40 | | -+++ b/library/alloc/tests/slice.rs |
41 | | -@@ -396,8 +396,11 @@ fn test_sort() { |
42 | | - for len in (2..25).chain(500..510) { |
43 | | - for &modulus in &[5, 10, 100, 1000] { |
44 | | - for _ in 0..10 { |
45 | | -- let orig: Vec<_> = |
46 | | -- rng.sample_iter::<i32, _>(&Standard).map(|x| x % modulus).take(len).collect(); |
47 | | -+ let orig: Vec<_> = (&mut rng) |
48 | | -+ .sample_iter::<i32, _>(&Standard) |
49 | | -+ .map(|x| x % modulus) |
50 | | -+ .take(len) |
51 | | -+ .collect(); |
52 | | - |
53 | | - // Sort in default order. |
54 | | - let mut v = orig.clone(); |
55 | | -diff --git a/library/core/Cargo.toml b/library/core/Cargo.toml |
56 | | -index 2a7df9556cf..f636ac97dae 100644 |
57 | | ---- a/library/core/Cargo.toml |
58 | | -+++ b/library/core/Cargo.toml |
59 | | -@@ -24,8 +24,8 @@ path = "benches/lib.rs" |
60 | | - test = true |
61 | | - |
62 | | - [dev-dependencies] |
63 | | --rand = "0.7" |
64 | | --rand_xorshift = "0.2" |
65 | | -+rand = "0.8" |
66 | | -+rand_xorshift = "0.3" |
67 | | - |
68 | | - [features] |
69 | | - # Make panics and failed asserts immediately abort without formatting any message |
70 | | -diff --git a/library/core/benches/num/int_log/mod.rs b/library/core/benches/num/int_log/mod.rs |
71 | | -index 3c01e2998cd..bb61224b5ba 100644 |
72 | | ---- a/library/core/benches/num/int_log/mod.rs |
73 | | -+++ b/library/core/benches/num/int_log/mod.rs |
74 | | -@@ -21,7 +21,7 @@ fn $random(bench: &mut Bencher) { |
75 | | - /* Exponentially distributed random numbers from the whole range of the type. */ |
76 | | - let numbers: Vec<$t> = (0..256) |
77 | | - .map(|_| { |
78 | | -- let x = rng.gen::<$t>() >> rng.gen_range(0, <$t>::BITS); |
79 | | -+ let x = rng.gen::<$t>() >> rng.gen_range(0..<$t>::BITS); |
80 | | - if x != 0 { x } else { 1 } |
81 | | - }) |
82 | | - .collect(); |
83 | | -@@ -38,7 +38,7 @@ fn $random_small(bench: &mut Bencher) { |
84 | | - /* Exponentially distributed random numbers from the range 0..256. */ |
85 | | - let numbers: Vec<$t> = (0..256) |
86 | | - .map(|_| { |
87 | | -- let x = (rng.gen::<u8>() >> rng.gen_range(0, u8::BITS)) as $t; |
88 | | -+ let x = (rng.gen::<u8>() >> rng.gen_range(0..u8::BITS)) as $t; |
89 | | - if x != 0 { x } else { 1 } |
90 | | - }) |
91 | | - .collect(); |
92 | | -diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml |
93 | | -index c10bfde4ddf..e727d3d57af 100644 |
94 | | ---- a/library/std/Cargo.toml |
95 | | -+++ b/library/std/Cargo.toml |
96 | | -@@ -33,7 +33,7 @@ default-features = false |
97 | | - features = ['read_core', 'elf', 'macho', 'pe', 'unaligned', 'archive'] |
98 | | - |
99 | | - [dev-dependencies] |
100 | | --rand = "0.7" |
101 | | -+rand = "0.8" |
102 | | - |
103 | | - [target.'cfg(any(all(target_family = "wasm", not(target_os = "emscripten")), all(target_vendor = "fortanix", target_env = "sgx")))'.dependencies] |
104 | | - dlmalloc = { version = "0.2.3", features = ['rustc-dep-of-std'] } |
105 | | -diff --git a/library/std/src/collections/hash/map/tests.rs b/library/std/src/collections/hash/map/tests.rs |
106 | | -index 65634f2063f..d68eb31268b 100644 |
107 | | ---- a/library/std/src/collections/hash/map/tests.rs |
108 | | -+++ b/library/std/src/collections/hash/map/tests.rs |
109 | | -@@ -714,12 +714,12 @@ fn check(m: &HashMap<i32, ()>) { |
110 | | - |
111 | | - // Populate the map with some items. |
112 | | - for _ in 0..50 { |
113 | | -- let x = rng.gen_range(-10, 10); |
114 | | -+ let x = rng.gen_range(-10..10); |
115 | | - m.insert(x, ()); |
116 | | - } |
117 | | - |
118 | | - for _ in 0..1000 { |
119 | | -- let x = rng.gen_range(-10, 10); |
120 | | -+ let x = rng.gen_range(-10..10); |
121 | | - match m.entry(x) { |
122 | | - Vacant(_) => {} |
123 | | - Occupied(e) => { |
124 | | -diff --git a/library/std/tests/env.rs b/library/std/tests/env.rs |
125 | | -index b095c2dde62..c6667712c86 100644 |
126 | | ---- a/library/std/tests/env.rs |
127 | | -+++ b/library/std/tests/env.rs |
128 | | -@@ -1,12 +1,11 @@ |
129 | | - use std::env::*; |
130 | | - use std::ffi::{OsStr, OsString}; |
131 | | - |
132 | | --use rand::distributions::Alphanumeric; |
133 | | --use rand::{thread_rng, Rng}; |
134 | | -+use rand::distributions::{Alphanumeric, DistString}; |
135 | | -+use rand::thread_rng; |
136 | | - |
137 | | - fn make_rand_name() -> OsString { |
138 | | -- let rng = thread_rng(); |
139 | | -- let n = format!("TEST{}", rng.sample_iter(&Alphanumeric).take(10).collect::<String>()); |
140 | | -+ let n = format!("TEST{}", Alphanumeric.sample_string(&mut thread_rng(), 10)); |
141 | | - let n = OsString::from(n); |
142 | | - assert!(var_os(&n).is_none()); |
143 | | - n |
0 commit comments