From 916fda77dca551c79e87740d6b883714ac982dc6 Mon Sep 17 00:00:00 2001 From: Robert Kelly Date: Mon, 14 May 2018 11:05:29 -0400 Subject: [PATCH] Don't output panic noise from panic test P.S. rustfmt 0.4.1-stable (7a807262 2018-04-20) --- src/result.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/result.rs b/src/result.rs index fca876ebec8fdd..3e2d2ac5499827 100644 --- a/src/result.rs +++ b/src/result.rs @@ -78,6 +78,7 @@ mod tests { use std::io; use std::io::Write; use std::net::SocketAddr; + use std::panic; use std::sync::mpsc::RecvError; use std::sync::mpsc::RecvTimeoutError; use std::sync::mpsc::channel; @@ -89,6 +90,7 @@ mod tests { } fn join_error() -> Result<()> { + panic::set_hook(Box::new(|_info| {})); let r = thread::spawn(|| panic!("hi")).join()?; Ok(r) }