about summary refs log tree commit diff
path: root/library/std/src/sys
diff options
context:
space:
mode:
authorjoboet <jonasboettiger@icloud.com>2024-06-17 12:41:41 +0200
committerjoboet <jonasboettiger@icloud.com>2024-06-17 12:41:41 +0200
commitd70f071392ea812ffa3c7e4cca934b0767956173 (patch)
treef864d7c682f2a6445f5edfedb13bb78dc8ca34a0 /library/std/src/sys
parentf3facf11758af878bcfaf47fc773962dbb565024 (diff)
downloadrust-d70f071392ea812ffa3c7e4cca934b0767956173.tar.gz
rust-d70f071392ea812ffa3c7e4cca934b0767956173.zip
std: simplify `#[cfg]`s for TLS
Diffstat (limited to 'library/std/src/sys')
-rw-r--r--library/std/src/sys/thread_local/mod.rs25
1 files 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 6e3d8382b42..aa2dd48ab49 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;