1
Fork 0

Implement Unpin for Box, Rc, and Arc

This commit is contained in:
Without Boats 2018-09-01 01:54:59 +02:00
parent aaa170bebe
commit c3bdd76047
No known key found for this signature in database
GPG key ID: 174625E5E877C0D9
3 changed files with 11 additions and 2 deletions

View file

@ -749,6 +749,9 @@ impl<T: ?Sized> AsMut<T> for Box<T> {
}
}
#[unstable(feature = "pin", issue = "49150")]
impl<T: ?Sized> Unpin for Box<T> { }
#[unstable(feature = "generator_trait", issue = "43122")]
impl<T> Generator for Box<T>
where T: Generator + ?Sized

View file

@ -252,7 +252,7 @@ use core::fmt;
use core::hash::{Hash, Hasher};
use core::intrinsics::abort;
use core::marker;
use core::marker::{Unsize, PhantomData};
use core::marker::{Unpin, Unsize, PhantomData};
use core::mem::{self, align_of_val, forget, size_of_val};
use core::ops::Deref;
use core::ops::CoerceUnsized;
@ -1830,3 +1830,6 @@ impl<T: ?Sized> AsRef<T> for Rc<T> {
&**self
}
}
#[unstable(feature = "pin", issue = "49150")]
impl<T: ?Sized> Unpin for Box<T> { }

View file

@ -27,7 +27,7 @@ use core::mem::{self, align_of_val, size_of_val};
use core::ops::Deref;
use core::ops::CoerceUnsized;
use core::ptr::{self, NonNull};
use core::marker::{Unsize, PhantomData};
use core::marker::{Unpin, Unsize, PhantomData};
use core::hash::{Hash, Hasher};
use core::{isize, usize};
use core::convert::From;
@ -1942,3 +1942,6 @@ impl<T: ?Sized> AsRef<T> for Arc<T> {
&**self
}
}
#[unstable(feature = "pin", issue = "49150")]
impl<T: ?Sized> Unpin for Arc<T> { }