about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-04-19 09:37:33 +0200
committerRalf Jung <post@ralfj.de>2019-08-04 14:50:26 +0200
commit5b78e98a372c323c2dfa5a19bc110f1c81415f8e (patch)
tree48d765aaf70d54824fc1b9c075791df4bcae6318 /src/liballoc
parent5170a3f45af6a7a2a2e46a115daca8f31379b3a8 (diff)
downloadrust-5b78e98a372c323c2dfa5a19bc110f1c81415f8e.tar.gz
rust-5b78e98a372c323c2dfa5a19bc110f1c81415f8e.zip
bump rand to fix Miri failures
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/Cargo.toml4
-rw-r--r--src/liballoc/benches/slice.rs8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/liballoc/Cargo.toml b/src/liballoc/Cargo.toml
index bcb27bb5161..d1119f7b7c0 100644
--- a/src/liballoc/Cargo.toml
+++ b/src/liballoc/Cargo.toml
@@ -15,8 +15,8 @@ core = { path = "../libcore" }
 compiler_builtins = { version = "0.1.10", features = ['rustc-dep-of-std'] }
 
 [dev-dependencies]
-rand = "0.6"
-rand_xorshift = "0.1"
+rand = "0.7"
+rand_xorshift = "0.2"
 
 [[test]]
 name = "collectionstests"
diff --git a/src/liballoc/benches/slice.rs b/src/liballoc/benches/slice.rs
index f17fb8212ce..ef91d801dc7 100644
--- a/src/liballoc/benches/slice.rs
+++ b/src/liballoc/benches/slice.rs
@@ -186,12 +186,12 @@ const SEED: [u8; 16] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
 
 fn gen_random(len: usize) -> Vec<u64> {
     let mut rng = XorShiftRng::from_seed(SEED);
-    rng.sample_iter(&Standard).take(len).collect()
+    (&mut rng).sample_iter(&Standard).take(len).collect()
 }
 
 fn gen_random_bytes(len: usize) -> Vec<u8> {
     let mut rng = XorShiftRng::from_seed(SEED);
-    rng.sample_iter(&Standard).take(len).collect()
+    (&mut rng).sample_iter(&Standard).take(len).collect()
 }
 
 fn gen_mostly_ascending(len: usize) -> Vec<u64> {
@@ -221,14 +221,14 @@ fn gen_strings(len: usize) -> Vec<String> {
     let mut v = vec![];
     for _ in 0..len {
         let n = rng.gen::<usize>() % 20 + 1;
-        v.push(rng.sample_iter(&Alphanumeric).take(n).collect());
+        v.push((&mut rng).sample_iter(&Alphanumeric).take(n).collect());
     }
     v
 }
 
 fn gen_big_random(len: usize) -> Vec<[u64; 16]> {
     let mut rng = XorShiftRng::from_seed(SEED);
-    rng.sample_iter(&Standard).map(|x| [x; 16]).take(len).collect()
+    (&mut rng).sample_iter(&Standard).map(|x| [x; 16]).take(len).collect()
 }
 
 macro_rules! sort {