@@ -8,10 +8,9 @@ use crate::io::prelude::*;
88use crate :: cell:: { Cell , RefCell } ;
99use crate :: fmt;
1010use crate :: io:: { self , BufReader , IoSlice , IoSliceMut , LineWriter , Lines } ;
11- use crate :: lazy:: SyncOnceCell ;
1211use crate :: pin:: Pin ;
1312use crate :: sync:: atomic:: { AtomicBool , Ordering } ;
14- use crate :: sync:: { Arc , Mutex , MutexGuard } ;
13+ use crate :: sync:: { Arc , Mutex , MutexGuard , OnceLock } ;
1514use crate :: sys:: stdio;
1615use crate :: sys_common:: remutex:: { ReentrantMutex , ReentrantMutexGuard } ;
1716
@@ -318,7 +317,7 @@ pub struct StdinLock<'a> {
318317#[ must_use]
319318#[ stable( feature = "rust1" , since = "1.0.0" ) ]
320319pub fn stdin ( ) -> Stdin {
321- static INSTANCE : SyncOnceCell < Mutex < BufReader < StdinRaw > > > = SyncOnceCell :: new ( ) ;
320+ static INSTANCE : OnceLock < Mutex < BufReader < StdinRaw > > > = OnceLock :: new ( ) ;
322321 Stdin {
323322 inner : INSTANCE . get_or_init ( || {
324323 Mutex :: new ( BufReader :: with_capacity ( stdio:: STDIN_BUF_SIZE , stdin_raw ( ) ) )
@@ -552,7 +551,7 @@ pub struct StdoutLock<'a> {
552551 inner : ReentrantMutexGuard < ' a , RefCell < LineWriter < StdoutRaw > > > ,
553552}
554553
555- static STDOUT : SyncOnceCell < ReentrantMutex < RefCell < LineWriter < StdoutRaw > > > > = SyncOnceCell :: new ( ) ;
554+ static STDOUT : OnceLock < ReentrantMutex < RefCell < LineWriter < StdoutRaw > > > > = OnceLock :: new ( ) ;
556555
557556/// Constructs a new handle to the standard output of the current process.
558557///
@@ -837,7 +836,7 @@ pub fn stderr() -> Stderr {
837836 // Note that unlike `stdout()` we don't use `at_exit` here to register a
838837 // destructor. Stderr is not buffered , so there's no need to run a
839838 // destructor for flushing the buffer
840- static INSTANCE : SyncOnceCell < ReentrantMutex < RefCell < StderrRaw > > > = SyncOnceCell :: new ( ) ;
839+ static INSTANCE : OnceLock < ReentrantMutex < RefCell < StderrRaw > > > = OnceLock :: new ( ) ;
841840
842841 Stderr {
843842 inner : Pin :: static_ref ( & INSTANCE ) . get_or_init_pin (
0 commit comments