From 3a5bf1af868ec22b7424d2f5b94bc56017ac4a74 Mon Sep 17 00:00:00 2001 From: Vinzent Steinberg Date: Tue, 4 Aug 2020 20:53:11 +0200 Subject: [PATCH] Get rid of "partition_add_index" feature It offers nothing over the "nightly" feature and makes testing more complicated. --- Cargo.toml | 5 +---- src/lib.rs | 2 +- src/seq/index.rs | 8 ++++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ceca059b7ae..1e2268e178e 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 a6e386900b9..bf7f6f82bdf 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))] #![allow( clippy::excessive_precision, clippy::unreadable_literal, 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;