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

use std::panic;

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