@@ -81,9 +81,9 @@ use thread::{self, Thread};
81
81
/// # Examples
82
82
///
83
83
/// ```
84
- /// use std::sync::{ Once, ONCE_INIT} ;
84
+ /// use std::sync::Once;
85
85
///
86
- /// static START: Once = ONCE_INIT ;
86
+ /// static START: Once = Once::new() ;
87
87
///
88
88
/// START.call_once(|| {
89
89
/// // run initialization here
@@ -181,10 +181,10 @@ impl Once {
181
181
/// # Examples
182
182
///
183
183
/// ```
184
- /// use std::sync::{ Once, ONCE_INIT} ;
184
+ /// use std::sync::Once;
185
185
///
186
186
/// static mut VAL: usize = 0;
187
- /// static INIT: Once = ONCE_INIT ;
187
+ /// static INIT: Once = Once::new() ;
188
188
///
189
189
/// // Accessing a `static mut` is unsafe much of the time, but if we do so
190
190
/// // in a synchronized fashion (e.g. write once or read all) then we're
@@ -249,10 +249,10 @@ impl Once {
249
249
/// ```
250
250
/// #![feature(once_poison)]
251
251
///
252
- /// use std::sync::{ Once, ONCE_INIT} ;
252
+ /// use std::sync::Once;
253
253
/// use std::thread;
254
254
///
255
- /// static INIT: Once = ONCE_INIT ;
255
+ /// static INIT: Once = Once::new() ;
256
256
///
257
257
/// // poison the once
258
258
/// let handle = thread::spawn(|| {
@@ -432,10 +432,10 @@ impl OnceState {
432
432
/// ```
433
433
/// #![feature(once_poison)]
434
434
///
435
- /// use std::sync::{ Once, ONCE_INIT} ;
435
+ /// use std::sync::Once;
436
436
/// use std::thread;
437
437
///
438
- /// static INIT: Once = ONCE_INIT ;
438
+ /// static INIT: Once = Once::new() ;
439
439
///
440
440
/// // poison the once
441
441
/// let handle = thread::spawn(|| {
@@ -453,9 +453,9 @@ impl OnceState {
453
453
/// ```
454
454
/// #![feature(once_poison)]
455
455
///
456
- /// use std::sync::{ Once, ONCE_INIT} ;
456
+ /// use std::sync::Once;
457
457
///
458
- /// static INIT: Once = ONCE_INIT ;
458
+ /// static INIT: Once = Once::new() ;
459
459
///
460
460
/// INIT.call_once_force(|state| {
461
461
/// assert!(!state.poisoned());
0 commit comments