mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
433da1fc04
They pass fine.
25 lines
373 B
Rust
25 lines
373 B
Rust
extern crate lib;
|
|
|
|
use std::thread;
|
|
|
|
static mut statik: isize = 0;
|
|
|
|
struct A;
|
|
impl Drop for A {
|
|
fn drop(&mut self) {
|
|
unsafe { statik = 1; }
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
thread::spawn(move|| {
|
|
let _a = A;
|
|
lib::callback(|| panic!());
|
|
}).join().unwrap_err();
|
|
|
|
unsafe {
|
|
assert_eq!(lib::statik, 1);
|
|
assert_eq!(statik, 1);
|
|
}
|
|
}
|