diff options
Diffstat (limited to 'src/test/ui/panics/panic-set-unset-handler.rs')
-rw-r--r-- | src/test/ui/panics/panic-set-unset-handler.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/panics/panic-set-unset-handler.rs b/src/test/ui/panics/panic-set-unset-handler.rs new file mode 100644 index 000000000..dde0c72f7 --- /dev/null +++ b/src/test/ui/panics/panic-set-unset-handler.rs @@ -0,0 +1,13 @@ +// run-fail +// error-pattern:thread 'main' panicked at 'foobar' +// ignore-emscripten no processes + +use std::panic; + +fn main() { + panic::set_hook(Box::new(|i| { + eprint!("greetings from the panic handler"); + })); + panic::take_hook(); + panic!("foobar"); +} |