summary refs log tree commit diff
path: root/src/test/run-fail/panic-set-unset-handler.rs
blob: f8809c2f3889e1d1767861389817e1c568401ed3 (plain)
1
2
3
4
5
6
7
8
9
10
11
// error-pattern:thread 'main' panicked at 'foobar'

use std::panic;

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