about summary refs log tree commit diff
path: root/library/std/src/thread
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-01-12 07:40:32 +0000
committerbors <bors@rust-lang.org>2023-01-12 07:40:32 +0000
commit2b8590ef3bd1221830ec8a4131ea9d02b1636746 (patch)
tree7c99d064572f9d620f1e5d51db183bad0b785991 /library/std/src/thread
parent4887cb18dc2ef5b1bf3fc50ce6c267fde085032b (diff)
parente8ef83e4c060ec66a8dbb3d729af67ffd34f6a92 (diff)
downloadrust-2b8590ef3bd1221830ec8a4131ea9d02b1636746.tar.gz
rust-2b8590ef3bd1221830ec8a4131ea9d02b1636746.zip
Auto merge of #106757 - matthiaskrgr:rollup-9j8830g, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #106167 (Fix invalid syntax and incomplete suggestion in impl Trait parameter type suggestions for E0311)
 - #106309 (Prefer non-`[type error]` candidates during selection)
 - #106532 (Allow codegen to unsize `dyn*` to `dyn`)
 - #106596 (Hide more of long types in E0271)
 - #106638 (std tests: use __OsLocalKeyInner from realstd)
 - #106676 (Test that we cannot use trait impl methods arguments as defining uses)
 - #106702 (Conserve cause of `ImplDerivedObligation` in E0599)
 - #106732 (rustc_llvm: replace llvm::makeArrayRef with ArrayRef constructors.)
 - #106733 (Revert "warn newer available version of the x tool")
 - #106748 (Clean up `OnUnimplementedFormatString::verify`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/thread')
-rw-r--r--library/std/src/thread/mod.rs22
1 files changed, 15 insertions, 7 deletions
diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs
index 7acda8e98f1..692ff0cbca6 100644
--- a/library/std/src/thread/mod.rs
+++ b/library/std/src/thread/mod.rs
@@ -177,6 +177,12 @@ use crate::sys_common::thread_parking::Parker;
 use crate::sys_common::{AsInner, IntoInner};
 use crate::time::Duration;
 
+#[stable(feature = "scoped_threads", since = "1.63.0")]
+mod scoped;
+
+#[stable(feature = "scoped_threads", since = "1.63.0")]
+pub use scoped::{scope, Scope, ScopedJoinHandle};
+
 ////////////////////////////////////////////////////////////////////////////////
 // Thread-local storage
 ////////////////////////////////////////////////////////////////////////////////
@@ -184,12 +190,6 @@ use crate::time::Duration;
 #[macro_use]
 mod local;
 
-#[stable(feature = "scoped_threads", since = "1.63.0")]
-mod scoped;
-
-#[stable(feature = "scoped_threads", since = "1.63.0")]
-pub use scoped::{scope, Scope, ScopedJoinHandle};
-
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use self::local::{AccessError, LocalKey};
 
@@ -209,7 +209,6 @@ pub use self::local::{AccessError, LocalKey};
 ))]
 #[doc(hidden)]
 pub use self::local::fast::Key as __FastLocalKeyInner;
-
 // when building for tests, use real std's type
 #[unstable(feature = "libstd_thread_internals", issue = "none")]
 #[cfg(test)]
@@ -220,12 +219,21 @@ pub use self::local::fast::Key as __FastLocalKeyInner;
 pub use realstd::thread::__FastLocalKeyInner;
 
 #[unstable(feature = "libstd_thread_internals", issue = "none")]
+#[cfg(not(test))]
 #[cfg(all(
     not(target_thread_local),
     not(all(target_family = "wasm", not(target_feature = "atomics"))),
 ))]
 #[doc(hidden)]
 pub use self::local::os::Key as __OsLocalKeyInner;
+// when building for tests, use real std's type
+#[unstable(feature = "libstd_thread_internals", issue = "none")]
+#[cfg(test)]
+#[cfg(all(
+    not(target_thread_local),
+    not(all(target_family = "wasm", not(target_feature = "atomics"))),
+))]
+pub use realstd::thread::__OsLocalKeyInner;
 
 #[unstable(feature = "libstd_thread_internals", issue = "none")]
 #[cfg(all(target_family = "wasm", not(target_feature = "atomics")))]