attempt to work around Box<T> not being recognized as local type
This commit is contained in:
parent
30bb4af5d8
commit
c4ec0cd369
2 changed files with 8 additions and 7 deletions
|
|
@ -71,6 +71,7 @@ use core::ptr::{self, NonNull, Unique};
|
|||
use core::task::{Context, Poll, Spawn, SpawnErrorKind, SpawnObjError};
|
||||
|
||||
use raw_vec::RawVec;
|
||||
use pin::PinBox;
|
||||
use str::from_boxed_utf8_unchecked;
|
||||
|
||||
/// A pointer type for heap allocation.
|
||||
|
|
@ -816,3 +817,10 @@ impl<'a, F: Future<Output = ()> + 'a> From<Box<F>> for LocalFutureObj<'a, ()> {
|
|||
LocalFutureObj::new(boxed)
|
||||
}
|
||||
}
|
||||
|
||||
#[unstable(feature = "pin", issue = "49150")]
|
||||
impl<T: Unpin + ?Sized> From<PinBox<T>> for Box<T> {
|
||||
fn from(pinned: PinBox<T>) -> Box<T> {
|
||||
unsafe { PinBox::unpin(pinned) }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,13 +133,6 @@ impl<T: ?Sized> From<Box<T>> for PinBox<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[unstable(feature = "pin", issue = "49150")]
|
||||
impl<T: Unpin + ?Sized> From<PinBox<T>> for Box<T> {
|
||||
fn from(pinned: PinBox<T>) -> Box<T> {
|
||||
pinned.inner
|
||||
}
|
||||
}
|
||||
|
||||
#[unstable(feature = "pin", issue = "49150")]
|
||||
impl<T: ?Sized> Deref for PinBox<T> {
|
||||
type Target = T;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue