Skip to content

Commit cbcb695

Browse files
authored
Rollup merge of #136360 - slanterns:once_wait, r=tgross35
Stabilize `once_wait` Closes: #127527. `@rustbot` label: +T-libs-api r? libs-api
2 parents a56e85a + 6fa6168 commit cbcb695

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

library/std/src/sync/once_lock.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,6 @@ impl<T> OnceLock<T> {
174174
///
175175
/// Waiting for a computation on another thread to finish:
176176
/// ```rust
177-
/// #![feature(once_wait)]
178-
///
179177
/// use std::thread;
180178
/// use std::sync::OnceLock;
181179
///
@@ -189,7 +187,7 @@ impl<T> OnceLock<T> {
189187
/// })
190188
/// ```
191189
#[inline]
192-
#[unstable(feature = "once_wait", issue = "127527")]
190+
#[stable(feature = "once_wait", since = "CURRENT_RUSTC_VERSION")]
193191
pub fn wait(&self) -> &T {
194192
self.once.wait_force();
195193

library/std/src/sync/poison/once.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,6 @@ impl Once {
269269
/// # Example
270270
///
271271
/// ```rust
272-
/// #![feature(once_wait)]
273-
///
274272
/// use std::sync::Once;
275273
/// use std::thread;
276274
///
@@ -289,7 +287,7 @@ impl Once {
289287
/// If this [`Once`] has been poisoned because an initialization closure has
290288
/// panicked, this method will also panic. Use [`wait_force`](Self::wait_force)
291289
/// if this behavior is not desired.
292-
#[unstable(feature = "once_wait", issue = "127527")]
290+
#[stable(feature = "once_wait", since = "CURRENT_RUSTC_VERSION")]
293291
pub fn wait(&self) {
294292
if !self.inner.is_completed() {
295293
self.inner.wait(false);
@@ -298,7 +296,7 @@ impl Once {
298296

299297
/// Blocks the current thread until initialization has completed, ignoring
300298
/// poisoning.
301-
#[unstable(feature = "once_wait", issue = "127527")]
299+
#[stable(feature = "once_wait", since = "CURRENT_RUSTC_VERSION")]
302300
pub fn wait_force(&self) {
303301
if !self.inner.is_completed() {
304302
self.inner.wait(true);

0 commit comments

Comments
 (0)