File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -637,7 +637,7 @@ pub trait Rng {
637
637
}
638
638
}
639
639
640
- impl < ' a , R : ?Sized > Rng for & ' a mut R where R : Rng {
640
+ impl < ' a , R : Rng + ?Sized > Rng for & ' a mut R {
641
641
#[ inline]
642
642
fn next_u32 ( & mut self ) -> u32 {
643
643
( * * self ) . next_u32 ( )
@@ -670,7 +670,7 @@ impl<'a, R: ?Sized> Rng for &'a mut R where R: Rng {
670
670
}
671
671
672
672
#[ cfg( any( feature="std" , feature="alloc" ) ) ]
673
- impl < R : ?Sized > Rng for Box < R > where R : Rng {
673
+ impl < R : Rng + ?Sized > Rng for Box < R > {
674
674
#[ inline]
675
675
fn next_u32 ( & mut self ) -> u32 {
676
676
( * * self ) . next_u32 ( )
@@ -1389,12 +1389,13 @@ mod test {
1389
1389
{
1390
1390
let mut r = & mut rng as & mut Rng ;
1391
1391
r. next_u32 ( ) ;
1392
- ( & mut r) . gen :: < i32 > ( ) ;
1392
+ let r2 = & mut r;
1393
+ r2. gen :: < i32 > ( ) ;
1393
1394
let mut v = [ 1 , 1 , 1 ] ;
1394
- ( & mut r ) . shuffle ( & mut v) ;
1395
+ r2 . shuffle ( & mut v) ;
1395
1396
let b: & [ _ ] = & [ 1 , 1 , 1 ] ;
1396
1397
assert_eq ! ( v, b) ;
1397
- assert_eq ! ( ( & mut r ) . gen_range( 0 , 1 ) , 0 ) ;
1398
+ assert_eq ! ( r2 . gen_range( 0 , 1 ) , 0 ) ;
1398
1399
}
1399
1400
{
1400
1401
let mut r = Box :: new ( rng) as Box < Rng > ;
You can’t perform that action at this time.
0 commit comments