rust/tests/ui/lint/lint-ctypes-94223.stderr

136 lines
4.8 KiB
Plaintext

error: `extern` fn uses type `[u8]`, which is not FFI-safe
--> $DIR/lint-ctypes-94223.rs:4:15
|
LL | pub fn bad(f: extern "C" fn([u8])) {}
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider using a raw pointer instead
= note: slices have no C equivalent
note: the lint level is defined here
--> $DIR/lint-ctypes-94223.rs:2:9
|
LL | #![deny(improper_ctypes_definitions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `extern` fn uses type `[u8]`, which is not FFI-safe
--> $DIR/lint-ctypes-94223.rs:7:28
|
LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider using a raw pointer instead
= note: slices have no C equivalent
error: `extern` fn uses type `[u8]`, which is not FFI-safe
--> $DIR/lint-ctypes-94223.rs:7:49
|
LL | pub fn bad_twice(f: Result<extern "C" fn([u8]), extern "C" fn([u8])>) {}
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider using a raw pointer instead
= note: slices have no C equivalent
error: `extern` fn uses type `[u8]`, which is not FFI-safe
--> $DIR/lint-ctypes-94223.rs:11:18
|
LL | struct BadStruct(extern "C" fn([u8]));
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider using a raw pointer instead
= note: slices have no C equivalent
error: `extern` fn uses type `[u8]`, which is not FFI-safe
--> $DIR/lint-ctypes-94223.rs:15:7
|
LL | A(extern "C" fn([u8])),
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider using a raw pointer instead
= note: slices have no C equivalent
error: `extern` fn uses type `[u8]`, which is not FFI-safe
--> $DIR/lint-ctypes-94223.rs:20:7
|
LL | A(extern "C" fn([u8])),
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider using a raw pointer instead
= note: slices have no C equivalent
error: `extern` fn uses type `[u8]`, which is not FFI-safe
--> $DIR/lint-ctypes-94223.rs:24:12
|
LL | type Foo = extern "C" fn([u8]);
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider using a raw pointer instead
= note: slices have no C equivalent
error: `extern` fn uses type `Option<&<T as FooTrait>::FooType>`, which is not FFI-safe
--> $DIR/lint-ctypes-94223.rs:31:20
|
LL | pub type Foo2<T> = extern "C" fn(Option<&<T as FooTrait>::FooType>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
= note: enum has no representation hint
error: `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
--> $DIR/lint-ctypes-94223.rs:41:17
|
LL | pub static BAD: extern "C" fn(FfiUnsafe) = f;
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
note: the type is defined here
--> $DIR/lint-ctypes-94223.rs:34:1
|
LL | pub struct FfiUnsafe;
| ^^^^^^^^^^^^^^^^^^^^
error: `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
--> $DIR/lint-ctypes-94223.rs:44:30
|
LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUnsafe)> = Ok(f);
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
note: the type is defined here
--> $DIR/lint-ctypes-94223.rs:34:1
|
LL | pub struct FfiUnsafe;
| ^^^^^^^^^^^^^^^^^^^^
error: `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
--> $DIR/lint-ctypes-94223.rs:44:56
|
LL | pub static BAD_TWICE: Result<extern "C" fn(FfiUnsafe), extern "C" fn(FfiUnsafe)> = Ok(f);
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
note: the type is defined here
--> $DIR/lint-ctypes-94223.rs:34:1
|
LL | pub struct FfiUnsafe;
| ^^^^^^^^^^^^^^^^^^^^
error: `extern` fn uses type `FfiUnsafe`, which is not FFI-safe
--> $DIR/lint-ctypes-94223.rs:48:22
|
LL | pub const BAD_CONST: extern "C" fn(FfiUnsafe) = f;
| ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
note: the type is defined here
--> $DIR/lint-ctypes-94223.rs:34:1
|
LL | pub struct FfiUnsafe;
| ^^^^^^^^^^^^^^^^^^^^
error: aborting due to 12 previous errors