rust/src/test/run-fail/panic-set-unset-handler.rs
2018-12-25 21:08:33 -07:00

12 lines
227 B
Rust

// error-pattern:thread 'main' panicked at 'foobar'
use std::panic;
fn main() {
panic::set_hook(Box::new(|i| {
eprint!("greetings from the panic handler");
}));
panic::take_hook();
panic!("foobar");
}