Skip to content

Commit 5b78e98

Browse files
committed
bump rand to fix Miri failures
1 parent 5170a3f commit 5b78e98

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

Cargo.lock

+11-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ version = "0.0.0"
1919
dependencies = [
2020
"compiler_builtins 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
2121
"core 0.0.0",
22-
"rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
23-
"rand_xorshift 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
22+
"rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
23+
"rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
2424
]
2525

2626
[[package]]
@@ -2343,6 +2343,14 @@ dependencies = [
23432343
"rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
23442344
]
23452345

2346+
[[package]]
2347+
name = "rand_xorshift"
2348+
version = "0.2.0"
2349+
source = "registry+https://github.com/rust-lang/crates.io-index"
2350+
dependencies = [
2351+
"rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
2352+
]
2353+
23462354
[[package]]
23472355
name = "rayon"
23482356
version = "1.1.0"
@@ -4569,6 +4577,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
45694577
"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071"
45704578
"checksum rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "086bd09a33c7044e56bb44d5bdde5a60e7f119a9e95b0775f545de759a32fe05"
45714579
"checksum rand_xorshift 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "effa3fcaa47e18db002bdde6060944b6d2f9cfd8db471c30e873448ad9187be3"
4580+
"checksum rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8"
45724581
"checksum rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a4b0186e22767d5b9738a05eab7c6ac90b15db17e5b5f9bd87976dd7d89a10a4"
45734582
"checksum rayon-core 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ebbe0df8435ac0c397d467b6cad6d25543d06e8a019ef3f6af3c384597515bd2"
45744583
"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"

src/liballoc/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ core = { path = "../libcore" }
1515
compiler_builtins = { version = "0.1.10", features = ['rustc-dep-of-std'] }
1616

1717
[dev-dependencies]
18-
rand = "0.6"
19-
rand_xorshift = "0.1"
18+
rand = "0.7"
19+
rand_xorshift = "0.2"
2020

2121
[[test]]
2222
name = "collectionstests"

src/liballoc/benches/slice.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,12 @@ const SEED: [u8; 16] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
186186

187187
fn gen_random(len: usize) -> Vec<u64> {
188188
let mut rng = XorShiftRng::from_seed(SEED);
189-
rng.sample_iter(&Standard).take(len).collect()
189+
(&mut rng).sample_iter(&Standard).take(len).collect()
190190
}
191191

192192
fn gen_random_bytes(len: usize) -> Vec<u8> {
193193
let mut rng = XorShiftRng::from_seed(SEED);
194-
rng.sample_iter(&Standard).take(len).collect()
194+
(&mut rng).sample_iter(&Standard).take(len).collect()
195195
}
196196

197197
fn gen_mostly_ascending(len: usize) -> Vec<u64> {
@@ -221,14 +221,14 @@ fn gen_strings(len: usize) -> Vec<String> {
221221
let mut v = vec![];
222222
for _ in 0..len {
223223
let n = rng.gen::<usize>() % 20 + 1;
224-
v.push(rng.sample_iter(&Alphanumeric).take(n).collect());
224+
v.push((&mut rng).sample_iter(&Alphanumeric).take(n).collect());
225225
}
226226
v
227227
}
228228

229229
fn gen_big_random(len: usize) -> Vec<[u64; 16]> {
230230
let mut rng = XorShiftRng::from_seed(SEED);
231-
rng.sample_iter(&Standard).map(|x| [x; 16]).take(len).collect()
231+
(&mut rng).sample_iter(&Standard).map(|x| [x; 16]).take(len).collect()
232232
}
233233

234234
macro_rules! sort {

0 commit comments

Comments
 (0)