about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-08-06 12:22:30 -0400
committerRalf Jung <post@ralfj.de>2022-08-22 09:14:33 -0400
commit138375a74c6ae9124e24744913e5211204c0e3df (patch)
tree0ffb093b4ed4d97003cbe8872a2f0677cee78c72 /library/std/src
parentc0941dfb5a7d07ef2d70cc54d319669d9d6f6c01 (diff)
downloadrust-138375a74c6ae9124e24744913e5211204c0e3df.tar.gz
rust-138375a74c6ae9124e24744913e5211204c0e3df.zip
std: use realstd fast key when building tests
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/thread/mod.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs
index 479669647c1..555b2130dee 100644
--- a/library/std/src/thread/mod.rs
+++ b/library/std/src/thread/mod.rs
@@ -203,9 +203,19 @@ pub use self::local::{AccessError, LocalKey};
 
 #[unstable(feature = "libstd_thread_internals", issue = "none")]
 #[cfg(target_thread_local)]
+#[cfg(not(test))]
 #[doc(hidden)]
 pub use self::local::fast::Key as __FastLocalKeyInner;
 #[unstable(feature = "libstd_thread_internals", issue = "none")]
+#[cfg(target_thread_local)]
+#[cfg(test)] // when building for tests, use real std's key
+pub use realstd::thread::__FastLocalKeyInner;
+#[unstable(feature = "libstd_thread_internals", issue = "none")]
+#[cfg(target_thread_local)]
+#[cfg(test)]
+pub use self::local::fast::Key as __FastLocalKeyInnerUnused; // we import this anyway to silence 'unused' warnings
+
+#[unstable(feature = "libstd_thread_internals", issue = "none")]
 #[doc(hidden)]
 pub use self::local::os::Key as __OsLocalKeyInner;
 #[unstable(feature = "libstd_thread_internals", issue = "none")]