Skip to content

Commit 4e2b0c5

Browse files
authored
Use static_local.rs for postgres targets (#46)
1 parent 53529dd commit 4e2b0c5

File tree

1 file changed

+12
-4
lines changed
  • library/std/src/sys/common/thread_local

1 file changed

+12
-4
lines changed

library/std/src/sys/common/thread_local/mod.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,30 @@
22
//! `__thread_local_internal` macro does not seem to be exported properly when using cfg_if
33
#![unstable(feature = "thread_local_internals", reason = "should not be necessary", issue = "none")]
44

5-
#[cfg(all(target_thread_local, not(all(target_family = "wasm", not(target_feature = "atomics")))))]
5+
#[cfg(all(
6+
target_thread_local,
7+
not(target_family = "postgres"),
8+
not(all(target_family = "wasm", not(target_feature = "atomics")))
9+
))]
610
mod fast_local;
711
#[cfg(all(
812
not(target_thread_local),
13+
not(target_family = "postgres"),
914
not(all(target_family = "wasm", not(target_feature = "atomics")))
1015
))]
1116
mod os_local;
12-
#[cfg(all(target_family = "wasm", not(target_feature = "atomics")))]
17+
#[cfg(any(
18+
all(target_family = "wasm", not(target_feature = "atomics")),
19+
target_family = "postgres"
20+
))]
1321
mod static_local;
1422

1523
#[cfg(not(test))]
1624
cfg_if::cfg_if! {
17-
if #[cfg(all(target_family = "wasm", not(target_feature = "atomics")))] {
25+
if #[cfg(any(target_family = "postgres", all(target_family = "wasm", not(target_feature = "atomics"))))] {
1826
#[doc(hidden)]
1927
pub use static_local::statik::Key;
20-
} else if #[cfg(all(target_thread_local, not(all(target_family = "wasm", not(target_feature = "atomics")))))] {
28+
} else if #[cfg(all(target_thread_local, not(target_family = "postgres"), not(all(target_family = "wasm", not(target_feature = "atomics")))))] {
2129
#[doc(hidden)]
2230
pub use fast_local::fast::Key;
2331
} else if #[cfg(all(not(target_thread_local), not(all(target_family = "wasm", not(target_feature = "atomics")))))] {

0 commit comments

Comments
 (0)