diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2025-02-01 16:41:04 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-01 16:41:04 +0100 |
| commit | cbcb695f9e2888b19e145a18c588825fb06b7930 (patch) | |
| tree | fd7af1a66348d9b83a51dae67869989dc60af64d /library/std/src/sync | |
| parent | a56e85a827140ff70e650de2658db0800e06d6f8 (diff) | |
| parent | 6fa6168e719ec3bbfdd345621af5969b4f5d2e2d (diff) | |
| download | rust-cbcb695f9e2888b19e145a18c588825fb06b7930.tar.gz rust-cbcb695f9e2888b19e145a18c588825fb06b7930.zip | |
Rollup merge of #136360 - slanterns:once_wait, r=tgross35
Stabilize `once_wait` Closes: https://github.com/rust-lang/rust/issues/127527. `@rustbot` label: +T-libs-api r? libs-api
Diffstat (limited to 'library/std/src/sync')
| -rw-r--r-- | library/std/src/sync/once_lock.rs | 4 | ||||
| -rw-r--r-- | library/std/src/sync/poison/once.rs | 6 |
2 files changed, 3 insertions, 7 deletions
diff --git a/library/std/src/sync/once_lock.rs b/library/std/src/sync/once_lock.rs index 49f2dafd8fd..6fc0abbed9e 100644 --- a/library/std/src/sync/once_lock.rs +++ b/library/std/src/sync/once_lock.rs @@ -174,8 +174,6 @@ impl<T> OnceLock<T> { /// /// Waiting for a computation on another thread to finish: /// ```rust - /// #![feature(once_wait)] - /// /// use std::thread; /// use std::sync::OnceLock; /// @@ -189,7 +187,7 @@ impl<T> OnceLock<T> { /// }) /// ``` #[inline] - #[unstable(feature = "once_wait", issue = "127527")] + #[stable(feature = "once_wait", since = "CURRENT_RUSTC_VERSION")] pub fn wait(&self) -> &T { self.once.wait_force(); diff --git a/library/std/src/sync/poison/once.rs b/library/std/src/sync/poison/once.rs index 27db4b634fb..528b11ca0c1 100644 --- a/library/std/src/sync/poison/once.rs +++ b/library/std/src/sync/poison/once.rs @@ -269,8 +269,6 @@ impl Once { /// # Example /// /// ```rust - /// #![feature(once_wait)] - /// /// use std::sync::Once; /// use std::thread; /// @@ -289,7 +287,7 @@ impl Once { /// If this [`Once`] has been poisoned because an initialization closure has /// panicked, this method will also panic. Use [`wait_force`](Self::wait_force) /// if this behavior is not desired. - #[unstable(feature = "once_wait", issue = "127527")] + #[stable(feature = "once_wait", since = "CURRENT_RUSTC_VERSION")] pub fn wait(&self) { if !self.inner.is_completed() { self.inner.wait(false); @@ -298,7 +296,7 @@ impl Once { /// Blocks the current thread until initialization has completed, ignoring /// poisoning. - #[unstable(feature = "once_wait", issue = "127527")] + #[stable(feature = "once_wait", since = "CURRENT_RUSTC_VERSION")] pub fn wait_force(&self) { if !self.inner.is_completed() { self.inner.wait(true); |
