diff options
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/boxed.rs | 10 | ||||
| -rw-r--r-- | src/liballoc/lib.rs | 1 | ||||
| -rw-r--r-- | src/liballoc/rc.rs | 8 | ||||
| -rw-r--r-- | src/liballoc/sync.rs | 8 |
4 files changed, 16 insertions, 11 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index f1581310b48..7438f3e6c9d 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -111,9 +111,11 @@ impl<T> Box<T> { box x } - #[unstable(feature = "pin", issue = "49150")] + /// Constructs a new `Pin<Box<T>>`. If `T` does not implement `Unpin`, then + /// `x` will be pinned in memory and unable to be moved. + #[stable(feature = "pin", since = "1.33.0")] #[inline(always)] - pub fn pinned(x: T) -> Pin<Box<T>> { + pub fn pin(x: T) -> Pin<Box<T>> { (box x).into() } } @@ -446,7 +448,7 @@ impl<T> From<T> for Box<T> { } } -#[unstable(feature = "pin", issue = "49150")] +#[stable(feature = "pin", since = "1.33.0")] impl<T> From<Box<T>> for Pin<Box<T>> { fn from(boxed: Box<T>) -> Self { // It's not possible to move or replace the insides of a `Pin<Box<T>>` @@ -813,7 +815,7 @@ impl<T: ?Sized> AsMut<T> for Box<T> { * implementation of `Unpin` (where `T: Unpin`) would be valid/safe, and * could have a method to project a Pin<T> from it. */ -#[unstable(feature = "pin", issue = "49150")] +#[stable(feature = "pin", since = "1.33.0")] impl<T: ?Sized> Unpin for Box<T> { } #[unstable(feature = "generator_trait", issue = "43122")] diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index afa7a6f919d..8a66cafc001 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -102,7 +102,6 @@ #![feature(nll)] #![feature(optin_builtin_traits)] #![feature(pattern)] -#![feature(pin)] #![feature(ptr_internals)] #![feature(ptr_offset_from)] #![feature(rustc_attrs)] diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 65a610b9d1e..af316b0b61b 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -325,8 +325,10 @@ impl<T> Rc<T> { } } - #[unstable(feature = "pin", issue = "49150")] - pub fn pinned(value: T) -> Pin<Rc<T>> { + /// Constructs a new `Pin<Rc<T>>`. If `T` does not implement `Unpin`, then + /// `value` will be pinned in memory and unable to be moved. + #[stable(feature = "pin", since = "1.33.0")] + pub fn pin(value: T) -> Pin<Rc<T>> { unsafe { Pin::new_unchecked(Rc::new(value)) } } @@ -1934,5 +1936,5 @@ impl<T: ?Sized> AsRef<T> for Rc<T> { } } -#[unstable(feature = "pin", issue = "49150")] +#[stable(feature = "pin", since = "1.33.0")] impl<T: ?Sized> Unpin for Rc<T> { } diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs index 948c36117a3..7b8afb1943c 100644 --- a/src/liballoc/sync.rs +++ b/src/liballoc/sync.rs @@ -303,8 +303,10 @@ impl<T> Arc<T> { Arc { ptr: Box::into_raw_non_null(x), phantom: PhantomData } } - #[unstable(feature = "pin", issue = "49150")] - pub fn pinned(data: T) -> Pin<Arc<T>> { + /// Constructs a new `Pin<Arc<T>>`. If `T` does not implement `Unpin`, then + /// `data` will be pinned in memory and unable to be moved. + #[stable(feature = "pin", since = "1.33.0")] + pub fn pin(data: T) -> Pin<Arc<T>> { unsafe { Pin::new_unchecked(Arc::new(data)) } } @@ -2050,5 +2052,5 @@ impl<T: ?Sized> AsRef<T> for Arc<T> { } } -#[unstable(feature = "pin", issue = "49150")] +#[stable(feature = "pin", since = "1.33.0")] impl<T: ?Sized> Unpin for Arc<T> { } |
