From be4806e41a6d6a4d43d8f95d32a7544099bfb910 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Thu, 17 Jan 2019 12:45:44 +0900 Subject: [PATCH] Update rand dependency --- futures-select-macro/src/lib.rs | 4 ++-- futures-util/Cargo.toml | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/futures-select-macro/src/lib.rs b/futures-select-macro/src/lib.rs index 0bd4d7d4a4..12921159d1 100644 --- a/futures-select-macro/src/lib.rs +++ b/futures-select-macro/src/lib.rs @@ -259,9 +259,9 @@ pub fn select(input: TokenStream) -> TokenStream { #( #poll_functions )* let mut __select_arr = [#( #variant_names ),*]; - #rand_crate::Rng::shuffle( - &mut #rand_crate::thread_rng(), + <[_] as #rand_crate::prelude::SliceRandom>::shuffle( &mut __select_arr, + &mut #rand_crate::thread_rng(), ); for poller in &mut __select_arr { let poller: &mut &mut dyn FnMut( diff --git a/futures-util/Cargo.toml b/futures-util/Cargo.toml index a110d9a519..421d2c0924 100644 --- a/futures-util/Cargo.toml +++ b/futures-util/Cargo.toml @@ -15,7 +15,7 @@ Common utilities and extension traits for the futures-rs library. name = "futures_util" [features] -std = ["futures-core-preview/std", "futures-io-preview/std", "futures-sink-preview/std", "futures-select-macro-preview/std", "either/use_std", "rand", "slab"] +std = ["futures-core-preview/std", "futures-io-preview/std", "futures-sink-preview/std", "futures-select-macro-preview/std", "either/use_std", "rand", "rand_core", "slab"] default = ["std", "futures-core-preview/either", "futures-sink-preview/either"] compat = ["std", "futures_01"] io-compat = ["compat", "tokio-io"] @@ -32,7 +32,8 @@ futures-select-macro-preview = { path = "../futures-select-macro", version = "=0 either = { version = "1.4", default-features = false } proc-macro-hack = "0.5" proc-macro-nested = "0.1.2" -rand = { version = "0.5.5", optional = true } +rand = { version = "0.6.4", optional = true } +rand_core = { version = ">=0.2.2, <0.4", optional = true } # See https://github.com/rust-random/rand/issues/645 slab = { version = "0.4", optional = true } futures_01 = { version = "0.1.25", optional = true, package = "futures" } tokio-executor = { version = "0.1.2", optional = true }