File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,20 @@ mod test {
155155 // NOTE: Some distributions have tests checking only that samples can be
156156 // generated. This is redundant with vector and correctness tests.
157157
158+ /// An RNG which panics on first use
159+ pub struct VoidRng ;
160+ impl rand:: RngCore for VoidRng {
161+ fn next_u32 ( & mut self ) -> u32 {
162+ panic ! ( "usage of VoidRng" )
163+ }
164+ fn next_u64 ( & mut self ) -> u64 {
165+ panic ! ( "usage of VoidRng" )
166+ }
167+ fn fill_bytes ( & mut self , _: & mut [ u8 ] ) {
168+ panic ! ( "usage of VoidRng" )
169+ }
170+ }
171+
158172 /// Construct a deterministic RNG with the given seed
159173 pub fn rng ( seed : u64 ) -> impl rand:: RngCore {
160174 // For tests, we want a statistically good, fast, reproducible RNG.
You can’t perform that action at this time.
0 commit comments