summaryrefslogtreecommitdiffstats
path: root/src/test/ui/panics/panic-set-handler.rs
blob: 3c00183e253d78ec4840456bbd8fb94c116323a6 (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");
}