From d70f071392ea812ffa3c7e4cca934b0767956173 Mon Sep 17 00:00:00 2001 From: joboet Date: Mon, 17 Jun 2024 12:41:41 +0200 Subject: [PATCH] std: simplify `#[cfg]`s for TLS --- library/std/src/sys/thread_local/mod.rs | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/library/std/src/sys/thread_local/mod.rs b/library/std/src/sys/thread_local/mod.rs index 6e3d8382b4290..aa2dd48ab49c3 100644 --- a/library/std/src/sys/thread_local/mod.rs +++ b/library/std/src/sys/thread_local/mod.rs @@ -42,28 +42,23 @@ cfg_if::cfg_if! { /// This module maintains a list of TLS destructors for the current thread, /// all of which will be run on thread exit. +#[cfg(all(target_thread_local, not(all(target_family = "wasm", not(target_feature = "atomics")))))] pub(crate) mod destructors { cfg_if::cfg_if! { - if #[cfg(all( - target_thread_local, - any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia", - target_os = "redox", - target_os = "hurd", - target_os = "netbsd", - target_os = "dragonfly" - ) + if #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia", + target_os = "redox", + target_os = "hurd", + target_os = "netbsd", + target_os = "dragonfly" ))] { mod linux; mod list; pub(super) use linux::register; pub(super) use list::run; - } else if #[cfg(all( - target_thread_local, - not(all(target_family = "wasm", not(target_feature = "atomics"))) - ))] { + } else { mod list; pub(super) use list::register; pub(crate) use list::run;