Skip to content

Commit 07f51bc

Browse files
committed
Allow unsized BlockRngCore
1 parent 4172c6e commit 07f51bc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

rand-core/src/impls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ pub fn next_u64_via_fill<R: RngCore + ?Sized>(rng: &mut R) -> u64 {
184184
/// [`RngCore`]: ../RngCore.t.html
185185
/// [`SeedableRng`]: ../SeedableRng.t.html
186186
#[derive(Clone)]
187-
pub struct BlockRng<R: BlockRngCore> {
188-
pub core: R,
187+
pub struct BlockRng<R: BlockRngCore + ?Sized> {
189188
pub results: R::Results,
190189
pub index: usize,
190+
pub core: R,
191191
}
192192

193193
// Custom Debug implementation that does not expose the contents of `results`.

rand-core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ pub trait RngCore {
200200
/// // Final RNG.
201201
/// type MyRng = BlockRng<u32, MyRngCore>;
202202
/// ```
203-
pub trait BlockRngCore: Sized {
203+
pub trait BlockRngCore {
204204
/// Results element type, e.g. `u32`.
205205
type Item;
206206

0 commit comments

Comments
 (0)