mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
17 lines
293 B
Rust
17 lines
293 B
Rust
//@ run-pass
|
|
#![allow(non_upper_case_globals)]
|
|
|
|
struct TestStruct {
|
|
x: *const u8,
|
|
}
|
|
|
|
unsafe impl Sync for TestStruct {}
|
|
|
|
extern "C" fn foo() {}
|
|
const x: extern "C" fn() = foo;
|
|
static y: TestStruct = TestStruct { x: x as *const u8 };
|
|
|
|
pub fn main() {
|
|
assert_eq!(x as *const u8, y.x);
|
|
}
|