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 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 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