From 7948afdc53cabf9330662ec894bf668839880a3c Mon Sep 17 00:00:00 2001 From: Brad Gibson Date: Sun, 11 Feb 2018 16:38:26 -0800 Subject: changed termination_trait's bound from Error to Debug; added compiletest header command and appropriate tests --- src/libstd/termination.rs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/termination.rs b/src/libstd/termination.rs index 93a913bb540..dc7fa53aab6 100644 --- a/src/libstd/termination.rs +++ b/src/libstd/termination.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use error::Error; +use fmt::Debug; #[cfg(target_arch = "wasm32")] mod exit { pub const SUCCESS: i32 = 0; @@ -45,27 +45,18 @@ impl Termination for () { } #[unstable(feature = "termination_trait", issue = "43301")] -impl Termination for Result { +impl Termination for Result { fn report(self) -> i32 { match self { Ok(val) => val.report(), Err(err) => { - print_error(err); + eprintln!("Error: {:?}", err); exit::FAILURE } } } } -#[unstable(feature = "termination_trait", issue = "43301")] -fn print_error(err: E) { - eprintln!("Error: {}", err.description()); - - if let Some(ref err) = err.cause() { - eprintln!("Caused by: {}", err.description()); - } -} - #[unstable(feature = "termination_trait", issue = "43301")] impl Termination for ! { fn report(self) -> i32 { unreachable!(); } -- cgit 1.4.1-3-g733a5