diff --git a/library/std/src/process.rs b/library/std/src/process.rs index b4dab41f06632..4e9fd51f28229 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -106,6 +106,7 @@ mod tests; use crate::io::prelude::*; +use crate::convert::Infallible; use crate::ffi::OsStr; use crate::fmt; use crate::fs; @@ -2065,6 +2066,14 @@ impl Termination for Result { } } +#[unstable(feature = "termination_trait_lib", issue = "43301")] +impl Termination for Result { + fn report(self) -> i32 { + let Err(err) = self; + Err::(err).report() + } +} + #[unstable(feature = "termination_trait_lib", issue = "43301")] impl Termination for ExitCode { #[inline]