summaryrefslogtreecommitdiffstats
path: root/src/test/ui/panics/panic-set-handler.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/panics/panic-set-handler.rs')
-rw-r--r--src/test/ui/panics/panic-set-handler.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/panics/panic-set-handler.rs b/src/test/ui/panics/panic-set-handler.rs
new file mode 100644
index 000000000..3c00183e2
--- /dev/null
+++ b/src/test/ui/panics/panic-set-handler.rs
@@ -0,0 +1,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");
+}