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

10 lines
203 B
Rust

// error-pattern:greetings from the panic handler
use std::panic;
fn main() {
panic::set_hook(Box::new(|i| {
eprintln!("greetings from the panic handler");
}));
panic!("foobar");
}