rust/src/test/ui/no-landing-pads.rs
2019-07-27 18:56:16 +03:00

24 lines
395 B
Rust

// run-pass
// 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 });
}