@@ -202,12 +202,18 @@ fn handle_ebadf<T>(r: io::Result<T>, default: T) -> io::Result<T> {
202202///
203203/// [`io::stdin`]: stdin
204204///
205- /// ### Note: Windows Portability Consideration
205+ /// ### Note: Windows Portability Considerations
206206///
207207/// When operating in a console, the Windows implementation of this stream does not support
208208/// non-UTF-8 byte sequences. Attempting to read bytes that are not valid UTF-8 will return
209209/// an error.
210210///
211+ /// In a process with a detached console, such as one using
212+ /// `#![windows_subsystem = "windows"]`, or in a child process spawned from such a process,
213+ /// the contained handle will be null. In such cases, the standard library's `Read` and
214+ /// `Write` will do nothing and silently succeed. All other I/O operations, via the
215+ /// standard library or via raw Windows API calls, will fail.
216+ ///
211217/// # Examples
212218///
213219/// ```no_run
@@ -230,12 +236,18 @@ pub struct Stdin {
230236/// This handle implements both the [`Read`] and [`BufRead`] traits, and
231237/// is constructed via the [`Stdin::lock`] method.
232238///
233- /// ### Note: Windows Portability Consideration
239+ /// ### Note: Windows Portability Considerations
234240///
235241/// When operating in a console, the Windows implementation of this stream does not support
236242/// non-UTF-8 byte sequences. Attempting to read bytes that are not valid UTF-8 will return
237243/// an error.
238244///
245+ /// In a process with a detached console, such as one using
246+ /// `#![windows_subsystem = "windows"]`, or in a child process spawned from such a process,
247+ /// the contained handle will be null. In such cases, the standard library's `Read` and
248+ /// `Write` will do nothing and silently succeed. All other I/O operations, via the
249+ /// standard library or via raw Windows API calls, will fail.
250+ ///
239251/// # Examples
240252///
241253/// ```no_run
@@ -263,11 +275,18 @@ pub struct StdinLock<'a> {
263275/// is synchronized via a mutex. If you need more explicit control over
264276/// locking, see the [`Stdin::lock`] method.
265277///
266- /// ### Note: Windows Portability Consideration
278+ /// ### Note: Windows Portability Considerations
279+ ///
267280/// When operating in a console, the Windows implementation of this stream does not support
268281/// non-UTF-8 byte sequences. Attempting to read bytes that are not valid UTF-8 will return
269282/// an error.
270283///
284+ /// In a process with a detached console, such as one using
285+ /// `#![windows_subsystem = "windows"]`, or in a child process spawned from such a process,
286+ /// the contained handle will be null. In such cases, the standard library's `Read` and
287+ /// `Write` will do nothing and silently succeed. All other I/O operations, via the
288+ /// standard library or via raw Windows API calls, will fail.
289+ ///
271290/// # Examples
272291///
273292/// Using implicit synchronization:
@@ -490,11 +509,18 @@ impl fmt::Debug for StdinLock<'_> {
490509///
491510/// Created by the [`io::stdout`] method.
492511///
493- /// ### Note: Windows Portability Consideration
512+ /// ### Note: Windows Portability Considerations
513+ ///
494514/// When operating in a console, the Windows implementation of this stream does not support
495515/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
496516/// an error.
497517///
518+ /// In a process with a detached console, such as one using
519+ /// `#![windows_subsystem = "windows"]`, or in a child process spawned from such a process,
520+ /// the contained handle will be null. In such cases, the standard library's `Read` and
521+ /// `Write` will do nothing and silently succeed. All other I/O operations, via the
522+ /// standard library or via raw Windows API calls, will fail.
523+ ///
498524/// [`lock`]: Stdout::lock
499525/// [`io::stdout`]: stdout
500526#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -510,10 +536,17 @@ pub struct Stdout {
510536/// This handle implements the [`Write`] trait, and is constructed via
511537/// the [`Stdout::lock`] method. See its documentation for more.
512538///
513- /// ### Note: Windows Portability Consideration
539+ /// ### Note: Windows Portability Considerations
540+ ///
514541/// When operating in a console, the Windows implementation of this stream does not support
515542/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
516543/// an error.
544+ ///
545+ /// In a process with a detached console, such as one using
546+ /// `#![windows_subsystem = "windows"]`, or in a child process spawned from such a process,
547+ /// the contained handle will be null. In such cases, the standard library's `Read` and
548+ /// `Write` will do nothing and silently succeed. All other I/O operations, via the
549+ /// standard library or via raw Windows API calls, will fail.
517550#[ must_use = "if unused stdout will immediately unlock" ]
518551#[ stable( feature = "rust1" , since = "1.0.0" ) ]
519552pub struct StdoutLock < ' a > {
@@ -528,11 +561,18 @@ static STDOUT: SyncOnceCell<ReentrantMutex<RefCell<LineWriter<StdoutRaw>>>> = Sy
528561/// is synchronized via a mutex. If you need more explicit control over
529562/// locking, see the [`Stdout::lock`] method.
530563///
531- /// ### Note: Windows Portability Consideration
564+ /// ### Note: Windows Portability Considerations
565+ ///
532566/// When operating in a console, the Windows implementation of this stream does not support
533567/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
534568/// an error.
535569///
570+ /// In a process with a detached console, such as one using
571+ /// `#![windows_subsystem = "windows"]`, or in a child process spawned from such a process,
572+ /// the contained handle will be null. In such cases, the standard library's `Read` and
573+ /// `Write` will do nothing and silently succeed. All other I/O operations, via the
574+ /// standard library or via raw Windows API calls, will fail.
575+ ///
536576/// # Examples
537577///
538578/// Using implicit synchronization:
@@ -710,10 +750,17 @@ impl fmt::Debug for StdoutLock<'_> {
710750///
711751/// [`io::stderr`]: stderr
712752///
713- /// ### Note: Windows Portability Consideration
753+ /// ### Note: Windows Portability Considerations
754+ ///
714755/// When operating in a console, the Windows implementation of this stream does not support
715756/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
716757/// an error.
758+ ///
759+ /// In a process with a detached console, such as one using
760+ /// `#![windows_subsystem = "windows"]`, or in a child process spawned from such a process,
761+ /// the contained handle will be null. In such cases, the standard library's `Read` and
762+ /// `Write` will do nothing and silently succeed. All other I/O operations, via the
763+ /// standard library or via raw Windows API calls, will fail.
717764#[ stable( feature = "rust1" , since = "1.0.0" ) ]
718765pub struct Stderr {
719766 inner : Pin < & ' static ReentrantMutex < RefCell < StderrRaw > > > ,
@@ -724,10 +771,17 @@ pub struct Stderr {
724771/// This handle implements the [`Write`] trait and is constructed via
725772/// the [`Stderr::lock`] method. See its documentation for more.
726773///
727- /// ### Note: Windows Portability Consideration
774+ /// ### Note: Windows Portability Considerations
775+ ///
728776/// When operating in a console, the Windows implementation of this stream does not support
729777/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
730778/// an error.
779+ ///
780+ /// In a process with a detached console, such as one using
781+ /// `#![windows_subsystem = "windows"]`, or in a child process spawned from such a process,
782+ /// the contained handle will be null. In such cases, the standard library's `Read` and
783+ /// `Write` will do nothing and silently succeed. All other I/O operations, via the
784+ /// standard library or via raw Windows API calls, will fail.
731785#[ must_use = "if unused stderr will immediately unlock" ]
732786#[ stable( feature = "rust1" , since = "1.0.0" ) ]
733787pub struct StderrLock < ' a > {
@@ -738,11 +792,18 @@ pub struct StderrLock<'a> {
738792///
739793/// This handle is not buffered.
740794///
741- /// ### Note: Windows Portability Consideration
795+ /// ### Note: Windows Portability Considerations
796+ ///
742797/// When operating in a console, the Windows implementation of this stream does not support
743798/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
744799/// an error.
745800///
801+ /// In a process with a detached console, such as one using
802+ /// `#![windows_subsystem = "windows"]`, or in a child process spawned from such a process,
803+ /// the contained handle will be null. In such cases, the standard library's `Read` and
804+ /// `Write` will do nothing and silently succeed. All other I/O operations, via the
805+ /// standard library or via raw Windows API calls, will fail.
806+ ///
746807/// # Examples
747808///
748809/// Using implicit synchronization:
0 commit comments