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.
Termination
Result<Infallible, E>
1 parent 6cfa773 commit 2bdd075Copy full SHA for 2bdd075
library/std/src/process.rs
@@ -106,6 +106,7 @@ mod tests;
106
107
use crate::io::prelude::*;
108
109
+use crate::convert::Infallible;
110
use crate::ffi::OsStr;
111
use crate::fmt;
112
use crate::fs;
@@ -2051,6 +2052,15 @@ impl<E: fmt::Debug> Termination for Result<!, E> {
2051
2052
}
2053
2054
2055
+#[unstable(feature = "termination_trait_lib", issue = "43301")]
2056
+impl<E: fmt::Debug> Termination for Result<Infallible, E> {
2057
+ fn report(self) -> i32 {
2058
+ let Err(err) = self;
2059
+ eprintln!("Error: {:?}", err);
2060
+ ExitCode::FAILURE.report()
2061
+ }
2062
+}
2063
+
2064
#[unstable(feature = "termination_trait_lib", issue = "43301")]
2065
impl Termination for ExitCode {
2066
#[inline]
0 commit comments