From d495b84a9a5a0bfcfe353c53b332664c7414e315 Mon Sep 17 00:00:00 2001 From: Xiangfei Ding Date: Mon, 13 May 2024 03:16:31 +0800 Subject: PinCoerceUnsized trait into core --- library/alloc/src/sync.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'library/alloc/src/sync.rs') diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 3ad0dae77db..2c0d19b0ada 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -20,7 +20,7 @@ use core::marker::{PhantomData, Unsize}; use core::mem::{self, align_of_val_raw, ManuallyDrop}; use core::ops::{CoerceUnsized, Deref, DerefPure, DispatchFromDyn, Receiver}; use core::panic::{RefUnwindSafe, UnwindSafe}; -use core::pin::Pin; +use core::pin::{Pin, PinCoerceUnsized}; use core::ptr::{self, NonNull}; #[cfg(not(no_global_oom_handling))] use core::slice::from_raw_parts_mut; @@ -2142,6 +2142,12 @@ impl Deref for Arc { } } +#[unstable(feature = "pin_coerce_unsized_trait", issue = "123430")] +unsafe impl PinCoerceUnsized for Arc {} + +#[unstable(feature = "pin_coerce_unsized_trait", issue = "123430")] +unsafe impl PinCoerceUnsized for Weak {} + #[unstable(feature = "deref_pure_trait", issue = "87121")] unsafe impl DerefPure for Arc {} -- cgit 1.4.1-3-g733a5