rust/src/test/run-pass/no-landing-pads.rs
2018-12-25 21:08:33 -07:00

23 lines
383 B
Rust

// compile-flags: -Z no-landing-pads -C codegen-units=1
// ignore-emscripten no threads support
use std::thread;
static mut HIT: bool = false;
struct A;
impl Drop for A {
fn drop(&mut self) {
unsafe { HIT = true; }
}
}
fn main() {
thread::spawn(move|| -> () {
let _a = A;
panic!();
}).join().unwrap_err();
assert!(unsafe { !HIT });
}