]> git.lizzy.rs Git - rust.git/blob - tests/ui/issues/issue-25089.rs
Rollup merge of #107091 - clubby789:infer-ftl-missing-dollar, r=compiler-errors
[rust.git] / tests / ui / issues / issue-25089.rs
1 // run-pass
2 // needs-unwind
3 // ignore-emscripten no threads support
4
5 use std::thread;
6
7 struct Foo(#[allow(unused_tuple_struct_fields)] i32);
8
9 impl Drop for Foo {
10     fn drop(&mut self) {
11         static mut DROPPED: bool = false;
12         unsafe {
13             assert!(!DROPPED);
14             DROPPED = true;
15         }
16     }
17 }
18
19 struct Empty;
20
21 fn empty() -> Empty { Empty }
22
23 fn should_panic(_: Foo, _: Empty) {
24     panic!("test panic");
25 }
26
27 fn test() {
28     should_panic(Foo(1), empty());
29 }
30
31 fn main() {
32     let ret = thread::spawn(test).join();
33     assert!(ret.is_err());
34 }