summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_data_structures/src/sync.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_data_structures/src/sync.rs')
-rw-r--r--compiler/rustc_data_structures/src/sync.rs19
1 files changed, 14 insertions, 5 deletions
diff --git a/compiler/rustc_data_structures/src/sync.rs b/compiler/rustc_data_structures/src/sync.rs
index cca043ba0..43221d70e 100644
--- a/compiler/rustc_data_structures/src/sync.rs
+++ b/compiler/rustc_data_structures/src/sync.rs
@@ -54,7 +54,7 @@ pub use worker_local::{Registry, WorkerLocal};
mod parallel;
#[cfg(parallel_compiler)]
pub use parallel::scope;
-pub use parallel::{join, par_for_each_in, par_map, parallel_guard};
+pub use parallel::{join, par_for_each_in, par_map, parallel_guard, try_par_for_each_in};
pub use std::sync::atomic::Ordering;
pub use std::sync::atomic::Ordering::SeqCst;
@@ -109,8 +109,8 @@ mod mode {
pub use mode::{is_dyn_thread_safe, set_dyn_thread_safe_mode};
-cfg_if! {
- if #[cfg(not(parallel_compiler))] {
+cfg_match! {
+ cfg(not(parallel_compiler)) => {
use std::ops::Add;
use std::cell::Cell;
@@ -251,7 +251,8 @@ cfg_if! {
MTLock(self.0.clone())
}
}
- } else {
+ }
+ _ => {
pub use std::marker::Send as Send;
pub use std::marker::Sync as Sync;
@@ -264,7 +265,15 @@ cfg_if! {
pub use std::sync::OnceLock;
- pub use std::sync::atomic::{AtomicBool, AtomicUsize, AtomicU32, AtomicU64};
+ pub use std::sync::atomic::{AtomicBool, AtomicUsize, AtomicU32};
+
+ // PowerPC and MIPS platforms with 32-bit pointers do not
+ // have AtomicU64 type.
+ #[cfg(not(any(target_arch = "powerpc", target_arch = "mips")))]
+ pub use std::sync::atomic::AtomicU64;
+
+ #[cfg(any(target_arch = "powerpc", target_arch = "mips"))]
+ pub use portable_atomic::AtomicU64;
pub use std::sync::Arc as Lrc;
pub use std::sync::Weak as Weak;