@@ -254,7 +254,7 @@ pub trait TryRngCore {
254
254
// Note that, unfortunately, this blanket impl prevents us from implementing
255
255
// `TryRngCore` for types which can be dereferenced to `TryRngCore`, i.e. `TryRngCore`
256
256
// will not be automatically implemented for `&mut R`, `Box<R>`, etc.
257
- impl < R : RngCore > TryRngCore for R {
257
+ impl < R : RngCore + ? Sized > TryRngCore for R {
258
258
type Error = core:: convert:: Infallible ;
259
259
260
260
#[ inline]
@@ -290,14 +290,14 @@ impl<R: RngCore> TryRngCore for R {
290
290
/// (like [`OsRng`]) or if the `default()` instance uses a strong, fresh seed.
291
291
pub trait TryCryptoRng : TryRngCore { }
292
292
293
- impl < R : CryptoRng > TryCryptoRng for R { }
293
+ impl < R : CryptoRng + ? Sized > TryCryptoRng for R { }
294
294
295
295
/// Wrapper around [`TryRngCore`] implementation which implements [`RngCore`]
296
296
/// by panicking on potential errors.
297
297
#[ derive( Debug , Default , Clone , Copy , Eq , PartialEq , Hash ) ]
298
- pub struct UnwrapErr < R : TryRngCore > ( pub R ) ;
298
+ pub struct UnwrapErr < R : TryRngCore + ? Sized > ( pub R ) ;
299
299
300
- impl < R : TryRngCore > RngCore for UnwrapErr < R > {
300
+ impl < R : TryRngCore + ? Sized > RngCore for UnwrapErr < R > {
301
301
#[ inline]
302
302
fn next_u32 ( & mut self ) -> u32 {
303
303
self . 0 . try_next_u32 ( ) . unwrap ( )
@@ -314,14 +314,14 @@ impl<R: TryRngCore> RngCore for UnwrapErr<R> {
314
314
}
315
315
}
316
316
317
- impl < R : TryCryptoRng > CryptoRng for UnwrapErr < R > { }
317
+ impl < R : TryCryptoRng + ? Sized > CryptoRng for UnwrapErr < R > { }
318
318
319
319
/// Wrapper around [`TryRngCore`] implementation which implements [`RngCore`]
320
320
/// by panicking on potential errors.
321
321
#[ derive( Debug , Eq , PartialEq , Hash ) ]
322
322
pub struct UnwrapMut < ' r , R : TryRngCore + ?Sized > ( pub & ' r mut R ) ;
323
323
324
- impl < R : TryRngCore > RngCore for UnwrapMut < ' _ , R > {
324
+ impl < R : TryRngCore + ? Sized > RngCore for UnwrapMut < ' _ , R > {
325
325
#[ inline]
326
326
fn next_u32 ( & mut self ) -> u32 {
327
327
self . 0 . try_next_u32 ( ) . unwrap ( )
@@ -338,7 +338,7 @@ impl<R: TryRngCore> RngCore for UnwrapMut<'_, R> {
338
338
}
339
339
}
340
340
341
- impl < R : TryCryptoRng > CryptoRng for UnwrapMut < ' _ , R > { }
341
+ impl < R : TryCryptoRng + ? Sized > CryptoRng for UnwrapMut < ' _ , R > { }
342
342
343
343
/// A random number generator that can be explicitly seeded.
344
344
///
0 commit comments