diff options
| author | Ralf Jung <post@ralfj.de> | 2025-08-20 08:14:57 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-20 08:14:57 +0000 |
| commit | 46765526e33dca91b3860715097aa43efe2cf5da (patch) | |
| tree | c790c7a6d94c4d2c96b820cc93804ec55af4bdbe /library/std/src/thread/mod.rs | |
| parent | 49abb66e5d199497830b88397f2218cbe4b978f1 (diff) | |
| parent | 5556212823c359619302748e9280258c11799db1 (diff) | |
| download | rust-46765526e33dca91b3860715097aa43efe2cf5da.tar.gz rust-46765526e33dca91b3860715097aa43efe2cf5da.zip | |
Merge pull request #4532 from rust-lang/rustup-2025-08-20
Automatic Rustup
Diffstat (limited to 'library/std/src/thread/mod.rs')
| -rw-r--r-- | library/std/src/thread/mod.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index 292323d0118..b6059c28cec 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -1212,8 +1212,8 @@ impl ThreadId { panic!("failed to generate unique thread ID: bitspace exhausted") } - cfg_if::cfg_if! { - if #[cfg(target_has_atomic = "64")] { + cfg_select! { + target_has_atomic = "64" => { use crate::sync::atomic::{Atomic, AtomicU64}; static COUNTER: Atomic<u64> = AtomicU64::new(0); @@ -1229,7 +1229,8 @@ impl ThreadId { Err(id) => last = id, } } - } else { + } + _ => { use crate::sync::{Mutex, PoisonError}; static COUNTER: Mutex<u64> = Mutex::new(0); @@ -1318,8 +1319,8 @@ use thread_name_string::ThreadNameString; /// Note however that this also means that the name reported in pre-main functions /// will be incorrect, but that's just something we have to live with. pub(crate) mod main_thread { - cfg_if::cfg_if! { - if #[cfg(target_has_atomic = "64")] { + cfg_select! { + target_has_atomic = "64" => { use super::ThreadId; use crate::sync::atomic::{Atomic, AtomicU64}; use crate::sync::atomic::Ordering::Relaxed; @@ -1335,7 +1336,8 @@ pub(crate) mod main_thread { pub(crate) unsafe fn set(id: ThreadId) { MAIN.store(id.as_u64().get(), Relaxed) } - } else { + } + _ => { use super::ThreadId; use crate::mem::MaybeUninit; use crate::sync::atomic::{Atomic, AtomicBool}; |
