rust/src/test/ui/consts/const-extern-function.rs
2019-07-27 18:56:16 +03:00

17 lines
257 B
Rust

// run-pass
#![allow(non_upper_case_globals)]
extern 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);
}