Skip to content

Commit

Permalink
Merge pull request #1150 from rodrimati1992/master
Browse files Browse the repository at this point in the history
Added docs about rand's use of const generics
  • Loading branch information
dhardy committed Jul 26, 2021
2 parents 46e11cd + d4256fc commit 81b8a75
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/distributions/other.rs
Expand Up @@ -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<T, const N: usize> Distribution<[T; N]> for Standard
where Standard: Distribution<T>
Expand Down
1 change: 1 addition & 0 deletions src/rng.rs
Expand Up @@ -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<T, const N: usize> Fill for [T; N]
where [T]: Fill
Expand Down

0 comments on commit 81b8a75

Please sign in to comment.