Sign in
rust
/
rust-lang
/
rust
/
refs/heads/stable
/
.
/
tests
/
ui
/
panics
/
panic-set-unset-handler.rs
blob: 66d5003d0f1c51f6d3438702bd29c6c30518e139 [
file
] [
log
] [
blame
]
//@ run-fail
//@ error-pattern:thread 'main' panicked
//@ error-pattern:foobar
//@ needs-subprocess
use
std
::
panic
;
fn
main
()
{
panic
::
set_hook
(
Box
::
new
(|
i
|
{
eprint
!(
"greetings from the panic handler"
);
}));
panic
::
take_hook
();
panic
!(
"foobar"
);
}