smarter way to avoid 'unused' warning when building for tests
This commit is contained in:
parent
600ac6959a
commit
594838d132
1 changed files with 2 additions and 9 deletions
|
@ -150,6 +150,8 @@
|
||||||
|
|
||||||
#![stable(feature = "rust1", since = "1.0.0")]
|
#![stable(feature = "rust1", since = "1.0.0")]
|
||||||
#![deny(unsafe_op_in_unsafe_fn)]
|
#![deny(unsafe_op_in_unsafe_fn)]
|
||||||
|
// Under `test`, `__FastLocalKeyInner` seems unused.
|
||||||
|
#![cfg_attr(test, allow(dead_code))]
|
||||||
|
|
||||||
#[cfg(all(test, not(target_os = "emscripten")))]
|
#[cfg(all(test, not(target_os = "emscripten")))]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
@ -218,15 +220,6 @@ pub use self::local::fast::Key as __FastLocalKeyInner;
|
||||||
))]
|
))]
|
||||||
pub use realstd::thread::__FastLocalKeyInner;
|
pub use realstd::thread::__FastLocalKeyInner;
|
||||||
|
|
||||||
// but import the local one anyway to silence 'unused' warnings
|
|
||||||
#[unstable(feature = "libstd_thread_internals", issue = "none")]
|
|
||||||
#[cfg(test)]
|
|
||||||
#[cfg(all(
|
|
||||||
target_thread_local,
|
|
||||||
not(all(target_family = "wasm", not(target_feature = "atomics"))),
|
|
||||||
))]
|
|
||||||
pub use self::local::fast::Key as __FastLocalKeyInnerUnused;
|
|
||||||
|
|
||||||
#[unstable(feature = "libstd_thread_internals", issue = "none")]
|
#[unstable(feature = "libstd_thread_internals", issue = "none")]
|
||||||
#[cfg(all(
|
#[cfg(all(
|
||||||
not(target_thread_local),
|
not(target_thread_local),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue