diff --git a/Cargo.toml b/Cargo.toml index 33477f77c92..a1bfb5b5efa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,8 @@ std_rng = ["rand_chacha", "rand_hc"] # Option: enable SmallRng small_rng = [] -# Option: enable generating random arrays of any size using min-const-generics +# Option: for rustc ≥ 1.51, enable generating random arrays of any size +# using min-const-generics min_const_gen = [] [workspace] diff --git a/src/distributions/mod.rs b/src/distributions/mod.rs index 16a6e2412d6..911d1604aae 100644 --- a/src/distributions/mod.rs +++ b/src/distributions/mod.rs @@ -281,6 +281,10 @@ where /// types and tends to be faster for `u32` and smaller types. /// When using `rustc` ≥ 1.51, enable the `min_const_gen` feature to support /// arrays larger than 32 elements. +/// Note that [`Rng::fill`] and `Standard`'s array support are *not* equivalent: +/// the former is optimised for integer types (using fewer RNG calls for +/// element types smaller than the RNG word size), while the latter supports +/// any element type supported by `Standard`. /// * `Option` first generates a `bool`, and if true generates and returns /// `Some(value)` where `value: T`, otherwise returning `None`. ///