about summary refs log tree commit diff
path: root/tests/ui/panics/catch-unwind-bang.rs
blob: 80eb377e5ca1352bfa561102ef40717f63fd9da5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Check that the unwind machinery handles uninhabited types correctly.
//! It used to call `std::mem::uninitialized::<!>();` at some point...
//!
//! See <https://github.com/rust-lang/rust/issues/39432>

//@ run-pass
//@ needs-unwind

fn worker() -> ! {
    panic!()
}

fn main() {
    std::panic::catch_unwind(worker).unwrap_err();
}