Skip to content

Commit 949d70f

Browse files
committed
fix doc test
1 parent 2fab15d commit 949d70f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/distributions/other.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,12 @@ impl Distribution<bool> for Standard {
163163
///
164164
/// Since most bits are unused you could also generate only as many bits as you need, i.e.:
165165
/// ```
166-
/// let x = u16x8::splat(rng.gen::<u8> as u16);
166+
/// #![feature(portable_simd)]
167+
/// use std::simd::*;
168+
/// use rand::prelude::*;
169+
/// let mut rng = thread_rng();
170+
///
171+
/// let x = u16x8::splat(rng.gen::<u8>() as u16);
167172
/// let mask = u16x8::splat(1) << u16x8::from([0, 1, 2, 3, 4, 5, 6, 7]);
168173
/// let rand_mask = (x & mask).simd_eq(mask);
169174
/// ```

0 commit comments

Comments
 (0)