Add a test against Result<(), ()>

This commit is contained in:
Arvind Mukund 2024-03-18 19:45:40 -07:00
parent 014ddac9c9
commit b3f6511755
2 changed files with 12 additions and 2 deletions

View File

@ -170,7 +170,8 @@ extern "C" {
//~^ ERROR `extern` block uses type
fn result_cascading_e(x: Result<(), Result<(), num::NonZero<u8>>>);
//~^ ERROR `extern` block uses type
fn result_unit_t_e(x: Result<(), ()>);
//~^ ERROR `extern` block uses type
}
pub fn main() {}

View File

@ -237,5 +237,14 @@ LL | fn result_cascading_e(x: Result<(), Result<(), num::NonZero<u8>>>);
= help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
= note: enum has no representation hint
error: aborting due to 25 previous errors
error: `extern` block uses type `Result<(), ()>`, which is not FFI-safe
--> $DIR/lint-ctypes-enum.rs:174:27
|
LL | fn result_unit_t_e(x: Result<(), ()>);
| ^^^^^^^^^^^^^^ 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: aborting due to 26 previous errors