@@ -446,7 +446,7 @@ impl From<Box<str>> for Box<[u8]> {
446
446
}
447
447
}
448
448
449
- impl Box < Any > {
449
+ impl Box < dyn Any > {
450
450
#[ inline]
451
451
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
452
452
/// Attempt to downcast the box to a concrete type.
@@ -468,10 +468,10 @@ impl Box<Any> {
468
468
/// print_if_string(Box::new(0i8));
469
469
/// }
470
470
/// ```
471
- pub fn downcast < T : Any > ( self ) -> Result < Box < T > , Box < Any > > {
471
+ pub fn downcast < T : Any > ( self ) -> Result < Box < T > , Box < dyn Any > > {
472
472
if self . is :: < T > ( ) {
473
473
unsafe {
474
- let raw: * mut Any = Box :: into_raw ( self ) ;
474
+ let raw: * mut dyn Any = Box :: into_raw ( self ) ;
475
475
Ok ( Box :: from_raw ( raw as * mut T ) )
476
476
}
477
477
} else {
@@ -480,7 +480,7 @@ impl Box<Any> {
480
480
}
481
481
}
482
482
483
- impl Box < Any + Send > {
483
+ impl Box < dyn Any + Send > {
484
484
#[ inline]
485
485
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
486
486
/// Attempt to downcast the box to a concrete type.
@@ -502,10 +502,10 @@ impl Box<Any + Send> {
502
502
/// print_if_string(Box::new(0i8));
503
503
/// }
504
504
/// ```
505
- pub fn downcast < T : Any > ( self ) -> Result < Box < T > , Box < Any + Send > > {
506
- <Box < Any > >:: downcast ( self ) . map_err ( |s| unsafe {
505
+ pub fn downcast < T : Any > ( self ) -> Result < Box < T > , Box < dyn Any + Send > > {
506
+ <Box < dyn Any > >:: downcast ( self ) . map_err ( |s| unsafe {
507
507
// reapply the Send marker
508
- Box :: from_raw ( Box :: into_raw ( s) as * mut ( Any + Send ) )
508
+ Box :: from_raw ( Box :: into_raw ( s) as * mut ( dyn Any + Send ) )
509
509
} )
510
510
}
511
511
}
@@ -643,7 +643,7 @@ impl<A, F> FnBox<A> for F
643
643
644
644
#[ unstable( feature = "fnbox" ,
645
645
reason = "will be deprecated if and when `Box<FnOnce>` becomes usable" , issue = "28796" ) ]
646
- impl < ' a , A , R > FnOnce < A > for Box < FnBox < A , Output = R > + ' a > {
646
+ impl < ' a , A , R > FnOnce < A > for Box < dyn FnBox < A , Output = R > + ' a > {
647
647
type Output = R ;
648
648
649
649
extern "rust-call" fn call_once ( self , args : A ) -> R {
@@ -653,7 +653,7 @@ impl<'a, A, R> FnOnce<A> for Box<FnBox<A, Output = R> + 'a> {
653
653
654
654
#[ unstable( feature = "fnbox" ,
655
655
reason = "will be deprecated if and when `Box<FnOnce>` becomes usable" , issue = "28796" ) ]
656
- impl < ' a , A , R > FnOnce < A > for Box < FnBox < A , Output = R > + Send + ' a > {
656
+ impl < ' a , A , R > FnOnce < A > for Box < dyn FnBox < A , Output = R > + Send + ' a > {
657
657
type Output = R ;
658
658
659
659
extern "rust-call" fn call_once ( self , args : A ) -> R {
0 commit comments