mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
compiler: manually implement DynSend for atomic primitives
The manual `DynSend` implementation for `AtomicPtr` blocks the auto-implementation for other atomic primitives since they forward to the same `Atomic<T>` type now. This breakage cannot occur in user code as it depends on `DynSend` being a custom auto-trait.
This commit is contained in:
@@ -59,11 +59,16 @@ macro_rules! already_send {
|
||||
|
||||
// These structures are already `Send`.
|
||||
already_send!(
|
||||
[std::backtrace::Backtrace][std::io::Stdout][std::io::Stderr][std::io::Error][std::fs::File][std::panic::Location<'_>]
|
||||
[rustc_arena::DroplessArena][jobserver_crate::Client][jobserver_crate::HelperThread]
|
||||
[crate::memmap::Mmap][crate::profiling::SelfProfiler][crate::owned_slice::OwnedSlice]
|
||||
[std::sync::atomic::AtomicBool][std::sync::atomic::AtomicUsize][std::sync::atomic::AtomicU8]
|
||||
[std::sync::atomic::AtomicU32][std::backtrace::Backtrace][std::io::Stdout][std::io::Stderr]
|
||||
[std::io::Error][std::fs::File][std::panic::Location<'_>][rustc_arena::DroplessArena]
|
||||
[jobserver_crate::Client][jobserver_crate::HelperThread][crate::memmap::Mmap]
|
||||
[crate::profiling::SelfProfiler][crate::owned_slice::OwnedSlice]
|
||||
);
|
||||
|
||||
#[cfg(target_has_atomic = "64")]
|
||||
already_send!([std::sync::atomic::AtomicU64]);
|
||||
|
||||
macro_rules! impl_dyn_send {
|
||||
($($($attr: meta)* [$ty: ty where $($generics2: tt)*])*) => {
|
||||
$(unsafe impl<$($generics2)*> DynSend for $ty {})*
|
||||
|
||||
Reference in New Issue
Block a user