| error: `extern` fn uses type `[u32]`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:67:33 |
| | |
| LL | pub extern "C" fn slice_type(p: &[u32]) { } |
| | ^^^^^^ not FFI-safe |
| | |
| note: the lint level is defined here |
| --> $DIR/lint-ctypes-fn.rs:4:9 |
| | |
| LL | #![deny(improper_ctypes_definitions)] |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| = help: consider using a raw pointer instead |
| = note: slices have no C equivalent |
| |
| error: `extern` fn uses type `str`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:70:31 |
| | |
| LL | pub extern "C" fn str_type(p: &str) { } |
| | ^^^^ not FFI-safe |
| | |
| = help: consider using `*const u8` and a length instead |
| = note: string slices have no C equivalent |
| |
| error: `extern` fn uses type `std::boxed::Box<u32>`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:73:31 |
| | |
| LL | pub extern "C" fn box_type(p: Box<u32>) { } |
| | ^^^^^^^^ not FFI-safe |
| | |
| = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct |
| = note: this struct has unspecified layout |
| |
| error: `extern` fn uses type `char`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:76:32 |
| | |
| LL | pub extern "C" fn char_type(p: char) { } |
| | ^^^^ not FFI-safe |
| | |
| = help: consider using `u32` or `libc::wchar_t` instead |
| = note: the `char` type has no C equivalent |
| |
| error: `extern` fn uses type `i128`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:79:32 |
| | |
| LL | pub extern "C" fn i128_type(p: i128) { } |
| | ^^^^ not FFI-safe |
| | |
| = note: 128-bit integers don't currently have a known stable ABI |
| |
| error: `extern` fn uses type `u128`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:82:32 |
| | |
| LL | pub extern "C" fn u128_type(p: u128) { } |
| | ^^^^ not FFI-safe |
| | |
| = note: 128-bit integers don't currently have a known stable ABI |
| |
| error: `extern` fn uses type `(i32, i32)`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:85:33 |
| | |
| LL | pub extern "C" fn tuple_type(p: (i32, i32)) { } |
| | ^^^^^^^^^^ not FFI-safe |
| | |
| = help: consider using a struct instead |
| = note: tuples have unspecified layout |
| |
| error: `extern` fn uses type `(i32, i32)`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:88:34 |
| | |
| LL | pub extern "C" fn tuple_type2(p: I32Pair) { } |
| | ^^^^^^^ not FFI-safe |
| | |
| = help: consider using a struct instead |
| = note: tuples have unspecified layout |
| |
| error: `extern` fn uses type `ZeroSize`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:91:32 |
| | |
| LL | pub extern "C" fn zero_size(p: ZeroSize) { } |
| | ^^^^^^^^ not FFI-safe |
| | |
| = help: consider adding a member to this struct |
| = note: this struct has no fields |
| note: the type is defined here |
| --> $DIR/lint-ctypes-fn.rs:26:1 |
| | |
| LL | pub struct ZeroSize; |
| | ^^^^^^^^^^^^^^^^^^^^ |
| |
| error: `extern` fn uses type `ZeroSizeWithPhantomData`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:94:40 |
| | |
| LL | pub extern "C" fn zero_size_phantom(p: ZeroSizeWithPhantomData) { } |
| | ^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe |
| | |
| = note: composed only of `PhantomData` |
| note: the type is defined here |
| --> $DIR/lint-ctypes-fn.rs:61:1 |
| | |
| LL | pub struct ZeroSizeWithPhantomData(PhantomData<i32>); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| |
| error: `extern` fn uses type `std::marker::PhantomData<bool>`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:97:51 |
| | |
| LL | pub extern "C" fn zero_size_phantom_toplevel() -> PhantomData<bool> { |
| | ^^^^^^^^^^^^^^^^^ not FFI-safe |
| | |
| = note: composed only of `PhantomData` |
| |
| error: `extern` fn uses type `fn()`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:102:30 |
| | |
| LL | pub extern "C" fn fn_type(p: RustFn) { } |
| | ^^^^^^ not FFI-safe |
| | |
| = help: consider using an `extern fn(...) -> ...` function pointer instead |
| = note: this function pointer has Rust-specific calling convention |
| |
| error: `extern` fn uses type `fn()`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:105:31 |
| | |
| LL | pub extern "C" fn fn_type2(p: fn()) { } |
| | ^^^^ not FFI-safe |
| | |
| = help: consider using an `extern fn(...) -> ...` function pointer instead |
| = note: this function pointer has Rust-specific calling convention |
| |
| error: `extern` fn uses type `std::boxed::Box<u32>`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:108:35 |
| | |
| LL | pub extern "C" fn fn_contained(p: RustBadRet) { } |
| | ^^^^^^^^^^ not FFI-safe |
| | |
| = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct |
| = note: this struct has unspecified layout |
| |
| error: `extern` fn uses type `i128`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:111:39 |
| | |
| LL | pub extern "C" fn transparent_i128(p: TransparentI128) { } |
| | ^^^^^^^^^^^^^^^ not FFI-safe |
| | |
| = note: 128-bit integers don't currently have a known stable ABI |
| |
| error: `extern` fn uses type `str`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:114:38 |
| | |
| LL | pub extern "C" fn transparent_str(p: TransparentStr) { } |
| | ^^^^^^^^^^^^^^ not FFI-safe |
| | |
| = help: consider using `*const u8` and a length instead |
| = note: string slices have no C equivalent |
| |
| error: `extern` fn uses type `std::boxed::Box<u32>`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:117:37 |
| | |
| LL | pub extern "C" fn transparent_fn(p: TransparentBadFn) { } |
| | ^^^^^^^^^^^^^^^^ not FFI-safe |
| | |
| = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct |
| = note: this struct has unspecified layout |
| |
| error: `extern` fn uses type `std::marker::PhantomData<bool>`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:161:43 |
| | |
| LL | pub extern "C" fn unused_generic2<T>() -> PhantomData<bool> { |
| | ^^^^^^^^^^^^^^^^^ not FFI-safe |
| | |
| = note: composed only of `PhantomData` |
| |
| error: `extern` fn uses type `std::vec::Vec<T>`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:174:39 |
| | |
| LL | pub extern "C" fn used_generic4<T>(x: Vec<T>) { } |
| | ^^^^^^ not FFI-safe |
| | |
| = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct |
| = note: this struct has unspecified layout |
| |
| error: `extern` fn uses type `std::vec::Vec<T>`, which is not FFI-safe |
| --> $DIR/lint-ctypes-fn.rs:177:41 |
| | |
| LL | pub extern "C" fn used_generic5<T>() -> Vec<T> { |
| | ^^^^^^ not FFI-safe |
| | |
| = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct |
| = note: this struct has unspecified layout |
| |
| error: aborting due to 20 previous errors |
| |