rust/tests/ui/extern/extern-C-str-arg-ice-80125.stderr
许杰友 Jieyou Xu (Joe) 1fcbb1e338 Revert #131669 due to ICEs
Revert <https://github.com/rust-lang/rust/pull/131669> due to ICE
reports:

- <https://github.com/rust-lang/rust/issues/134059> (real-world)
- <https://github.com/rust-lang/rust/issues/134060> (fuzzing)

The changes can be re-landed with those cases addressed.

This reverts commit 703bb982303ecab02fec593899639b4c3faecddd, reversing
changes made to f415c07494b98e4559e4b13a9c5f867b0e6b2444.
2024-12-09 17:31:16 +08:00

36 lines
1.4 KiB
Plaintext

warning: `extern` fn uses type `str`, which is not FFI-safe
--> $DIR/extern-C-str-arg-ice-80125.rs:3:23
|
LL | type ExternCallback = extern "C" fn(*const u8, u32, str);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider using `*const u8` and a length instead
= note: string slices have no C equivalent
= note: `#[warn(improper_ctypes_definitions)]` on by default
warning: `extern` fn uses type `str`, which is not FFI-safe
--> $DIR/extern-C-str-arg-ice-80125.rs:9:44
|
LL | pub extern "C" fn register_something(bind: ExternCallback) -> Struct {
| ^^^^^^^^^^^^^^ not FFI-safe
|
= help: consider using `*const u8` and a length instead
= note: string slices have no C equivalent
warning: `extern` fn uses type `Struct`, which is not FFI-safe
--> $DIR/extern-C-str-arg-ice-80125.rs:9:63
|
LL | pub extern "C" fn register_something(bind: ExternCallback) -> Struct {
| ^^^^^^ 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/extern-C-str-arg-ice-80125.rs:6:1
|
LL | pub struct Struct(ExternCallback);
| ^^^^^^^^^^^^^^^^^
warning: 3 warnings emitted