Skip to content

Commit

Permalink
Use static_local.rs for postgres targets (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomcc authored Jun 12, 2023
1 parent 53529dd commit 4e2b0c5
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions library/std/src/sys/common/thread_local/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,30 @@
//! `__thread_local_internal` macro does not seem to be exported properly when using cfg_if
#![unstable(feature = "thread_local_internals", reason = "should not be necessary", issue = "none")]

#[cfg(all(target_thread_local, not(all(target_family = "wasm", not(target_feature = "atomics")))))]
#[cfg(all(
target_thread_local,
not(target_family = "postgres"),
not(all(target_family = "wasm", not(target_feature = "atomics")))
))]
mod fast_local;
#[cfg(all(
not(target_thread_local),
not(target_family = "postgres"),
not(all(target_family = "wasm", not(target_feature = "atomics")))
))]
mod os_local;
#[cfg(all(target_family = "wasm", not(target_feature = "atomics")))]
#[cfg(any(
all(target_family = "wasm", not(target_feature = "atomics")),
target_family = "postgres"
))]
mod static_local;

#[cfg(not(test))]
cfg_if::cfg_if! {
if #[cfg(all(target_family = "wasm", not(target_feature = "atomics")))] {
if #[cfg(any(target_family = "postgres", all(target_family = "wasm", not(target_feature = "atomics"))))] {
#[doc(hidden)]
pub use static_local::statik::Key;
} else if #[cfg(all(target_thread_local, not(all(target_family = "wasm", not(target_feature = "atomics")))))] {
} else if #[cfg(all(target_thread_local, not(target_family = "postgres"), not(all(target_family = "wasm", not(target_feature = "atomics")))))] {
#[doc(hidden)]
pub use fast_local::fast::Key;
} else if #[cfg(all(not(target_thread_local), not(all(target_family = "wasm", not(target_feature = "atomics")))))] {
Expand Down

0 comments on commit 4e2b0c5

Please sign in to comment.