https://play.rust-lang.org/?gist=d8a933822fb81608431b4001e6bae154&version=stable&mode=debug&edition=2015
Given this
#![crate_type = "rlib"]
extern "C" {
pub static mut foo: fn()->(); // WARNS
//pub static mut bar: fn "extern"()->(); // ERRORS
pub static mut baz: extern fn()->(); // OK
}
the warning on foo is:
|
4 | pub static mut foo: fn()->(); // WARNS
| ^^^^^^^^
|
= note: #[warn(improper_ctypes)] on by default
= help: consider using an `fn "extern"(...) -> ...` function pointer instead
The code suggested does not work though, it should be extern fn(...) -> ... instead.