1
Fork 0

Auto merge of #51442 - tinaun:more-future-impls, r=cramertj

[futures] add a few blanket impls to std

these were defined in the futures crate, but with the core definitions moving to std these would need to move too.
This commit is contained in:
bors 2018-06-11 20:14:39 +00:00
commit 1d4dbf488a
6 changed files with 110 additions and 0 deletions

View file

@ -914,6 +914,24 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<PinBox<U>> for PinBox<T> {}
#[unstable(feature = "pin", issue = "49150")]
impl<T: ?Sized> Unpin for PinBox<T> {}
#[unstable(feature = "futures_api", issue = "50547")]
impl<'a, F: ?Sized + Future + Unpin> Future for Box<F> {
type Output = F::Output;
fn poll(mut self: PinMut<Self>, cx: &mut Context) -> Poll<Self::Output> {
PinMut::new(&mut **self).poll(cx)
}
}
#[unstable(feature = "futures_api", issue = "50547")]
impl<'a, F: ?Sized + Future> Future for PinBox<F> {
type Output = F::Output;
fn poll(mut self: PinMut<Self>, cx: &mut Context) -> Poll<Self::Output> {
self.as_pin_mut().poll(cx)
}
}
#[unstable(feature = "futures_api", issue = "50547")]
unsafe impl<F: Future<Output = ()> + Send + 'static> UnsafePoll for PinBox<F> {
fn into_raw(self) -> *mut () {

View file

@ -80,6 +80,7 @@
#![cfg_attr(test, feature(rand, test))]
#![feature(allocator_api)]
#![feature(allow_internal_unstable)]
#![feature(arbitrary_self_types)]
#![feature(ascii_ctype)]
#![feature(box_into_raw_non_null)]
#![feature(box_patterns)]