diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2018-12-23 23:09:04 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-23 23:09:04 +0100 |
| commit | 93af1e73696c82de22eb445423f10df35130dded (patch) | |
| tree | deaa2f71918324d93ea6196f7fc4834bff83ec16 /src/liballoc/sync.rs | |
| parent | 6ce5ecbc2a6c7e323f8194229327c179cb7d976d (diff) | |
| parent | 861df06e077bb17c2d22ab978e37ee2c5350ff9b (diff) | |
| download | rust-93af1e73696c82de22eb445423f10df35130dded.tar.gz rust-93af1e73696c82de22eb445423f10df35130dded.zip | |
Rollup merge of #56939 - cramertj:pin-stabilization, r=alexcrichton
Pin stabilization This implements the changes suggested in https://github.com/rust-lang/rust/issues/55766#issue-378417538 and stabilizes the `pin` feature. @alexcrichton also listed several "blockers" in that issue, but then in [this comment](https://github.com/rust-lang/rust/issues/55766#issuecomment-445074980) mentioned that they're more "TODO items": > In that vein I think it's fine for a stabilization PR to be posted at any time now with FCP lapsed for a week or so now. The final points about self/pin/pinned can be briefly discussed there (if even necessary, they could be left as the proposal above). Let's settle these last bits here and get this thing stabilized! :) r? @alexcrichton cc @withoutboats
Diffstat (limited to 'src/liballoc/sync.rs')
| -rw-r--r-- | src/liballoc/sync.rs | 8 |
1 files changed, 5 insertions, 3 deletions
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> { } |
