Skip to content

Commit 138375a

Browse files
committed
std: use realstd fast key when building tests
1 parent c0941df commit 138375a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

library/std/src/thread/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,18 @@ pub use self::local::{AccessError, LocalKey};
203203

204204
#[unstable(feature = "libstd_thread_internals", issue = "none")]
205205
#[cfg(target_thread_local)]
206+
#[cfg(not(test))]
206207
#[doc(hidden)]
207208
pub use self::local::fast::Key as __FastLocalKeyInner;
209+
#[unstable(feature = "libstd_thread_internals", issue = "none")]
210+
#[cfg(target_thread_local)]
211+
#[cfg(test)] // when building for tests, use real std's key
212+
pub use realstd::thread::__FastLocalKeyInner;
213+
#[unstable(feature = "libstd_thread_internals", issue = "none")]
214+
#[cfg(target_thread_local)]
215+
#[cfg(test)]
216+
pub use self::local::fast::Key as __FastLocalKeyInnerUnused; // we import this anyway to silence 'unused' warnings
217+
208218
#[unstable(feature = "libstd_thread_internals", issue = "none")]
209219
#[doc(hidden)]
210220
pub use self::local::os::Key as __OsLocalKeyInner;

0 commit comments

Comments
 (0)