about summary refs log tree commit diff
path: root/src/test/run-fail/panic-set-handler.rs
blob: ea2b152c6c45acda10a9e08171a7dd2f83729e1a (plain)
1
2
3
4
5
6
7
8
9
10
// error-pattern:greetings from the panic handler

use std::panic;

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