Skip to content

Commit 4a98669

Browse files
committed
bump to newer rand
1 parent 1f25e33 commit 4a98669

File tree

4 files changed

+330
-4
lines changed

4 files changed

+330
-4
lines changed

alloc_miri_test/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ default = ["miri-test-libstd"]
1616
miri-test-libstd = []
1717

1818
[dev-dependencies]
19-
rand = "0.7"
20-
rand_xorshift = "0.2"
19+
rand = "0.8"
20+
rand_xorshift = "0.3"
2121
# This lets tests access the `core` and `alloc` crates.
2222
core = { path = "../fake/core" }
2323
alloc = { path = "../fake/alloc" }

core_miri_test/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ name = "coretests"
2323
path = "../library/core/tests/lib.rs"
2424

2525
[dev-dependencies]
26-
rand = "0.7"
26+
rand = "0.8"
27+
rand_xorshift = "0.3"
2728
# This lets tests access the `core` crate.
2829
core = { path = "../fake/core" }

rust-src.diff

Lines changed: 324 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,324 @@
1+
commit d371c6cf51c77e199ac391f3f47ff6080ea3e943
2+
Author: Ralf Jung <[email protected]>
3+
Date: Mon Nov 21 10:07:02 2022 +0100
4+
5+
bump rand dependency of alloc and core tests
6+
7+
diff --git a/Cargo.lock b/Cargo.lock
8+
index c180451f8aa..be03acb2ade 100644
9+
--- a/Cargo.lock
10+
+++ b/Cargo.lock
11+
@@ -30,7 +30,7 @@ version = "0.7.4"
12+
source = "registry+https://github.com/rust-lang/crates.io-index"
13+
checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98"
14+
dependencies = [
15+
- "getrandom 0.2.0",
16+
+ "getrandom",
17+
"once_cell",
18+
"version_check",
19+
]
20+
@@ -50,7 +50,7 @@ version = "0.0.0"
21+
dependencies = [
22+
"compiler_builtins",
23+
"core",
24+
- "rand 0.7.3",
25+
+ "rand",
26+
"rand_xorshift",
27+
]
28+
29+
@@ -878,7 +878,7 @@ dependencies = [
30+
name = "core"
31+
version = "0.0.0"
32+
dependencies = [
33+
- "rand 0.7.3",
34+
+ "rand",
35+
"rand_xorshift",
36+
]
37+
38+
@@ -1506,17 +1506,6 @@ dependencies = [
39+
"unicode-width",
40+
]
41+
42+
-[[package]]
43+
-name = "getrandom"
44+
-version = "0.1.16"
45+
-source = "registry+https://github.com/rust-lang/crates.io-index"
46+
-checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
47+
-dependencies = [
48+
- "cfg-if 1.0.0",
49+
- "libc",
50+
- "wasi 0.9.0+wasi-snapshot-preview1",
51+
-]
52+
-
53+
[[package]]
54+
name = "getrandom"
55+
version = "0.2.0"
56+
@@ -1826,7 +1815,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
57+
checksum = "af1955a75fa080c677d3972822ec4bad316169ab1cfc6c257a942c2265dbe5fe"
58+
dependencies = [
59+
"bitmaps",
60+
- "rand_core 0.6.2",
61+
+ "rand_core",
62+
"rand_xoshiro",
63+
"sized-chunks",
64+
"typenum",
65+
@@ -2319,14 +2308,14 @@ version = "0.1.0"
66+
dependencies = [
67+
"colored",
68+
"env_logger 0.9.0",
69+
- "getrandom 0.2.0",
70+
+ "getrandom",
71+
"lazy_static",
72+
"libc",
73+
"libffi",
74+
"libloading",
75+
"log",
76+
"measureme",
77+
- "rand 0.8.5",
78+
+ "rand",
79+
"regex",
80+
"rustc-workspace-hack",
81+
"rustc_version",
82+
@@ -2692,7 +2681,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
83+
checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6"
84+
dependencies = [
85+
"phf_shared",
86+
- "rand 0.8.5",
87+
+ "rand",
88+
]
89+
90+
[[package]]
91+
@@ -2858,19 +2847,6 @@ dependencies = [
92+
"proc-macro2",
93+
]
94+
95+
-[[package]]
96+
-name = "rand"
97+
-version = "0.7.3"
98+
-source = "registry+https://github.com/rust-lang/crates.io-index"
99+
-checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
100+
-dependencies = [
101+
- "getrandom 0.1.16",
102+
- "libc",
103+
- "rand_chacha 0.2.2",
104+
- "rand_core 0.5.1",
105+
- "rand_hc",
106+
-]
107+
-
108+
[[package]]
109+
name = "rand"
110+
version = "0.8.5"
111+
@@ -2878,18 +2854,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
112+
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
113+
dependencies = [
114+
"libc",
115+
- "rand_chacha 0.3.0",
116+
- "rand_core 0.6.2",
117+
-]
118+
-
119+
-[[package]]
120+
-name = "rand_chacha"
121+
-version = "0.2.2"
122+
-source = "registry+https://github.com/rust-lang/crates.io-index"
123+
-checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
124+
-dependencies = [
125+
- "ppv-lite86",
126+
- "rand_core 0.5.1",
127+
+ "rand_chacha",
128+
+ "rand_core",
129+
]
130+
131+
[[package]]
132+
@@ -2899,16 +2865,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
133+
checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d"
134+
dependencies = [
135+
"ppv-lite86",
136+
- "rand_core 0.6.2",
137+
-]
138+
-
139+
-[[package]]
140+
-name = "rand_core"
141+
-version = "0.5.1"
142+
-source = "registry+https://github.com/rust-lang/crates.io-index"
143+
-checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
144+
-dependencies = [
145+
- "getrandom 0.1.16",
146+
+ "rand_core",
147+
]
148+
149+
[[package]]
150+
@@ -2917,25 +2874,16 @@ version = "0.6.2"
151+
source = "registry+https://github.com/rust-lang/crates.io-index"
152+
checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7"
153+
dependencies = [
154+
- "getrandom 0.2.0",
155+
-]
156+
-
157+
-[[package]]
158+
-name = "rand_hc"
159+
-version = "0.2.0"
160+
-source = "registry+https://github.com/rust-lang/crates.io-index"
161+
-checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
162+
-dependencies = [
163+
- "rand_core 0.5.1",
164+
+ "getrandom",
165+
]
166+
167+
[[package]]
168+
name = "rand_xorshift"
169+
-version = "0.2.0"
170+
+version = "0.3.0"
171+
source = "registry+https://github.com/rust-lang/crates.io-index"
172+
-checksum = "77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8"
173+
+checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f"
174+
dependencies = [
175+
- "rand_core 0.5.1",
176+
+ "rand_core",
177+
]
178+
179+
[[package]]
180+
@@ -2944,7 +2892,7 @@ version = "0.6.0"
181+
source = "registry+https://github.com/rust-lang/crates.io-index"
182+
checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa"
183+
dependencies = [
184+
- "rand_core 0.6.2",
185+
+ "rand_core",
186+
]
187+
188+
[[package]]
189+
@@ -2986,7 +2934,7 @@ version = "0.4.0"
190+
source = "registry+https://github.com/rust-lang/crates.io-index"
191+
checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64"
192+
dependencies = [
193+
- "getrandom 0.2.0",
194+
+ "getrandom",
195+
"redox_syscall",
196+
]
197+
198+
@@ -3190,7 +3138,7 @@ dependencies = [
199+
"bstr 0.2.17",
200+
"clap 3.2.20",
201+
"libz-sys",
202+
- "rand 0.8.5",
203+
+ "rand",
204+
"regex",
205+
"serde_json",
206+
"syn",
207+
@@ -3691,7 +3639,7 @@ dependencies = [
208+
name = "rustc_incremental"
209+
version = "0.0.0"
210+
dependencies = [
211+
- "rand 0.8.5",
212+
+ "rand",
213+
"rustc_ast",
214+
"rustc_data_structures",
215+
"rustc_errors",
216+
@@ -4353,7 +4301,7 @@ dependencies = [
217+
name = "rustc_ty_utils"
218+
version = "0.0.0"
219+
dependencies = [
220+
- "rand 0.8.5",
221+
+ "rand",
222+
"rand_xoshiro",
223+
"rustc_data_structures",
224+
"rustc_errors",
225+
@@ -4780,7 +4728,7 @@ dependencies = [
226+
"panic_abort",
227+
"panic_unwind",
228+
"profiler_builtins",
229+
- "rand 0.8.5",
230+
+ "rand",
231+
"rustc-demangle",
232+
"std_detect",
233+
"unwind",
234+
diff --git a/library/alloc/Cargo.toml b/library/alloc/Cargo.toml
235+
index 265020209eb..86e12f323d8 100644
236+
--- a/library/alloc/Cargo.toml
237+
+++ b/library/alloc/Cargo.toml
238+
@@ -13,8 +13,8 @@ core = { path = "../core" }
239+
compiler_builtins = { version = "0.1.40", features = ['rustc-dep-of-std'] }
240+
241+
[dev-dependencies]
242+
-rand = "0.7"
243+
-rand_xorshift = "0.2"
244+
+rand = "0.8"
245+
+rand_xorshift = "0.3"
246+
247+
[[test]]
248+
name = "collectionstests"
249+
diff --git a/library/alloc/benches/slice.rs b/library/alloc/benches/slice.rs
250+
index bd6f38f2f10..ed586492663 100644
251+
--- a/library/alloc/benches/slice.rs
252+
+++ b/library/alloc/benches/slice.rs
253+
@@ -1,6 +1,6 @@
254+
use std::{mem, ptr};
255+
256+
-use rand::distributions::{Alphanumeric, Standard};
257+
+use rand::distributions::{Alphanumeric, Standard, DistString};
258+
use rand::Rng;
259+
use test::{black_box, Bencher};
260+
261+
@@ -218,7 +218,7 @@ fn gen_strings(len: usize) -> Vec<String> {
262+
let mut v = vec![];
263+
for _ in 0..len {
264+
let n = rng.gen::<usize>() % 20 + 1;
265+
- v.push((&mut rng).sample_iter(&Alphanumeric).take(n).collect());
266+
+ v.push(Alphanumeric.sample_string(&mut rng, n));
267+
}
268+
v
269+
}
270+
diff --git a/library/alloc/tests/slice.rs b/library/alloc/tests/slice.rs
271+
index 21f894343be..a7bdf08055c 100644
272+
--- a/library/alloc/tests/slice.rs
273+
+++ b/library/alloc/tests/slice.rs
274+
@@ -396,8 +396,11 @@ fn test_sort() {
275+
for len in (2..25).chain(500..510) {
276+
for &modulus in &[5, 10, 100, 1000] {
277+
for _ in 0..10 {
278+
- let orig: Vec<_> =
279+
- rng.sample_iter::<i32, _>(&Standard).map(|x| x % modulus).take(len).collect();
280+
+ let orig: Vec<_> = (&mut rng)
281+
+ .sample_iter::<i32, _>(&Standard)
282+
+ .map(|x| x % modulus)
283+
+ .take(len)
284+
+ .collect();
285+
286+
// Sort in default order.
287+
let mut v = orig.clone();
288+
diff --git a/library/core/Cargo.toml b/library/core/Cargo.toml
289+
index 2a7df9556cf..f636ac97dae 100644
290+
--- a/library/core/Cargo.toml
291+
+++ b/library/core/Cargo.toml
292+
@@ -24,8 +24,8 @@ path = "benches/lib.rs"
293+
test = true
294+
295+
[dev-dependencies]
296+
-rand = "0.7"
297+
-rand_xorshift = "0.2"
298+
+rand = "0.8"
299+
+rand_xorshift = "0.3"
300+
301+
[features]
302+
# Make panics and failed asserts immediately abort without formatting any message
303+
diff --git a/library/core/benches/num/int_log/mod.rs b/library/core/benches/num/int_log/mod.rs
304+
index 3c01e2998cd..bb61224b5ba 100644
305+
--- a/library/core/benches/num/int_log/mod.rs
306+
+++ b/library/core/benches/num/int_log/mod.rs
307+
@@ -21,7 +21,7 @@ fn $random(bench: &mut Bencher) {
308+
/* Exponentially distributed random numbers from the whole range of the type. */
309+
let numbers: Vec<$t> = (0..256)
310+
.map(|_| {
311+
- let x = rng.gen::<$t>() >> rng.gen_range(0, <$t>::BITS);
312+
+ let x = rng.gen::<$t>() >> rng.gen_range(0..<$t>::BITS);
313+
if x != 0 { x } else { 1 }
314+
})
315+
.collect();
316+
@@ -38,7 +38,7 @@ fn $random_small(bench: &mut Bencher) {
317+
/* Exponentially distributed random numbers from the range 0..256. */
318+
let numbers: Vec<$t> = (0..256)
319+
.map(|_| {
320+
- let x = (rng.gen::<u8>() >> rng.gen_range(0, u8::BITS)) as $t;
321+
+ let x = (rng.gen::<u8>() >> rng.gen_range(0..u8::BITS)) as $t;
322+
if x != 0 { x } else { 1 }
323+
})
324+
.collect();

std_miri_test/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ std_detect = { path = "../fake/std_detect" }
2626
rustc-demangle = { path = "../fake/rustc-demangle" }
2727

2828
[dev-dependencies]
29-
rand = "0.7"
29+
rand = "0.8"
30+
rand_xorshift = "0.3"
3031

3132
[features]
3233
# Empty this crate

0 commit comments

Comments
 (0)