Skip to content

Commit d7e3e5b

Browse files
committed
add DynSend / DynSync for CopyTaggedPtr
1 parent bffccdd commit d7e3e5b

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

compiler/rustc_data_structures/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
#![feature(get_mut_unchecked)]
3131
#![feature(lint_reasons)]
3232
#![feature(unwrap_infallible)]
33-
#![feature(const_mut_refs)]
34-
#![feature(const_trait_impl)]
3533
#![feature(strict_provenance)]
3634
#![feature(ptr_alignment_type)]
3735
#![feature(macro_metavar_expr)]

compiler/rustc_data_structures/src/marker.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ cfg_if!(
9494
[Box<T, A> where T: ?Sized + DynSend, A: std::alloc::Allocator + DynSend]
9595
[crate::sync::Lock<T> where T: DynSend]
9696
[crate::sync::RwLock<T> where T: DynSend]
97+
[crate::tagged_ptr::CopyTaggedPtr<P, T, CP> where P: Send + crate::tagged_ptr::Pointer, T: Send + crate::tagged_ptr::Tag, const CP: bool]
9798
[rustc_arena::TypedArena<T> where T: DynSend]
9899
[indexmap::IndexSet<V, S> where V: DynSend, S: DynSend]
99100
[indexmap::IndexMap<K, V, S> where K: DynSend, V: DynSend, S: DynSend]
@@ -175,6 +176,7 @@ cfg_if!(
175176
[crate::sync::OneThread<T> where T]
176177
[crate::sync::WorkerLocal<T> where T: DynSend]
177178
[crate::intern::Interned<'a, T> where 'a, T: DynSync]
179+
[crate::tagged_ptr::CopyTaggedPtr<P, T, CP> where P: Sync + crate::tagged_ptr::Pointer, T: Sync + crate::tagged_ptr::Tag, const CP: bool]
178180
[parking_lot::lock_api::Mutex<R, T> where R: DynSync, T: ?Sized + DynSend]
179181
[parking_lot::lock_api::RwLock<R, T> where R: DynSync, T: ?Sized + DynSend + DynSync]
180182
[indexmap::IndexSet<V, S> where V: DynSync, S: DynSync]
@@ -218,9 +220,10 @@ unsafe impl<T: DynSend> Send for FromDyn<T> {}
218220
#[cfg(parallel_compiler)]
219221
unsafe impl<T: DynSync> Sync for FromDyn<T> {}
220222

221-
impl<T> const std::ops::Deref for FromDyn<T> {
223+
impl<T> std::ops::Deref for FromDyn<T> {
222224
type Target = T;
223225

226+
#[inline(always)]
224227
fn deref(&self) -> &Self::Target {
225228
&self.0
226229
}
@@ -237,15 +240,17 @@ unsafe impl<T: ?Sized + Send> DynSend for IntoDynSyncSend<T> {}
237240
#[cfg(parallel_compiler)]
238241
unsafe impl<T: ?Sized + Sync> DynSync for IntoDynSyncSend<T> {}
239242

240-
impl<T> const std::ops::Deref for IntoDynSyncSend<T> {
243+
impl<T> std::ops::Deref for IntoDynSyncSend<T> {
241244
type Target = T;
242245

246+
#[inline(always)]
243247
fn deref(&self) -> &T {
244248
&self.0
245249
}
246250
}
247251

248-
impl<T> const std::ops::DerefMut for IntoDynSyncSend<T> {
252+
impl<T> std::ops::DerefMut for IntoDynSyncSend<T> {
253+
#[inline(always)]
249254
fn deref_mut(&mut self) -> &mut T {
250255
&mut self.0
251256
}

compiler/rustc_middle/src/ty/query.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ use rustc_data_structures::fingerprint::Fingerprint;
5252
use rustc_data_structures::fx::{FxHashMap, FxIndexMap, FxIndexSet};
5353
use rustc_data_structures::steal::Steal;
5454
use rustc_data_structures::svh::Svh;
55-
use rustc_data_structures::sync::AtomicU64;use rustc_data_structures::sync::WorkerLocal;
56-
use rustc_data_structures::sync::{self, Lrc};
55+
use rustc_data_structures::sync::AtomicU64;
56+
use rustc_data_structures::sync::Lrc;
57+
use rustc_data_structures::sync::WorkerLocal;
5758
use rustc_data_structures::unord::UnordSet;
5859
use rustc_errors::ErrorGuaranteed;
5960
use rustc_hir as hir;

0 commit comments

Comments
 (0)