We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec55c61 commit 563aa12Copy full SHA for 563aa12
library/std/src/process.rs
@@ -2161,7 +2161,9 @@ impl Termination for ! {
2161
impl<E: fmt::Debug> Termination for Result<!, E> {
2162
fn report(self) -> ExitCode {
2163
let Err(err) = self;
2164
- eprintln!("Error: {err:?}");
+ // Ignore error if the write fails, for example because stderr is
2165
+ // already closed. There is not much point panicking at this point.
2166
+ let _ = writeln!(io::stderr(), "Error: {err:?}");
2167
ExitCode::FAILURE
2168
}
2169
0 commit comments