2024-02-16 20:02:50 +00:00
|
|
|
//@ run-fail
|
|
|
|
|
//@ error-pattern:thread 'main' panicked
|
|
|
|
|
//@ error-pattern:foobar
|
|
|
|
|
//@ ignore-emscripten no processes
|
2015-12-17 23:51:55 -08:00
|
|
|
|
|
|
|
|
use std::panic;
|
|
|
|
|
|
|
|
|
|
fn main() {
|
2016-05-24 14:24:44 -07:00
|
|
|
panic::set_hook(Box::new(|i| {
|
2017-09-25 00:14:56 -04:00
|
|
|
eprint!("greetings from the panic handler");
|
2016-05-24 14:24:44 -07:00
|
|
|
}));
|
|
|
|
|
panic::take_hook();
|
2015-12-17 23:51:55 -08:00
|
|
|
panic!("foobar");
|
|
|
|
|
}
|