]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-25089.rs
Merge commit '1fcc74cc9e03bc91eaa80ecf92976b0b14b3aeb6' into clippyup
[rust.git] / src / test / ui / issues / issue-25089.rs
1 // run-pass
2 // ignore-emscripten no threads support
3
4 use std::thread;
5
6 struct Foo(i32);
7
8 impl Drop for Foo {
9     fn drop(&mut self) {
10         static mut DROPPED: bool = false;
11         unsafe {
12             assert!(!DROPPED);
13             DROPPED = true;
14         }
15     }
16 }
17
18 struct Empty;
19
20 fn empty() -> Empty { Empty }
21
22 fn should_panic(_: Foo, _: Empty) {
23     panic!("test panic");
24 }
25
26 fn test() {
27     should_panic(Foo(1), empty());
28 }
29
30 fn main() {
31     let ret = thread::spawn(test).join();
32     assert!(ret.is_err());
33 }