diff options
| author | bors <bors@rust-lang.org> | 2018-07-26 17:42:59 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-07-26 17:42:59 +0000 |
| commit | 45b48b9b6d70065a16cc119fe934ed342c664c78 (patch) | |
| tree | ece7180c111f2aa9e0b7fe31a4fe18773d93c693 /src/liballoc | |
| parent | bfbf8375d7b1a4f4fb8a5feb54ae132847d916ad (diff) | |
| parent | 995d7194c1522faf3f6a560ee800156a82c53a24 (diff) | |
| download | rust-45b48b9b6d70065a16cc119fe934ed342c664c78.tar.gz rust-45b48b9b6d70065a16cc119fe934ed342c664c78.zip | |
Auto merge of #52735 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 16 pull requests Successful merges: - #52558 (Add tests for ICEs which no longer repro) - #52610 (Clarify what a task is) - #52617 (Don't match on region kinds when reporting NLL errors) - #52635 (Fix #[linkage] propagation though generic functions) - #52647 (Suggest to take and ignore args while closure args count mismatching) - #52649 (Point spans to inner elements of format strings) - #52654 (Format linker args in a way that works for gcc and ld) - #52667 (update the stdsimd submodule) - #52674 (Impl Executor for Box<E: Executor>) - #52690 (ARM: expose `rclass` and `dsp` target features) - #52692 (Improve readability in a few sorts) - #52695 (Hide some lints which are not quite right the way they are reported to the user) - #52718 (State default capacity for BufReader/BufWriter) - #52721 (std::ops::Try impl for std::task::Poll) - #52723 (rustc: Register crates under their real names) - #52734 (sparc ABI issue - structure returning from function is returned in 64bit registers (with tests)) Failed merges: - #52678 ([NLL] Use better spans in some errors) r? @ghost
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/boxed.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 6d3bc6e79b5..2cf9b13a67a 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -67,7 +67,7 @@ use core::marker::{Unpin, Unsize}; use core::mem::{self, PinMut}; use core::ops::{CoerceUnsized, Deref, DerefMut, Generator, GeneratorState}; use core::ptr::{self, NonNull, Unique}; -use core::task::{Context, Poll}; +use core::task::{Context, Poll, Executor, SpawnErrorKind, SpawnObjError}; use raw_vec::RawVec; use str::from_boxed_utf8_unchecked; @@ -973,6 +973,19 @@ unsafe impl<'a, T, F> UnsafeFutureObj<'a, T> for PinBox<F> } #[unstable(feature = "futures_api", issue = "50547")] +impl<E> Executor for Box<E> + where E: Executor + ?Sized +{ + fn spawn_obj(&mut self, task: FutureObj<'static, ()>) -> Result<(), SpawnObjError> { + (**self).spawn_obj(task) + } + + fn status(&self) -> Result<(), SpawnErrorKind> { + (**self).status() + } +} + +#[unstable(feature = "futures_api", issue = "50547")] impl<'a, F: Future<Output = ()> + Send + 'a> From<PinBox<F>> for FutureObj<'a, ()> { fn from(boxed: PinBox<F>) -> Self { FutureObj::new(boxed) |
