]> git.proxmox.com Git - rustc.git/blob - tests/run-make-fulldeps/static-unwinding/main.rs
New upstream version 1.69.0+dfsg1
[rustc.git] / tests / run-make-fulldeps / static-unwinding / main.rs
1 extern crate lib;
2
3 use std::thread;
4
5 static mut statik: isize = 0;
6
7 struct A;
8 impl Drop for A {
9 fn drop(&mut self) {
10 unsafe { statik = 1; }
11 }
12 }
13
14 fn main() {
15 thread::spawn(move|| {
16 let _a = A;
17 lib::callback(|| panic!());
18 }).join().unwrap_err();
19
20 unsafe {
21 assert_eq!(lib::statik, 1);
22 assert_eq!(statik, 1);
23 }
24 }