about summary refs log tree commit diff
path: root/tests/ui/panics/panic-set-handler.rs
blob: 39286ca865ba5a25149ffd5cbd403d9ecc89b257 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//@ run-fail
//@ error-pattern:greetings from the panic handler
//@ ignore-emscripten no processes

use std::panic;

fn main() {
    panic::set_hook(Box::new(|i| {
        eprintln!("greetings from the panic handler");
    }));
    panic!("foobar");
}