]> git.lizzy.rs Git - rust.git/commitdiff
Fix outdated comment about not needing to flush stderr.
authorMara Bos <m-ou.se@m-ou.se>
Sat, 10 Oct 2020 18:13:03 +0000 (20:13 +0200)
committerMara Bos <m-ou.se@m-ou.se>
Tue, 8 Dec 2020 21:57:49 +0000 (22:57 +0100)
library/std/src/io/stdio.rs

index 6ea7704d42213463305f877536beff97859c899d..b5594c8e093bdc0bd8c727fa80d78fc18e55f982 100644 (file)
@@ -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 {