From 82b819ab678ce38ebee2878961ffa78608f19b32 Mon Sep 17 00:00:00 2001 From: rodrimati1992 Date: Sun, 25 Jul 2021 18:42:43 -0300 Subject: [PATCH 1/3] Documented needed crate feature --- src/rng.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rng.rs b/src/rng.rs index 610dfe28359..79a9fbff46e 100644 --- a/src/rng.rs +++ b/src/rng.rs @@ -392,6 +392,7 @@ macro_rules! impl_fill { impl_fill!(u16, u32, u64, usize, u128,); impl_fill!(i8, i16, i32, i64, isize, i128,); +#[cfg_attr(doc_cfg, doc(cfg(feature = "min_const_gen")))] #[cfg(feature = "min_const_gen")] impl Fill for [T; N] where [T]: Fill From a36047f0dc3225ff5e7cdeec249d87c36d605e33 Mon Sep 17 00:00:00 2001 From: rodrimati1992 Date: Sun, 25 Jul 2021 18:44:25 -0300 Subject: [PATCH 2/3] Documented needed crate feature --- src/distributions/other.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/distributions/other.rs b/src/distributions/other.rs index 71fb267f8b5..0935d055b3e 100644 --- a/src/distributions/other.rs +++ b/src/distributions/other.rs @@ -186,6 +186,7 @@ tuple_impl! {A, B, C, D, E, F, G, H, I, J} tuple_impl! {A, B, C, D, E, F, G, H, I, J, K} tuple_impl! {A, B, C, D, E, F, G, H, I, J, K, L} +#[cfg_attr(doc_cfg, doc(cfg(feature = "min_const_gen")))] #[cfg(feature = "min_const_gen")] impl Distribution<[T; N]> for Standard where Standard: Distribution From d4256fcc6df77eb8da68ada74be5c30f040fe9ad Mon Sep 17 00:00:00 2001 From: rodrimati1992 Date: Sun, 25 Jul 2021 18:53:19 -0300 Subject: [PATCH 3/3] Added min_const_gen feature to README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2f313e39ca9..c6834824a1e 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,8 @@ Additionally, these features configure Rand: - `nightly` enables some optimizations requiring nightly Rust - `simd_support` (experimental) enables sampling of SIMD values (uniformly random SIMD integers and floats), requiring nightly Rust +- `min_const_gen` enables generating random arrays of + any size using min-const-generics, requiring Rust ≥ 1.51. Note that nightly features are not stable and therefore not all library and compiler versions will be compatible. This is especially true of Rand's