|
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 |
| - |
| 1 | +diff --git a/library/alloc/Cargo.toml b/library/alloc/Cargo.toml |
| 2 | +index 265020209eb..86e12f323d8 100644 |
7 | 3 | --- a/library/alloc/Cargo.toml
|
8 | 4 | +++ b/library/alloc/Cargo.toml
|
9 | 5 | @@ -13,8 +13,8 @@ core = { path = "../core" }
|
@@ -93,3 +89,55 @@ index 3c01e2998cd..bb61224b5ba 100644
|
93 | 89 | if x != 0 { x } else { 1 }
|
94 | 90 | })
|
95 | 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