File tree 5 files changed +9
-9
lines changed
5 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -533,13 +533,13 @@ mod tests {
533
533
#[ test]
534
534
fn downcasting ( ) {
535
535
let mut a = A ;
536
- let a = & mut a as & mut ( Error + ' static ) ;
536
+ let a = & mut a as & mut ( dyn Error + ' static ) ;
537
537
assert_eq ! ( a. downcast_ref:: <A >( ) , Some ( & A ) ) ;
538
538
assert_eq ! ( a. downcast_ref:: <B >( ) , None ) ;
539
539
assert_eq ! ( a. downcast_mut:: <A >( ) , Some ( & mut A ) ) ;
540
540
assert_eq ! ( a. downcast_mut:: <B >( ) , None ) ;
541
541
542
- let a: Box < Error > = Box :: new ( A ) ;
542
+ let a: Box < dyn Error > = Box :: new ( A ) ;
543
543
match a. downcast :: < B > ( ) {
544
544
Ok ( ..) => panic ! ( "expected error" ) ,
545
545
Err ( e) => assert_eq ! ( * e. downcast:: <A >( ) . unwrap( ) , A ) ,
Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ mod tests {
223
223
assert_eq ! ( copy( & mut r, & mut w) . unwrap( ) , 4 ) ;
224
224
225
225
let mut r = repeat ( 0 ) . take ( 1 << 17 ) ;
226
- assert_eq ! ( copy( & mut r as & mut Read , & mut w as & mut Write ) . unwrap( ) , 1 << 17 ) ;
226
+ assert_eq ! ( copy( & mut r as & mut dyn Read , & mut w as & mut dyn Write ) . unwrap( ) , 1 << 17 ) ;
227
227
}
228
228
229
229
#[ test]
Original file line number Diff line number Diff line change @@ -927,7 +927,7 @@ mod tests {
927
927
use time:: { Instant , Duration } ;
928
928
use thread;
929
929
930
- fn each_ip ( f : & mut FnMut ( SocketAddr ) ) {
930
+ fn each_ip ( f : & mut dyn FnMut ( SocketAddr ) ) {
931
931
f ( next_test_ip4 ( ) ) ;
932
932
f ( next_test_ip6 ( ) ) ;
933
933
}
Original file line number Diff line number Diff line change @@ -826,7 +826,7 @@ mod tests {
826
826
use time:: { Instant , Duration } ;
827
827
use thread;
828
828
829
- fn each_ip ( f : & mut FnMut ( SocketAddr , SocketAddr ) ) {
829
+ fn each_ip ( f : & mut dyn FnMut ( SocketAddr , SocketAddr ) ) {
830
830
f ( next_test_ip4 ( ) , next_test_ip4 ( ) ) ;
831
831
f ( next_test_ip6 ( ) , next_test_ip6 ( ) ) ;
832
832
}
Original file line number Diff line number Diff line change @@ -1438,7 +1438,7 @@ mod tests {
1438
1438
rx. recv ( ) . unwrap ( ) ;
1439
1439
}
1440
1440
1441
- fn avoid_copying_the_body < F > ( spawnfn : F ) where F : FnOnce ( Box < Fn ( ) + Send > ) {
1441
+ fn avoid_copying_the_body < F > ( spawnfn : F ) where F : FnOnce ( Box < dyn Fn ( ) + Send > ) {
1442
1442
let ( tx, rx) = channel ( ) ;
1443
1443
1444
1444
let x: Box < _ > = box 1 ;
@@ -1485,7 +1485,7 @@ mod tests {
1485
1485
// (well, it would if the constant were 8000+ - I lowered it to be more
1486
1486
// valgrind-friendly. try this at home, instead..!)
1487
1487
const GENERATIONS : u32 = 16 ;
1488
- fn child_no ( x : u32 ) -> Box < Fn ( ) + Send > {
1488
+ fn child_no ( x : u32 ) -> Box < dyn Fn ( ) + Send > {
1489
1489
return Box :: new ( move || {
1490
1490
if x < GENERATIONS {
1491
1491
thread:: spawn ( move || child_no ( x+1 ) ( ) ) ;
@@ -1531,10 +1531,10 @@ mod tests {
1531
1531
#[ test]
1532
1532
fn test_try_panic_message_any ( ) {
1533
1533
match thread:: spawn ( move || {
1534
- panic ! ( box 413u16 as Box <Any + Send >) ;
1534
+ panic ! ( box 413u16 as Box <dyn Any + Send >) ;
1535
1535
} ) . join ( ) {
1536
1536
Err ( e) => {
1537
- type T = Box < Any + Send > ;
1537
+ type T = Box < dyn Any + Send > ;
1538
1538
assert ! ( e. is:: <T >( ) ) ;
1539
1539
let any = e. downcast :: < T > ( ) . unwrap ( ) ;
1540
1540
assert ! ( any. is:: <u16 >( ) ) ;
You can’t perform that action at this time.
0 commit comments