@@ -254,7 +254,7 @@ pub trait TryRngCore {
254254// Note that, unfortunately, this blanket impl prevents us from implementing
255255// `TryRngCore` for types which can be dereferenced to `TryRngCore`, i.e. `TryRngCore`
256256// 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 {
258258 type Error = core:: convert:: Infallible ;
259259
260260 #[ inline]
@@ -290,14 +290,14 @@ impl<R: RngCore> TryRngCore for R {
290290/// (like [`OsRng`]) or if the `default()` instance uses a strong, fresh seed.
291291pub trait TryCryptoRng : TryRngCore { }
292292
293- impl < R : CryptoRng > TryCryptoRng for R { }
293+ impl < R : CryptoRng + ? Sized > TryCryptoRng for R { }
294294
295295/// Wrapper around [`TryRngCore`] implementation which implements [`RngCore`]
296296/// by panicking on potential errors.
297297#[ 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 ) ;
299299
300- impl < R : TryRngCore > RngCore for UnwrapErr < R > {
300+ impl < R : TryRngCore + ? Sized > RngCore for UnwrapErr < R > {
301301 #[ inline]
302302 fn next_u32 ( & mut self ) -> u32 {
303303 self . 0 . try_next_u32 ( ) . unwrap ( )
@@ -314,14 +314,14 @@ impl<R: TryRngCore> RngCore for UnwrapErr<R> {
314314 }
315315}
316316
317- impl < R : TryCryptoRng > CryptoRng for UnwrapErr < R > { }
317+ impl < R : TryCryptoRng + ? Sized > CryptoRng for UnwrapErr < R > { }
318318
319319/// Wrapper around [`TryRngCore`] implementation which implements [`RngCore`]
320320/// by panicking on potential errors.
321321#[ derive( Debug , Eq , PartialEq , Hash ) ]
322322pub struct UnwrapMut < ' r , R : TryRngCore + ?Sized > ( pub & ' r mut R ) ;
323323
324- impl < R : TryRngCore > RngCore for UnwrapMut < ' _ , R > {
324+ impl < R : TryRngCore + ? Sized > RngCore for UnwrapMut < ' _ , R > {
325325 #[ inline]
326326 fn next_u32 ( & mut self ) -> u32 {
327327 self . 0 . try_next_u32 ( ) . unwrap ( )
@@ -338,7 +338,7 @@ impl<R: TryRngCore> RngCore for UnwrapMut<'_, R> {
338338 }
339339}
340340
341- impl < R : TryCryptoRng > CryptoRng for UnwrapMut < ' _ , R > { }
341+ impl < R : TryCryptoRng + ? Sized > CryptoRng for UnwrapMut < ' _ , R > { }
342342
343343/// A random number generator that can be explicitly seeded.
344344///
0 commit comments