Skip to content

Commit 0cb16f7

Browse files
committed
bump libcore tests to rand 0.7
1 parent 5b78e98 commit 0cb16f7

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

Cargo.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
514514
name = "core"
515515
version = "0.0.0"
516516
dependencies = [
517-
"rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
517+
"rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
518518
]
519519

520520
[[package]]

src/libcore/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ name = "corebenches"
2121
path = "../libcore/benches/lib.rs"
2222

2323
[dev-dependencies]
24-
rand = "0.6"
24+
rand = "0.7"
2525

2626
[features]
2727
# Make panics and failed asserts immediately abort without formatting any message

src/libcore/tests/num/flt2dec/random.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use core::num::flt2dec::strategy::grisu::format_exact_opt;
88
use core::num::flt2dec::strategy::grisu::format_shortest_opt;
99
use core::num::flt2dec::{decode, DecodableFloat, FullDecoded, Decoded};
1010

11-
use rand::FromEntropy;
12-
use rand::rngs::SmallRng;
11+
use rand::SeedableRng;
12+
use rand::rngs::StdRng;
1313
use rand::distributions::{Distribution, Uniform};
1414

1515
pub fn decode_finite<T: DecodableFloat>(v: T) -> Decoded {
@@ -65,7 +65,7 @@ pub fn f32_random_equivalence_test<F, G>(f: F, g: G, k: usize, n: usize)
6565
if cfg!(target_os = "emscripten") {
6666
return // using rng pulls in i128 support, which doesn't work
6767
}
68-
let mut rng = SmallRng::from_entropy();
68+
let mut rng = StdRng::from_entropy();
6969
let f32_range = Uniform::new(0x0000_0001u32, 0x7f80_0000);
7070
iterate("f32_random_equivalence_test", k, n, f, g, |_| {
7171
let x = f32::from_bits(f32_range.sample(&mut rng));
@@ -79,7 +79,7 @@ pub fn f64_random_equivalence_test<F, G>(f: F, g: G, k: usize, n: usize)
7979
if cfg!(target_os = "emscripten") {
8080
return // using rng pulls in i128 support, which doesn't work
8181
}
82-
let mut rng = SmallRng::from_entropy();
82+
let mut rng = StdRng::from_entropy();
8383
let f64_range = Uniform::new(0x0000_0000_0000_0001u64, 0x7ff0_0000_0000_0000);
8484
iterate("f64_random_equivalence_test", k, n, f, g, |_| {
8585
let x = f64::from_bits(f64_range.sample(&mut rng));

src/libcore/tests/slice.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ fn test_rotate_right() {
11571157
fn sort_unstable() {
11581158
use core::cmp::Ordering::{Equal, Greater, Less};
11591159
use core::slice::heapsort;
1160-
use rand::{FromEntropy, Rng, rngs::SmallRng, seq::SliceRandom};
1160+
use rand::{SeedableRng, Rng, rngs::StdRng, seq::SliceRandom};
11611161

11621162
#[cfg(not(miri))] // Miri is too slow
11631163
let large_range = 500..510;
@@ -1171,7 +1171,7 @@ fn sort_unstable() {
11711171

11721172
let mut v = [0; 600];
11731173
let mut tmp = [0; 600];
1174-
let mut rng = SmallRng::from_entropy();
1174+
let mut rng = StdRng::from_entropy();
11751175

11761176
for len in (2..25).chain(large_range) {
11771177
let v = &mut v[0..len];
@@ -1237,11 +1237,11 @@ fn sort_unstable() {
12371237
#[cfg(not(miri))] // Miri is too slow
12381238
fn partition_at_index() {
12391239
use core::cmp::Ordering::{Equal, Greater, Less};
1240-
use rand::rngs::SmallRng;
1240+
use rand::rngs::StdRng;
12411241
use rand::seq::SliceRandom;
1242-
use rand::{FromEntropy, Rng};
1242+
use rand::{SeedableRng, Rng};
12431243

1244-
let mut rng = SmallRng::from_entropy();
1244+
let mut rng = StdRng::from_entropy();
12451245

12461246
for len in (2..21).chain(500..501) {
12471247
let mut orig = vec![0; len];

0 commit comments

Comments
 (0)