about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorXiangfei Ding <dingxiangfei2009@protonmail.ch>2024-05-13 03:16:31 +0800
committerDing Xiang Fei <dingxiangfei2009@protonmail.ch>2024-07-31 17:10:55 +0800
commitd495b84a9a5a0bfcfe353c53b332664c7414e315 (patch)
tree9f7b10247eac5b9c6e6231e3744e2127c3246b49 /library/std/src
parent83dcdb3a5dad0ed1e3e1fadc848d3f7727b41aa5 (diff)
downloadrust-d495b84a9a5a0bfcfe353c53b332664c7414e315.tar.gz
rust-d495b84a9a5a0bfcfe353c53b332664c7414e315.zip
PinCoerceUnsized trait into core
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/lib.rs1
-rw-r--r--library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs4
2 files changed, 5 insertions, 0 deletions
diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs
index 6bd9c59a949..58d3c4a994b 100644
--- a/library/std/src/lib.rs
+++ b/library/std/src/lib.rs
@@ -342,6 +342,7 @@
 #![feature(maybe_uninit_write_slice)]
 #![feature(panic_can_unwind)]
 #![feature(panic_internals)]
+#![feature(pin_coerce_unsized_trait)]
 #![feature(pointer_is_aligned_to)]
 #![feature(portable_simd)]
 #![feature(prelude_2024)]
diff --git a/library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs b/library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs
index 29809525739..5069ab82ccc 100644
--- a/library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs
+++ b/library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs
@@ -8,6 +8,7 @@ use crate::cell::UnsafeCell;
 use crate::convert::TryInto;
 use crate::mem::{self, ManuallyDrop};
 use crate::ops::{CoerceUnsized, Deref, DerefMut, Index, IndexMut};
+use crate::pin::PinCoerceUnsized;
 use crate::ptr::{self, NonNull};
 use crate::slice::SliceIndex;
 use crate::{cmp, intrinsics, slice};
@@ -751,6 +752,9 @@ where
 #[unstable(feature = "sgx_platform", issue = "56975")]
 impl<T: CoerceUnsized<U>, U> CoerceUnsized<UserRef<U>> for UserRef<T> {}
 
+#[unstable(feature = "pin_coerce_unsized_trait", issue = "123430")]
+unsafe impl<T: ?Sized> PinCoerceUnsized for UserRef<T> {}
+
 #[unstable(feature = "sgx_platform", issue = "56975")]
 impl<T, I> Index<I> for UserRef<[T]>
 where