diff --git a/library/std/src/process.rs b/library/std/src/process.rs index c9b21fcf9c6d2..4f67cd88652e0 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; @@ -2051,6 +2052,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]