]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/process.rs
Rollup merge of #103003 - TaKO8Ki:fix-102989, r=compiler-errors
[rust.git] / library / std / src / process.rs
index d91d4fa64caa587300380f2ec6b689c5f7d17a3a..b8249a027ad99445cc90a0f51f749b3ba12f7a93 100644 (file)
@@ -1629,7 +1629,7 @@ pub fn code(&self) -> Option<i32> {
     ///
     /// This is exactly like [`code()`](Self::code), except that it returns a `NonZeroI32`.
     ///
-    /// Plain `code`, returning a plain integer, is provided because is is often more convenient.
+    /// Plain `code`, returning a plain integer, is provided because it is often more convenient.
     /// The returned value from `code()` is indeed also nonzero; use `code_nonzero()` when you want
     /// a type-level guarantee of nonzeroness.
     ///
@@ -2200,9 +2200,7 @@ fn report(self) -> ExitCode {
         match self {
             Ok(val) => val.report(),
             Err(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:?}");
+                io::attempt_print_to_stderr(format_args_nl!("Error: {err:?}"));
                 ExitCode::FAILURE
             }
         }