Don't output panic noise from panic test

P.S. rustfmt 0.4.1-stable (7a807262 2018-04-20)
This commit is contained in:
Robert Kelly 2018-05-14 11:05:29 -04:00 committed by Greg Fitzgerald
parent b132ce1944
commit 4a94da8a94
1 changed files with 2 additions and 0 deletions

View File

@ -78,6 +78,7 @@ mod tests {
use std::io; use std::io;
use std::io::Write; use std::io::Write;
use std::net::SocketAddr; use std::net::SocketAddr;
use std::panic;
use std::sync::mpsc::RecvError; use std::sync::mpsc::RecvError;
use std::sync::mpsc::RecvTimeoutError; use std::sync::mpsc::RecvTimeoutError;
use std::sync::mpsc::channel; use std::sync::mpsc::channel;
@ -89,6 +90,7 @@ mod tests {
} }
fn join_error() -> Result<()> { fn join_error() -> Result<()> {
panic::set_hook(Box::new(|_info| {}));
let r = thread::spawn(|| panic!("hi")).join()?; let r = thread::spawn(|| panic!("hi")).join()?;
Ok(r) Ok(r)
} }