2020-04-16 15:50:32 +09:00
|
|
|
// run-fail
|
2023-06-20 19:16:18 +02:00
|
|
|
// error-pattern:thread 'main' panicked
|
|
|
|
// error-pattern:foobar
|
2020-05-08 00:39:02 +09:00
|
|
|
// 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");
|
|
|
|
}
|