2020-04-16 15:50:32 +09:00
|
|
|
//@ run-fail
|
2015-12-17 23:51:55 -08:00
|
|
|
//@ error-pattern:greetings from the panic handler
|
2025-01-23 16:36:54 +08:00
|
|
|
//@ needs-subprocess
|
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| {
|
2018-11-02 19:11:31 +01:00
|
|
|
eprintln!("greetings from the panic handler");
|
2016-05-24 14:24:44 -07:00
|
|
|
}));
|
2015-12-17 23:51:55 -08:00
|
|
|
panic!("foobar");
|
|
|
|
|
}
|