@@ -261,21 +261,6 @@ pub struct StdinLock<'a> {
261
261
inner : MutexGuard < ' a , BufReader < StdinRaw > > ,
262
262
}
263
263
264
- /// Owned locked [`Stdin`] handle, returned by [`Stdin::into_lock`] and
265
- /// [`io::stdin_locked`].
266
- ///
267
- /// This is exactly like [`StdinLock`], except that it can outlive the
268
- /// [`Stdin`] handle that was used to create it. See the [`StdinLock`]
269
- /// documentation for more details.
270
- ///
271
- /// ### Note: Windows Portability Consideration
272
- ///
273
- /// When operating in a console, the Windows implementation of this stream does not support
274
- /// non-UTF-8 byte sequences. Attempting to read bytes that are not valid UTF-8 will return
275
- /// an error.
276
- #[ unstable( feature = "stdio_locked" , issue = "none" ) ]
277
- pub type StdinOwnedLock = StdinLock < ' static > ;
278
-
279
264
/// Constructs a new handle to the standard input of the current process.
280
265
///
281
266
/// Each handle returned is a reference to a shared global buffer whose access
@@ -363,8 +348,8 @@ pub fn stdin() -> Stdin {
363
348
/// }
364
349
/// ```
365
350
#[ unstable( feature = "stdio_locked" , issue = "none" ) ]
366
- pub fn stdin_locked ( ) -> StdinOwnedLock {
367
- stdin ( ) . into_lock ( )
351
+ pub fn stdin_locked ( ) -> StdinLock < ' static > {
352
+ stdin ( ) . into_locked ( )
368
353
}
369
354
370
355
impl Stdin {
@@ -451,14 +436,14 @@ impl Stdin {
451
436
///
452
437
/// fn main() -> io::Result<()> {
453
438
/// let mut buffer = String::new();
454
- /// let mut handle = io::stdin().into_lock ();
439
+ /// let mut handle = io::stdin().into_locked ();
455
440
///
456
441
/// handle.read_to_string(&mut buffer)?;
457
442
/// Ok(())
458
443
/// }
459
444
/// ```
460
445
#[ unstable( feature = "stdio_locked" , issue = "none" ) ]
461
- pub fn into_lock ( self ) -> StdinOwnedLock {
446
+ pub fn into_locked ( self ) -> StdinLock < ' static > {
462
447
self . lock_any ( )
463
448
}
464
449
}
@@ -601,20 +586,6 @@ pub struct StdoutLock<'a> {
601
586
inner : ReentrantMutexGuard < ' a , RefCell < LineWriter < StdoutRaw > > > ,
602
587
}
603
588
604
- /// Owned locked [`Stdout`] handle, returned by [`Stdout::into_lock`] and
605
- /// [`io::stdout_locked`].
606
- ///
607
- /// This is exactly like [`StdoutLock`], except that it can outlive the
608
- /// [`Stdout`] handle that was used to create it. See the [`StdoutLock`]
609
- /// documentation for more details.
610
- ///
611
- /// ### Note: Windows Portability Consideration
612
- /// When operating in a console, the Windows implementation of this stream does not support
613
- /// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
614
- /// an error.
615
- #[ unstable( feature = "stdio_locked" , issue = "none" ) ]
616
- pub type StdoutOwnedLock = StdoutLock < ' static > ;
617
-
618
589
static STDOUT : SyncOnceCell < ReentrantMutex < RefCell < LineWriter < StdoutRaw > > > > = SyncOnceCell :: new ( ) ;
619
590
620
591
/// Constructs a new handle to the standard output of the current process.
@@ -699,7 +670,7 @@ pub fn stdout() -> Stdout {
699
670
/// ```
700
671
#[ unstable( feature = "stdio_locked" , issue = "none" ) ]
701
672
pub fn stdout_locked ( ) -> StdoutLock < ' static > {
702
- stdout ( ) . into_lock ( )
673
+ stdout ( ) . into_locked ( )
703
674
}
704
675
705
676
pub fn cleanup ( ) {
@@ -767,15 +738,15 @@ impl Stdout {
767
738
/// use std::io::{self, Write};
768
739
///
769
740
/// fn main() -> io::Result<()> {
770
- /// let mut handle = io::stdout().into_lock ();
741
+ /// let mut handle = io::stdout().into_locked ();
771
742
///
772
743
/// handle.write_all(b"hello world")?;
773
744
///
774
745
/// Ok(())
775
746
/// }
776
747
/// ```
777
748
#[ unstable( feature = "stdio_locked" , issue = "none" ) ]
778
- pub fn into_lock ( self ) -> StdoutOwnedLock {
749
+ pub fn into_locked ( self ) -> StdoutLock < ' static > {
779
750
self . lock_any ( )
780
751
}
781
752
}
@@ -898,20 +869,6 @@ pub struct StderrLock<'a> {
898
869
inner : ReentrantMutexGuard < ' a , RefCell < StderrRaw > > ,
899
870
}
900
871
901
- /// Owned locked [`Stderr`] handle, returned by [`Stderr::into_lock`] and
902
- /// [`io::stderr_locked`].
903
- ///
904
- /// This is exactly like [`StderrLock`], except that it can outlive the the
905
- /// [`Stderr`] handle that was used to create it. See the [`StderrLock`]
906
- /// documentation for more details.
907
- ///
908
- /// ### Note: Windows Portability Consideration
909
- /// When operating in a console, the Windows implementation of this stream does not support
910
- /// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
911
- /// an error.
912
- #[ unstable( feature = "stdio_locked" , issue = "none" ) ]
913
- pub type StderrOwnedLock = StderrLock < ' static > ;
914
-
915
872
/// Constructs a new handle to the standard error of the current process.
916
873
///
917
874
/// This handle is not buffered.
@@ -989,8 +946,8 @@ pub fn stderr() -> Stderr {
989
946
/// }
990
947
/// ```
991
948
#[ unstable( feature = "stdio_locked" , issue = "none" ) ]
992
- pub fn stderr_locked ( ) -> StderrOwnedLock {
993
- stderr ( ) . into_lock ( )
949
+ pub fn stderr_locked ( ) -> StderrLock < ' static > {
950
+ stderr ( ) . into_locked ( )
994
951
}
995
952
996
953
impl Stderr {
@@ -1041,15 +998,15 @@ impl Stderr {
1041
998
///
1042
999
/// fn foo() -> io::Result<()> {
1043
1000
/// let stderr = io::stderr();
1044
- /// let mut handle = stderr.into_lock ();
1001
+ /// let mut handle = stderr.into_locked ();
1045
1002
///
1046
1003
/// handle.write_all(b"hello world")?;
1047
1004
///
1048
1005
/// Ok(())
1049
1006
/// }
1050
1007
/// ```
1051
1008
#[ unstable( feature = "stdio_locked" , issue = "none" ) ]
1052
- pub fn into_lock ( self ) -> StderrOwnedLock {
1009
+ pub fn into_locked ( self ) -> StderrLock < ' static > {
1053
1010
self . lock_any ( )
1054
1011
}
1055
1012
}
0 commit comments