Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bd3b9ec

Browse files
committedJun 17, 2024
std: simplify #[cfg]s for TLS
1 parent b40c54b commit bd3b9ec

File tree

1 file changed

+10
-15
lines changed
  • std/src/sys/thread_local

1 file changed

+10
-15
lines changed
 

‎std/src/sys/thread_local/mod.rs

+10-15
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,23 @@ cfg_if::cfg_if! {
4242

4343
/// This module maintains a list of TLS destructors for the current thread,
4444
/// all of which will be run on thread exit.
45+
#[cfg(all(target_thread_local, not(all(target_family = "wasm", not(target_feature = "atomics")))))]
4546
pub(crate) mod destructors {
4647
cfg_if::cfg_if! {
47-
if #[cfg(all(
48-
target_thread_local,
49-
any(
50-
target_os = "linux",
51-
target_os = "android",
52-
target_os = "fuchsia",
53-
target_os = "redox",
54-
target_os = "hurd",
55-
target_os = "netbsd",
56-
target_os = "dragonfly"
57-
)
48+
if #[cfg(any(
49+
target_os = "linux",
50+
target_os = "android",
51+
target_os = "fuchsia",
52+
target_os = "redox",
53+
target_os = "hurd",
54+
target_os = "netbsd",
55+
target_os = "dragonfly"
5856
))] {
5957
mod linux;
6058
mod list;
6159
pub(super) use linux::register;
6260
pub(super) use list::run;
63-
} else if #[cfg(all(
64-
target_thread_local,
65-
not(all(target_family = "wasm", not(target_feature = "atomics")))
66-
))] {
61+
} else {
6762
mod list;
6863
pub(super) use list::register;
6964
pub(crate) use list::run;

0 commit comments

Comments
 (0)
Failed to load comments.