rust/src/test/ui/catch-unwind-bang.rs
David Koloski ea68758299 Add needs-unwind to tests that depend on panicking
This directive isn't automatically set by compiletest or x.py, but can
be turned on manually for targets that require it.
2021-12-09 22:03:52 +00:00

12 lines
188 B
Rust

// run-pass
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default
fn worker() -> ! {
panic!()
}
fn main() {
std::panic::catch_unwind(worker).unwrap_err();
}