Closed
Description
#![deny(improper_ctypes)]
// Intentionally not #[repr(C)]
pub struct Foo;
#[repr(C)] // Expect error here that Bar is marked repr(C) but contains fn ptr referencing non-repr(C) type
pub struct Bar {
// Alternatively expect error here that extern fn contains type that is non-repr(C).
pub f: unsafe extern "system" fn(arg: *const Foo)
}
extern "system"{
pub fn baz(bar: *const Bar); // Actually get error here implying Bar is not marked repr(C) even though it is
}
fn main() {
}
error: found non-foreign-function-safe member in struct marked #[repr(C)]: found struct without foreign-function-safe representation annotation in foreign module, consider adding a #[repr(C)] attribute to the type
--> src/main.rs:12:21
|
12 | pub fn baz(bar: *const Bar); // Actually get error here implying Bar is not marked repr(C) even though it is
| ^^^^^^^^^^
|
note: lint level defined here
--> src/main.rs:1:9
|
1 | #![deny(improper_ctypes)]
| ^^^^^^^^^^^^^^^
error: aborting due to previous error