rust/src/test/run-fail/panic-set-unset-handler.rs

12 lines
227 B
Rust
Raw Normal View History

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