diff options
| author | bors <bors@rust-lang.org> | 2018-09-05 03:04:20 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-09-05 03:04:20 +0000 |
| commit | 0be2c303692cab31390e52701007cfa87867bf74 (patch) | |
| tree | a7a48f343f3573463febf77234d4d674f524d522 /src/libstd | |
| parent | f68b7cc59896427d378c9e3bae6f5fd7a1f1fad9 (diff) | |
| parent | 9ec5ef541ad17986bfe6ae067a84ea8f7b7ae133 (diff) | |
| download | rust-0be2c303692cab31390e52701007cfa87867bf74.tar.gz rust-0be2c303692cab31390e52701007cfa87867bf74.zip | |
Auto merge of #53075 - Mark-Simulacrum:update-cargolock, r=alexcrichton
Update Cargo.lock This also includes major version bumps for the rand crate used by core, std, and alloc tests, among other crates (regex, etc.) used elsewhere. Since these are all internal there should be no user-visible changes. r? @alexcrichton
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/Cargo.toml | 2 | ||||
| -rw-r--r-- | src/libstd/fs.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sync/rwlock.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys_common/io.rs | 2 | ||||
| -rw-r--r-- | src/libstd/tests/env.rs | 7 |
5 files changed, 10 insertions, 9 deletions
diff --git a/src/libstd/Cargo.toml b/src/libstd/Cargo.toml index 5348c9a0f34..bcdd1b4b088 100644 --- a/src/libstd/Cargo.toml +++ b/src/libstd/Cargo.toml @@ -25,7 +25,7 @@ profiler_builtins = { path = "../libprofiler_builtins", optional = true } unwind = { path = "../libunwind" } [dev-dependencies] -rand = "0.4" +rand = "0.5" [target.x86_64-apple-darwin.dependencies] rustc_asan = { path = "../librustc_asan" } diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index 7632fbc41f5..e177d4a988a 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -2076,7 +2076,7 @@ mod tests { use fs::{self, File, OpenOptions}; use io::{ErrorKind, SeekFrom}; use path::Path; - use rand::{StdRng, Rng}; + use rand::{StdRng, FromEntropy, RngCore}; use str; use sys_common::io::test::{TempDir, tmpdir}; use thread; @@ -3110,7 +3110,7 @@ mod tests { #[test] fn binary_file() { let mut bytes = [0; 1024]; - StdRng::new().unwrap().fill_bytes(&mut bytes); + StdRng::from_entropy().fill_bytes(&mut bytes); let tmpdir = tmpdir(); @@ -3123,7 +3123,7 @@ mod tests { #[test] fn write_then_read() { let mut bytes = [0; 1024]; - StdRng::new().unwrap().fill_bytes(&mut bytes); + StdRng::from_entropy().fill_bytes(&mut bytes); let tmpdir = tmpdir(); diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index e3db60cff84..ed3a3865a6c 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -597,7 +597,7 @@ mod tests { thread::spawn(move || { let mut rng = rand::thread_rng(); for _ in 0..M { - if rng.gen_weighted_bool(N) { + if rng.gen_bool(1.0 / (N as f64)) { drop(r.write().unwrap()); } else { drop(r.read().unwrap()); diff --git a/src/libstd/sys_common/io.rs b/src/libstd/sys_common/io.rs index ab23936358e..a96fb192139 100644 --- a/src/libstd/sys_common/io.rs +++ b/src/libstd/sys_common/io.rs @@ -14,7 +14,7 @@ pub const DEFAULT_BUF_SIZE: usize = 8 * 1024; pub mod test { use path::{Path, PathBuf}; use env; - use rand::{self, Rng}; + use rand::{self, RngCore}; use fs; pub struct TempDir(PathBuf); diff --git a/src/libstd/tests/env.rs b/src/libstd/tests/env.rs index 8acb8a46d7b..7302a794480 100644 --- a/src/libstd/tests/env.rs +++ b/src/libstd/tests/env.rs @@ -13,11 +13,12 @@ extern crate rand; use std::env::*; use std::ffi::{OsString, OsStr}; -use rand::Rng; +use rand::{thread_rng, Rng}; +use rand::distributions::Alphanumeric; fn make_rand_name() -> OsString { - let mut rng = rand::thread_rng(); - let n = format!("TEST{}", rng.gen_ascii_chars().take(10) + let mut rng = thread_rng(); + let n = format!("TEST{}", rng.sample_iter(&Alphanumeric).take(10) .collect::<String>()); let n = OsString::from(n); assert!(var_os(&n).is_none()); |
