rust/tests/ui/consts/const-extern-function.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
261 B
Rust
Raw Normal View History

// 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);
}