@@ -125,7 +125,7 @@ unsafe impl Send for Once {}
125125
126126/// State yielded to [`Once::call_once_force()`]’s closure parameter. The state
127127/// can be used to query the poison status of the [`Once`].
128- #[ unstable ( feature = "once_poison" , issue = "33577 " ) ]
128+ #[ stable ( feature = "once_poison" , since = "1.51.0 " ) ]
129129#[ derive( Debug ) ]
130130pub struct OnceState {
131131 poisoned : bool ,
@@ -280,8 +280,6 @@ impl Once {
280280 /// # Examples
281281 ///
282282 /// ```
283- /// #![feature(once_poison)]
284- ///
285283 /// use std::sync::Once;
286284 /// use std::thread;
287285 ///
@@ -301,13 +299,13 @@ impl Once {
301299 ///
302300 /// // call_once_force will still run and reset the poisoned state
303301 /// INIT.call_once_force(|state| {
304- /// assert!(state.poisoned ());
302+ /// assert!(state.is_poisoned ());
305303 /// });
306304 ///
307305 /// // once any success happens, we stop propagating the poison
308306 /// INIT.call_once(|| {});
309307 /// ```
310- #[ unstable ( feature = "once_poison" , issue = "33577 " ) ]
308+ #[ stable ( feature = "once_poison" , since = "1.51.0 " ) ]
311309 pub fn call_once_force < F > ( & self , f : F )
312310 where
313311 F : FnOnce ( & OnceState ) ,
@@ -526,8 +524,6 @@ impl OnceState {
526524 /// A poisoned [`Once`]:
527525 ///
528526 /// ```
529- /// #![feature(once_poison)]
530- ///
531527 /// use std::sync::Once;
532528 /// use std::thread;
533529 ///
@@ -540,24 +536,22 @@ impl OnceState {
540536 /// assert!(handle.join().is_err());
541537 ///
542538 /// INIT.call_once_force(|state| {
543- /// assert!(state.poisoned ());
539+ /// assert!(state.is_poisoned ());
544540 /// });
545541 /// ```
546542 ///
547543 /// An unpoisoned [`Once`]:
548544 ///
549545 /// ```
550- /// #![feature(once_poison)]
551- ///
552546 /// use std::sync::Once;
553547 ///
554548 /// static INIT: Once = Once::new();
555549 ///
556550 /// INIT.call_once_force(|state| {
557- /// assert!(!state.poisoned ());
551+ /// assert!(!state.is_poisoned ());
558552 /// });
559- #[ unstable ( feature = "once_poison" , issue = "33577 " ) ]
560- pub fn poisoned ( & self ) -> bool {
553+ #[ stable ( feature = "once_poison" , since = "1.51.0 " ) ]
554+ pub fn is_poisoned ( & self ) -> bool {
561555 self . poisoned
562556 }
563557
0 commit comments