Rollup merge of #127075 - glaubitz:copy-and-paste-fix, r=SparrowLii
rustc_data_structures: Explicitly check for 64-bit atomics support Instead of keeping a list of architectures which have native support for 64-bit atomics, just use #[cfg(target_has_atomic = "64")] and its inverted counterpart to determine whether we need to use portable AtomicU64 on the target architecture.
This commit is contained in:
commit
3369e8364b
@ -50,7 +50,7 @@ libc = "0.2"
|
|||||||
memmap2 = "0.2.1"
|
memmap2 = "0.2.1"
|
||||||
# tidy-alphabetical-end
|
# tidy-alphabetical-end
|
||||||
|
|
||||||
[target.'cfg(any(target_arch = "mips", target_arch = "powerpc", target_arch = "sparc"))'.dependencies]
|
[target.'cfg(not(target_has_atomic = "64"))'.dependencies]
|
||||||
portable-atomic = "1.5.1"
|
portable-atomic = "1.5.1"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
@ -147,14 +147,13 @@ cfg_match! {
|
|||||||
[crate::owned_slice::OwnedSlice]
|
[crate::owned_slice::OwnedSlice]
|
||||||
);
|
);
|
||||||
|
|
||||||
// MIPS, PowerPC and SPARC platforms with 32-bit pointers do not
|
// Use portable AtomicU64 for targets without native 64-bit atomics
|
||||||
// have AtomicU64 type.
|
#[cfg(target_has_atomic = "64")]
|
||||||
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc", target_arch = "sparc")))]
|
|
||||||
already_sync!(
|
already_sync!(
|
||||||
[std::sync::atomic::AtomicU64]
|
[std::sync::atomic::AtomicU64]
|
||||||
);
|
);
|
||||||
|
|
||||||
#[cfg(any(target_arch = "mips", target_arch = "powerpc", target_arch = "sparc"))]
|
#[cfg(not(target_has_atomic = "64"))]
|
||||||
already_sync!(
|
already_sync!(
|
||||||
[portable_atomic::AtomicU64]
|
[portable_atomic::AtomicU64]
|
||||||
);
|
);
|
||||||
|
@ -270,12 +270,11 @@ cfg_match! {
|
|||||||
|
|
||||||
pub use std::sync::atomic::{AtomicBool, AtomicUsize, AtomicU32};
|
pub use std::sync::atomic::{AtomicBool, AtomicUsize, AtomicU32};
|
||||||
|
|
||||||
// MIPS, PowerPC and SPARC platforms with 32-bit pointers do not
|
// Use portable AtomicU64 for targets without native 64-bit atomics
|
||||||
// have AtomicU64 type.
|
#[cfg(target_has_atomic = "64")]
|
||||||
#[cfg(not(any(target_arch = "mips", target_arch = "powerpc", target_arch = "sparc")))]
|
|
||||||
pub use std::sync::atomic::AtomicU64;
|
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 portable_atomic::AtomicU64;
|
||||||
|
|
||||||
pub use std::sync::Arc as Lrc;
|
pub use std::sync::Arc as Lrc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user