14ea7a777f
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>
19 lines
243 B
Rust
19 lines
243 B
Rust
// run-pass
|
|
|
|
#![allow(stable_features)]
|
|
#![allow(unused_variables)]
|
|
|
|
// #45662
|
|
|
|
#![feature(repr_align)]
|
|
|
|
#[repr(align(16))]
|
|
pub struct A(i64);
|
|
|
|
#[allow(improper_ctypes_definitions)]
|
|
pub extern "C" fn foo(x: A) {}
|
|
|
|
fn main() {
|
|
foo(A(0));
|
|
}
|