@@ -202,12 +202,18 @@ fn handle_ebadf<T>(r: io::Result<T>, default: T) -> io::Result<T> {
202
202
///
203
203
/// [`io::stdin`]: stdin
204
204
///
205
- /// ### Note: Windows Portability Consideration
205
+ /// ### Note: Windows Portability Considerations
206
206
///
207
207
/// When operating in a console, the Windows implementation of this stream does not support
208
208
/// non-UTF-8 byte sequences. Attempting to read bytes that are not valid UTF-8 will return
209
209
/// an error.
210
210
///
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
+ ///
211
217
/// # Examples
212
218
///
213
219
/// ```no_run
@@ -230,12 +236,18 @@ pub struct Stdin {
230
236
/// This handle implements both the [`Read`] and [`BufRead`] traits, and
231
237
/// is constructed via the [`Stdin::lock`] method.
232
238
///
233
- /// ### Note: Windows Portability Consideration
239
+ /// ### Note: Windows Portability Considerations
234
240
///
235
241
/// When operating in a console, the Windows implementation of this stream does not support
236
242
/// non-UTF-8 byte sequences. Attempting to read bytes that are not valid UTF-8 will return
237
243
/// an error.
238
244
///
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
+ ///
239
251
/// # Examples
240
252
///
241
253
/// ```no_run
@@ -263,11 +275,18 @@ pub struct StdinLock<'a> {
263
275
/// is synchronized via a mutex. If you need more explicit control over
264
276
/// locking, see the [`Stdin::lock`] method.
265
277
///
266
- /// ### Note: Windows Portability Consideration
278
+ /// ### Note: Windows Portability Considerations
279
+ ///
267
280
/// When operating in a console, the Windows implementation of this stream does not support
268
281
/// non-UTF-8 byte sequences. Attempting to read bytes that are not valid UTF-8 will return
269
282
/// an error.
270
283
///
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
+ ///
271
290
/// # Examples
272
291
///
273
292
/// Using implicit synchronization:
@@ -490,11 +509,18 @@ impl fmt::Debug for StdinLock<'_> {
490
509
///
491
510
/// Created by the [`io::stdout`] method.
492
511
///
493
- /// ### Note: Windows Portability Consideration
512
+ /// ### Note: Windows Portability Considerations
513
+ ///
494
514
/// When operating in a console, the Windows implementation of this stream does not support
495
515
/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
496
516
/// an error.
497
517
///
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
+ ///
498
524
/// [`lock`]: Stdout::lock
499
525
/// [`io::stdout`]: stdout
500
526
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -510,10 +536,17 @@ pub struct Stdout {
510
536
/// This handle implements the [`Write`] trait, and is constructed via
511
537
/// the [`Stdout::lock`] method. See its documentation for more.
512
538
///
513
- /// ### Note: Windows Portability Consideration
539
+ /// ### Note: Windows Portability Considerations
540
+ ///
514
541
/// When operating in a console, the Windows implementation of this stream does not support
515
542
/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
516
543
/// 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.
517
550
#[ must_use = "if unused stdout will immediately unlock" ]
518
551
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
519
552
pub struct StdoutLock < ' a > {
@@ -528,11 +561,18 @@ static STDOUT: SyncOnceCell<ReentrantMutex<RefCell<LineWriter<StdoutRaw>>>> = Sy
528
561
/// is synchronized via a mutex. If you need more explicit control over
529
562
/// locking, see the [`Stdout::lock`] method.
530
563
///
531
- /// ### Note: Windows Portability Consideration
564
+ /// ### Note: Windows Portability Considerations
565
+ ///
532
566
/// When operating in a console, the Windows implementation of this stream does not support
533
567
/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
534
568
/// an error.
535
569
///
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
+ ///
536
576
/// # Examples
537
577
///
538
578
/// Using implicit synchronization:
@@ -710,10 +750,17 @@ impl fmt::Debug for StdoutLock<'_> {
710
750
///
711
751
/// [`io::stderr`]: stderr
712
752
///
713
- /// ### Note: Windows Portability Consideration
753
+ /// ### Note: Windows Portability Considerations
754
+ ///
714
755
/// When operating in a console, the Windows implementation of this stream does not support
715
756
/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
716
757
/// 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.
717
764
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
718
765
pub struct Stderr {
719
766
inner : Pin < & ' static ReentrantMutex < RefCell < StderrRaw > > > ,
@@ -724,10 +771,17 @@ pub struct Stderr {
724
771
/// This handle implements the [`Write`] trait and is constructed via
725
772
/// the [`Stderr::lock`] method. See its documentation for more.
726
773
///
727
- /// ### Note: Windows Portability Consideration
774
+ /// ### Note: Windows Portability Considerations
775
+ ///
728
776
/// When operating in a console, the Windows implementation of this stream does not support
729
777
/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
730
778
/// 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.
731
785
#[ must_use = "if unused stderr will immediately unlock" ]
732
786
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
733
787
pub struct StderrLock < ' a > {
@@ -738,11 +792,18 @@ pub struct StderrLock<'a> {
738
792
///
739
793
/// This handle is not buffered.
740
794
///
741
- /// ### Note: Windows Portability Consideration
795
+ /// ### Note: Windows Portability Considerations
796
+ ///
742
797
/// When operating in a console, the Windows implementation of this stream does not support
743
798
/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
744
799
/// an error.
745
800
///
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
+ ///
746
807
/// # Examples
747
808
///
748
809
/// Using implicit synchronization:
0 commit comments