mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
17 lines
261 B
Rust
17 lines
261 B
Rust
// run-pass
|
|
#![allow(non_upper_case_globals)]
|
|
|
|
extern "C" fn foopy() {}
|
|
|
|
static f: extern "C" fn() = foopy;
|
|
static s: S = S { f: foopy };
|
|
|
|
struct S {
|
|
f: extern "C" fn()
|
|
}
|
|
|
|
pub fn main() {
|
|
assert!(foopy as extern "C" fn() == f);
|
|
assert!(f == s.f);
|
|
}
|