diff --git a/library/std/src/process.rs b/library/std/src/process.rs index 1def9fe0972025c901be03aa7ed6f75e3acf0d8c..c9595a96567fa9fca3348e95acbebb39c081005d 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -2161,7 +2161,9 @@ fn report(self) -> ExitCode { impl Termination for Result { fn report(self) -> ExitCode { let Err(err) = self; - eprintln!("Error: {err:?}"); + // Ignore error if the write fails, for example because stderr is + // already closed. There is not much point panicking at this point. + let _ = writeln!(io::stderr(), "Error: {err:?}"); ExitCode::FAILURE } }