Skip to content

Commit 81b8a75

Browse files
authored
Merge pull request #1150 from rodrimati1992/master
Added docs about rand's use of const generics
2 parents 46e11cd + d4256fc commit 81b8a75

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ Additionally, these features configure Rand:
128128
- `nightly` enables some optimizations requiring nightly Rust
129129
- `simd_support` (experimental) enables sampling of SIMD values
130130
(uniformly random SIMD integers and floats), requiring nightly Rust
131+
- `min_const_gen` enables generating random arrays of
132+
any size using min-const-generics, requiring Rust ≥ 1.51.
131133

132134
Note that nightly features are not stable and therefore not all library and
133135
compiler versions will be compatible. This is especially true of Rand's

src/distributions/other.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ tuple_impl! {A, B, C, D, E, F, G, H, I, J}
186186
tuple_impl! {A, B, C, D, E, F, G, H, I, J, K}
187187
tuple_impl! {A, B, C, D, E, F, G, H, I, J, K, L}
188188

189+
#[cfg_attr(doc_cfg, doc(cfg(feature = "min_const_gen")))]
189190
#[cfg(feature = "min_const_gen")]
190191
impl<T, const N: usize> Distribution<[T; N]> for Standard
191192
where Standard: Distribution<T>

src/rng.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ macro_rules! impl_fill {
392392
impl_fill!(u16, u32, u64, usize, u128,);
393393
impl_fill!(i8, i16, i32, i64, isize, i128,);
394394

395+
#[cfg_attr(doc_cfg, doc(cfg(feature = "min_const_gen")))]
395396
#[cfg(feature = "min_const_gen")]
396397
impl<T, const N: usize> Fill for [T; N]
397398
where [T]: Fill

0 commit comments

Comments
 (0)