rust/src/test/ui/issues/issue-26997.rs
David Wood 14ea7a777f
lints: add improper_ctypes_definitions
This commit adds a new lint - `improper_ctypes_definitions` - which
functions identically to `improper_ctypes`, but on `extern "C" fn`
definitions (as opposed to `improper_ctypes`'s `extern "C" {}`
declarations).

Signed-off-by: David Wood <david@davidtw.co>
2020-06-24 12:09:35 +01:00

16 lines
223 B
Rust

// build-pass
#![allow(dead_code)]
pub struct Foo {
x: isize,
y: isize
}
impl Foo {
#[allow(improper_ctypes_definitions)]
pub extern fn foo_new() -> Foo {
Foo { x: 21, y: 33 }
}
}
fn main() {}