diff options
Diffstat (limited to 'src/liballoc/sync.rs')
| -rw-r--r-- | src/liballoc/sync.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs index ac709a15aaa..c1a1e6f1591 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 } } + /// 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 pinned(data: T) -> Pin<Arc<T>> { + pub fn pin(data: T) -> Pin<Arc<T>> { unsafe { Pin::new_unchecked(Arc::new(data)) } } |
