Skip to content

Commit 2bc5d44

Browse files
committed
Fix outdated comment about not needing to flush stderr.
1 parent 5e6e1e3 commit 2bc5d44

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

library/std/src/io/stdio.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -756,13 +756,9 @@ pub struct StderrLock<'a> {
756756
/// ```
757757
#[stable(feature = "rust1", since = "1.0.0")]
758758
pub fn stderr() -> Stderr {
759-
// Note that unlike `stdout()` we don't use `Lazy` here which registers a
760-
// destructor. Stderr is not buffered nor does the `stderr_raw` type consume
761-
// any owned resources, so there's no need to run any destructors at some
762-
// point in the future.
763-
//
764-
// This has the added benefit of allowing `stderr` to be usable during
765-
// process shutdown as well!
759+
// Note that unlike `stdout()` we don't use `at_exit` here to register a
760+
// destructor. Stderr is not buffered , so there's no need to run a
761+
// destructor for flushing the buffer
766762
static INSTANCE: SyncOnceCell<ReentrantMutex<RefCell<StderrRaw>>> = SyncOnceCell::new();
767763

768764
Stderr {

0 commit comments

Comments
 (0)