diff options
Diffstat (limited to 'library/alloc/src/sync.rs')
| -rw-r--r-- | library/alloc/src/sync.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index b8925f4544f..29caa7bc539 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -3654,6 +3654,19 @@ impl<T> Default for Arc<[T]> { } } +#[cfg(not(no_global_oom_handling))] +#[stable(feature = "pin_default_impls", since = "CURRENT_RUSTC_VERSION")] +impl<T> Default for Pin<Arc<T>> +where + T: ?Sized, + Arc<T>: Default, +{ + #[inline] + fn default() -> Self { + unsafe { Pin::new_unchecked(Arc::<T>::default()) } + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl<T: ?Sized + Hash, A: Allocator> Hash for Arc<T, A> { fn hash<H: Hasher>(&self, state: &mut H) { |
