Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit ebdd676

Browse files
m-ou-seMark-Simulacrum
authored andcommitted
Fix outdated comment about not needing to flush stderr.
1 parent a122d55 commit ebdd676

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
@@ -754,13 +754,9 @@ pub struct StderrLock<'a> {
754754
/// ```
755755
#[stable(feature = "rust1", since = "1.0.0")]
756756
pub fn stderr() -> Stderr {
757-
// Note that unlike `stdout()` we don't use `Lazy` here which registers a
758-
// destructor. Stderr is not buffered nor does the `stderr_raw` type consume
759-
// any owned resources, so there's no need to run any destructors at some
760-
// point in the future.
761-
//
762-
// This has the added benefit of allowing `stderr` to be usable during
763-
// process shutdown as well!
757+
// Note that unlike `stdout()` we don't use `at_exit` here to register a
758+
// destructor. Stderr is not buffered , so there's no need to run a
759+
// destructor for flushing the buffer
764760
static INSTANCE: SyncOnceCell<ReentrantMutex<RefCell<StderrRaw>>> = SyncOnceCell::new();
765761

766762
Stderr {

0 commit comments

Comments
 (0)