diff --git a/Cargo.toml b/Cargo.toml index d3ea9cf2255..c0d8cba184a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ appveyor = { repository = "rust-random/rand" } [features] # Meta-features: default = ["std", "std_rng"] -nightly = ["simd_support", "partition_at_index"] # enables all features requiring nightly rust +nightly = ["simd_support"] # enables all features requiring nightly rust serde1 = ["serde"] # Option (enabled by default): without "std" rand uses libcore; this option @@ -45,9 +45,6 @@ std_rng = ["rand_chacha", "rand_hc"] # Option: enable SmallRng small_rng = ["rand_pcg"] -# Option (requires nightly): better performance of choose_multiple_weighted -partition_at_index = [] - [workspace] members = [ "rand_core", diff --git a/src/lib.rs b/src/lib.rs index 02c96f53807..ceb501f4b56 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,7 +50,7 @@ #![doc(test(attr(allow(unused_variables), deny(warnings))))] #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(all(feature = "simd_support", feature = "nightly"), feature(stdsimd))] -#![cfg_attr(all(feature = "partition_at_index", feature = "nightly"), feature(slice_partition_at_index))] +#![cfg_attr(feature = "nightly", feature(slice_partition_at_index))] #![cfg_attr(doc_cfg, feature(doc_cfg))] #![allow( clippy::excessive_precision, diff --git a/src/seq/index.rs b/src/seq/index.rs index 5e8a7c7d6b4..427e92641be 100644 --- a/src/seq/index.rs +++ b/src/seq/index.rs @@ -268,7 +268,7 @@ where R: Rng + ?Sized { /// an alternative. /// /// This implementation uses `O(length + amount)` space and `O(length)` time -/// if the "partition_at_index" feature is enabled, or `O(length)` space and +/// if the "nightly" feature is enabled, or `O(length)` space and /// `O(length + amount * log length)` time otherwise. /// /// Panics if `amount > length`. @@ -298,7 +298,7 @@ where /// This implementation uses the algorithm described by Efraimidis and Spirakis /// in this paper: https://doi.org/10.1016/j.ipl.2005.11.003 /// It uses `O(length + amount)` space and `O(length)` time if the -/// "partition_at_index" feature is enabled, or `O(length)` space and `O(length +/// "nightly" feature is enabled, or `O(length)` space and `O(length /// + amount * log length)` time otherwise. /// /// Panics if `amount > length`. @@ -342,7 +342,7 @@ where } impl Eq for Element {} - #[cfg(feature = "partition_at_index")] + #[cfg(feature = "nightly")] { let mut candidates = Vec::with_capacity(length.as_usize()); for index in 0..length.as_usize() { @@ -370,7 +370,7 @@ where Ok(IndexVec::from(result)) } - #[cfg(not(feature = "partition_at_index"))] + #[cfg(not(feature = "nightly"))] { #[cfg(all(feature = "alloc", not(feature = "std")))] use crate::alloc::collections::BinaryHeap;