]> git.lizzy.rs Git - rust.git/blob - src/test/ui/no-landing-pads.rs
44af25f7f8f48aa9561e311aac0b96aee1bb1ce9
[rust.git] / src / test / ui / no-landing-pads.rs
1 // run-pass
2 // compile-flags: -Z no-landing-pads -C codegen-units=1
3 // ignore-emscripten no threads support
4 // ignore-test fails because catch_unwind doesn't work with no-landing-pads
5
6 use std::thread;
7
8 static mut HIT: bool = false;
9
10 struct A;
11
12 impl Drop for A {
13     fn drop(&mut self) {
14         unsafe { HIT = true; }
15     }
16 }
17
18 fn main() {
19     thread::spawn(move|| -> () {
20         let _a = A;
21         panic!();
22     }).join().unwrap_err();
23     assert!(unsafe { !HIT });
24 }