From b50de1f50c99766f6c86a5411e19ecb7488f51c5 Mon Sep 17 00:00:00 2001 From: est31 Date: Sun, 19 Sep 2021 15:08:24 +0200 Subject: [PATCH] Update rand to 0.8 Removes some duplication. --- Cargo.lock | 12 ++++++------ compiler/rustc_incremental/Cargo.toml | 2 +- library/alloc/Cargo.toml | 4 ++-- library/alloc/benches/slice.rs | 2 +- library/alloc/tests/slice.rs | 2 +- library/core/Cargo.toml | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f119f2050e9aa..39605243ee7fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,7 +39,7 @@ version = "0.0.0" dependencies = [ "compiler_builtins", "core", - "rand 0.7.3", + "rand 0.8.3", "rand_xorshift", ] @@ -714,7 +714,7 @@ dependencies = [ name = "core" version = "0.0.0" dependencies = [ - "rand 0.7.3", + "rand 0.8.3", ] [[package]] @@ -2920,11 +2920,11 @@ dependencies = [ [[package]] name = "rand_xorshift" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" dependencies = [ - "rand_core 0.5.1", + "rand_core 0.6.2", ] [[package]] @@ -3886,7 +3886,7 @@ dependencies = [ name = "rustc_incremental" version = "0.0.0" dependencies = [ - "rand 0.7.3", + "rand 0.8.3", "rustc_ast", "rustc_data_structures", "rustc_errors", diff --git a/compiler/rustc_incremental/Cargo.toml b/compiler/rustc_incremental/Cargo.toml index 9156243a10c0a..9711ac956bf79 100644 --- a/compiler/rustc_incremental/Cargo.toml +++ b/compiler/rustc_incremental/Cargo.toml @@ -9,7 +9,7 @@ doctest = false [dependencies] rustc_graphviz = { path = "../rustc_graphviz" } tracing = "0.1" -rand = "0.7" +rand = "0.8" rustc_middle = { path = "../rustc_middle" } rustc_data_structures = { path = "../rustc_data_structures" } rustc_hir = { path = "../rustc_hir" } diff --git a/library/alloc/Cargo.toml b/library/alloc/Cargo.toml index b3ff0fd0a313c..f07d6f22c0aa5 100644 --- a/library/alloc/Cargo.toml +++ b/library/alloc/Cargo.toml @@ -13,8 +13,8 @@ core = { path = "../core" } compiler_builtins = { version = "0.1.40", features = ['rustc-dep-of-std'] } [dev-dependencies] -rand = "0.7" -rand_xorshift = "0.2" +rand = "0.8" +rand_xorshift = "0.3" [[test]] name = "collectionstests" diff --git a/library/alloc/benches/slice.rs b/library/alloc/benches/slice.rs index e20c043286e6f..3fa281a8d6c7d 100644 --- a/library/alloc/benches/slice.rs +++ b/library/alloc/benches/slice.rs @@ -221,7 +221,7 @@ fn gen_strings(len: usize) -> Vec { let mut v = vec![]; for _ in 0..len { let n = rng.gen::() % 20 + 1; - v.push((&mut rng).sample_iter(&Alphanumeric).take(n).collect()); + v.push((&mut rng).sample_iter(&Alphanumeric).map(char::from).take(n).collect()); } v } diff --git a/library/alloc/tests/slice.rs b/library/alloc/tests/slice.rs index 13b8c059e37ae..887a8652bd934 100644 --- a/library/alloc/tests/slice.rs +++ b/library/alloc/tests/slice.rs @@ -391,7 +391,7 @@ fn test_reverse() { #[test] #[cfg_attr(miri, ignore)] // Miri is too slow fn test_sort() { - let mut rng = thread_rng(); + let mut rng = &mut thread_rng(); for len in (2..25).chain(500..510) { for &modulus in &[5, 10, 100, 1000] { diff --git a/library/core/Cargo.toml b/library/core/Cargo.toml index 6f10b9e434290..80a282929a2cb 100644 --- a/library/core/Cargo.toml +++ b/library/core/Cargo.toml @@ -22,7 +22,7 @@ path = "benches/lib.rs" test = true [dev-dependencies] -rand = "0.7" +rand = "0.8" [features] # Make panics and failed asserts immediately abort without formatting any message