about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorSparrowLii <liyuan179@huawei.com>2023-05-06 10:23:51 +0800
committerSparrowLii <liyuan179@huawei.com>2023-05-06 10:23:51 +0800
commitd7e3e5bede187d113fa01c4d8b8c16a2bd4f721c (patch)
tree2075a444d51a94efff3e1c74fee28f973bd49c2f /compiler/rustc_data_structures/src
parentbffccddac3470f68efe15a3e81257869be562568 (diff)
downloadrust-d7e3e5bede187d113fa01c4d8b8c16a2bd4f721c.tar.gz
rust-d7e3e5bede187d113fa01c4d8b8c16a2bd4f721c.zip
add `DynSend / DynSync` for `CopyTaggedPtr`
Diffstat (limited to 'compiler/rustc_data_structures/src')
-rw-r--r--compiler/rustc_data_structures/src/lib.rs2
-rw-r--r--compiler/rustc_data_structures/src/marker.rs11
2 files changed, 8 insertions, 5 deletions
diff --git a/compiler/rustc_data_structures/src/lib.rs b/compiler/rustc_data_structures/src/lib.rs
index 579f54c5f71..5b9b0e106d2 100644
--- a/compiler/rustc_data_structures/src/lib.rs
+++ b/compiler/rustc_data_structures/src/lib.rs
@@ -30,8 +30,6 @@
 #![feature(get_mut_unchecked)]
 #![feature(lint_reasons)]
 #![feature(unwrap_infallible)]
-#![feature(const_mut_refs)]
-#![feature(const_trait_impl)]
 #![feature(strict_provenance)]
 #![feature(ptr_alignment_type)]
 #![feature(macro_metavar_expr)]
diff --git a/compiler/rustc_data_structures/src/marker.rs b/compiler/rustc_data_structures/src/marker.rs
index e23a10839ee..f8c06f9a814 100644
--- a/compiler/rustc_data_structures/src/marker.rs
+++ b/compiler/rustc_data_structures/src/marker.rs
@@ -94,6 +94,7 @@ cfg_if!(
             [Box<T, A> where T: ?Sized + DynSend, A: std::alloc::Allocator + DynSend]
             [crate::sync::Lock<T> where T: DynSend]
             [crate::sync::RwLock<T> where T: DynSend]
+            [crate::tagged_ptr::CopyTaggedPtr<P, T, CP> where P: Send + crate::tagged_ptr::Pointer, T: Send + crate::tagged_ptr::Tag, const CP: bool]
             [rustc_arena::TypedArena<T> where T: DynSend]
             [indexmap::IndexSet<V, S> where V: DynSend, S: DynSend]
             [indexmap::IndexMap<K, V, S> where K: DynSend, V: DynSend, S: DynSend]
@@ -175,6 +176,7 @@ cfg_if!(
             [crate::sync::OneThread<T> where T]
             [crate::sync::WorkerLocal<T> where T: DynSend]
             [crate::intern::Interned<'a, T> where 'a, T: DynSync]
+            [crate::tagged_ptr::CopyTaggedPtr<P, T, CP> where P: Sync + crate::tagged_ptr::Pointer, T: Sync + crate::tagged_ptr::Tag, const CP: bool]
             [parking_lot::lock_api::Mutex<R, T> where R: DynSync, T: ?Sized + DynSend]
             [parking_lot::lock_api::RwLock<R, T> where R: DynSync, T: ?Sized + DynSend + DynSync]
             [indexmap::IndexSet<V, S> where V: DynSync, S: DynSync]
@@ -218,9 +220,10 @@ unsafe impl<T: DynSend> Send for FromDyn<T> {}
 #[cfg(parallel_compiler)]
 unsafe impl<T: DynSync> Sync for FromDyn<T> {}
 
-impl<T> const std::ops::Deref for FromDyn<T> {
+impl<T> std::ops::Deref for FromDyn<T> {
     type Target = T;
 
+    #[inline(always)]
     fn deref(&self) -> &Self::Target {
         &self.0
     }
@@ -237,15 +240,17 @@ unsafe impl<T: ?Sized + Send> DynSend for IntoDynSyncSend<T> {}
 #[cfg(parallel_compiler)]
 unsafe impl<T: ?Sized + Sync> DynSync for IntoDynSyncSend<T> {}
 
-impl<T> const std::ops::Deref for IntoDynSyncSend<T> {
+impl<T> std::ops::Deref for IntoDynSyncSend<T> {
     type Target = T;
 
+    #[inline(always)]
     fn deref(&self) -> &T {
         &self.0
     }
 }
 
-impl<T> const std::ops::DerefMut for IntoDynSyncSend<T> {
+impl<T> std::ops::DerefMut for IntoDynSyncSend<T> {
+    #[inline(always)]
     fn deref_mut(&mut self) -> &mut T {
         &mut self.0
     }