about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-07-02 08:21:57 +0200
committerRalf Jung <post@ralfj.de>2024-07-02 08:21:57 +0200
commitcbea3d7add356898fdfc84e9433baaa514df5552 (patch)
treed3a4cadce7ec832453d49cb1d9d1c6fce3dd6ce5 /compiler/rustc_data_structures/src
parent3e44883606ad4df77018c157971ba7a47e540088 (diff)
parent9f32459c988dec799458f304bbc49ed5dc6ef772 (diff)
downloadrust-cbea3d7add356898fdfc84e9433baaa514df5552.tar.gz
rust-cbea3d7add356898fdfc84e9433baaa514df5552.zip
Merge from rustc
Diffstat (limited to 'compiler/rustc_data_structures/src')
-rw-r--r--compiler/rustc_data_structures/src/marker.rs7
-rw-r--r--compiler/rustc_data_structures/src/sync.rs7
2 files changed, 6 insertions, 8 deletions
diff --git a/compiler/rustc_data_structures/src/marker.rs b/compiler/rustc_data_structures/src/marker.rs
index 32fad0de1aa..83fdaff515b 100644
--- a/compiler/rustc_data_structures/src/marker.rs
+++ b/compiler/rustc_data_structures/src/marker.rs
@@ -147,14 +147,13 @@ cfg_match! {
             [crate::owned_slice::OwnedSlice]
         );
 
-        // MIPS, PowerPC and SPARC platforms with 32-bit pointers do not
-        // have AtomicU64 type.
-        #[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc", target_arch = "sparc")))]
+        // Use portable AtomicU64 for targets without native 64-bit atomics
+        #[cfg(target_has_atomic = "64")]
         already_sync!(
             [std::sync::atomic::AtomicU64]
         );
 
-        #[cfg(any(target_arch = "mips", target_arch = "powerpc", target_arch = "sparc"))]
+        #[cfg(not(target_has_atomic = "64"))]
         already_sync!(
             [portable_atomic::AtomicU64]
         );
diff --git a/compiler/rustc_data_structures/src/sync.rs b/compiler/rustc_data_structures/src/sync.rs
index 5ae79ca988f..79ceb28abb5 100644
--- a/compiler/rustc_data_structures/src/sync.rs
+++ b/compiler/rustc_data_structures/src/sync.rs
@@ -270,12 +270,11 @@ cfg_match! {
 
         pub use std::sync::atomic::{AtomicBool, AtomicUsize, AtomicU32};
 
-        // MIPS, PowerPC and SPARC platforms with 32-bit pointers do not
-        // have AtomicU64 type.
-        #[cfg(not(any(target_arch = "mips", target_arch = "powerpc", target_arch = "sparc")))]
+        // Use portable AtomicU64 for targets without native 64-bit atomics
+        #[cfg(target_has_atomic = "64")]
         pub use std::sync::atomic::AtomicU64;
 
-        #[cfg(any(target_arch = "mips", target_arch = "powerpc", target_arch = "sparc"))]
+        #[cfg(not(target_has_atomic = "64"))]
         pub use portable_atomic::AtomicU64;
 
         pub use std::sync::Arc as Lrc;