diff options
| author | Ralf Jung <post@ralfj.de> | 2022-10-08 17:11:45 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2022-10-13 14:09:08 +0200 |
| commit | 594838d1324d1d86c1ea8818b81c5060f6a12e5a (patch) | |
| tree | d6693afac631ab46f5bebd2f4b693fa0f78445dd | |
| parent | 600ac6959a824ca087b86cdd705ed9d1f3b73977 (diff) | |
| download | rust-594838d1324d1d86c1ea8818b81c5060f6a12e5a.tar.gz rust-594838d1324d1d86c1ea8818b81c5060f6a12e5a.zip | |
smarter way to avoid 'unused' warning when building for tests
| -rw-r--r-- | library/std/src/thread/mod.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index 4749f5c4ab1..bbcc2f8b4c4 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -150,6 +150,8 @@ #![stable(feature = "rust1", since = "1.0.0")] #![deny(unsafe_op_in_unsafe_fn)] +// Under `test`, `__FastLocalKeyInner` seems unused. +#![cfg_attr(test, allow(dead_code))] #[cfg(all(test, not(target_os = "emscripten")))] mod tests; @@ -218,15 +220,6 @@ pub use self::local::fast::Key as __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")] #[cfg(all( not(target_thread_local), |
