about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2020-10-10 20:13:03 +0200
committerMara Bos <m-ou.se@m-ou.se>2020-12-08 22:57:49 +0100
commit2bc5d44ca963a4dccf09c993fe9813f6a795aedf (patch)
tree796d3f5500ac0c991f7545f6bfe28c45a6cf8d0b
parent5e6e1e33a11d140a4d70f946730137f241224eb3 (diff)
downloadrust-2bc5d44ca963a4dccf09c993fe9813f6a795aedf.tar.gz
rust-2bc5d44ca963a4dccf09c993fe9813f6a795aedf.zip
Fix outdated comment about not needing to flush stderr.
-rw-r--r--library/std/src/io/stdio.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/library/std/src/io/stdio.rs b/library/std/src/io/stdio.rs
index 6ea7704d422..b5594c8e093 100644
--- a/library/std/src/io/stdio.rs
+++ b/library/std/src/io/stdio.rs
@@ -756,13 +756,9 @@ pub struct StderrLock<'a> {
 /// ```
 #[stable(feature = "rust1", since = "1.0.0")]
 pub fn stderr() -> Stderr {
-    // Note that unlike `stdout()` we don't use `Lazy` here which registers a
-    // destructor. Stderr is not buffered nor does the `stderr_raw` type consume
-    // any owned resources, so there's no need to run any destructors at some
-    // point in the future.
-    //
-    // This has the added benefit of allowing `stderr` to be usable during
-    // process shutdown as well!
+    // Note that unlike `stdout()` we don't use `at_exit` here to register a
+    // destructor. Stderr is not buffered , so there's no need to run a
+    // destructor for flushing the buffer
     static INSTANCE: SyncOnceCell<ReentrantMutex<RefCell<StderrRaw>>> = SyncOnceCell::new();
 
     Stderr {