std: simplify `#[cfg]`s for TLS · rust-lang/rust@d70f071

File tree

1 file changed

lines changed

  • library/std/src/sys/thread_local

1 file changed

lines changed

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;