@@ -67,7 +67,7 @@ use core::marker::{Unpin, Unsize};
67
67
use core:: mem:: { self , PinMut } ;
68
68
use core:: ops:: { CoerceUnsized , Deref , DerefMut , Generator , GeneratorState } ;
69
69
use core:: ptr:: { self , NonNull , Unique } ;
70
- use core:: task:: { Context , Poll } ;
70
+ use core:: task:: { Context , Poll , Executor , SpawnErrorKind , SpawnObjError } ;
71
71
72
72
use raw_vec:: RawVec ;
73
73
use str:: from_boxed_utf8_unchecked;
@@ -972,6 +972,19 @@ unsafe impl<'a, T, F> UnsafeFutureObj<'a, T> for PinBox<F>
972
972
}
973
973
}
974
974
975
+ #[ unstable( feature = "futures_api" , issue = "50547" ) ]
976
+ impl < E > Executor for Box < E >
977
+ where E : Executor + ?Sized
978
+ {
979
+ fn spawn_obj ( & mut self , task : FutureObj < ' static , ( ) > ) -> Result < ( ) , SpawnObjError > {
980
+ ( * * self ) . spawn_obj ( task)
981
+ }
982
+
983
+ fn status ( & self ) -> Result < ( ) , SpawnErrorKind > {
984
+ ( * * self ) . status ( )
985
+ }
986
+ }
987
+
975
988
#[ unstable( feature = "futures_api" , issue = "50547" ) ]
976
989
impl < ' a , F : Future < Output = ( ) > + Send + ' a > From < PinBox < F > > for FutureObj < ' a , ( ) > {
977
990
fn from ( boxed : PinBox < F > ) -> Self {
0 commit comments