diff options
| author | Eduardo Sánchez Muñoz <eduardosm-dev@e64.io> | 2022-04-13 19:15:34 +0200 |
|---|---|---|
| committer | Eduardo Sánchez Muñoz <eduardosm-dev@e64.io> | 2022-04-14 19:35:40 +0200 |
| commit | 399c0dcc10434ba7e481ad70a7ab659994d63f59 (patch) | |
| tree | 080255345a8868281e9aac7dae11c02896e0dd8a | |
| parent | c58af72a03b8215b70cfb33d358519917fc9458b (diff) | |
| download | rust-399c0dcc10434ba7e481ad70a7ab659994d63f59.tar.gz rust-399c0dcc10434ba7e481ad70a7ab659994d63f59.zip | |
`Unique<T>` is now considered FFI-safe
| -rw-r--r-- | src/test/ui/lint/lint-ctypes-enum.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/lint/lint-ctypes-enum.stderr | 21 |
2 files changed, 6 insertions, 16 deletions
diff --git a/src/test/ui/lint/lint-ctypes-enum.rs b/src/test/ui/lint/lint-ctypes-enum.rs index d7f947aa0f3..7c206080593 100644 --- a/src/test/ui/lint/lint-ctypes-enum.rs +++ b/src/test/ui/lint/lint-ctypes-enum.rs @@ -67,7 +67,6 @@ extern "C" { fn option_fn(x: Option<extern "C" fn()>); fn nonnull(x: Option<std::ptr::NonNull<u8>>); fn unique(x: Option<std::ptr::Unique<u8>>); - //~^ ERROR `extern` block uses type `Option<Unique<u8>>` fn nonzero_u8(x: Option<num::NonZeroU8>); fn nonzero_u16(x: Option<num::NonZeroU16>); fn nonzero_u32(x: Option<num::NonZeroU32>); diff --git a/src/test/ui/lint/lint-ctypes-enum.stderr b/src/test/ui/lint/lint-ctypes-enum.stderr index f3991ab4177..1601bd9d629 100644 --- a/src/test/ui/lint/lint-ctypes-enum.stderr +++ b/src/test/ui/lint/lint-ctypes-enum.stderr @@ -54,17 +54,8 @@ LL | | G, LL | | } | |_^ -error: `extern` block uses type `Option<Unique<u8>>`, which is not FFI-safe - --> $DIR/lint-ctypes-enum.rs:69:17 - | -LL | fn unique(x: Option<std::ptr::Unique<u8>>); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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` block uses type `u128`, which is not FFI-safe - --> $DIR/lint-ctypes-enum.rs:75:23 + --> $DIR/lint-ctypes-enum.rs:74:23 | LL | fn nonzero_u128(x: Option<num::NonZeroU128>); | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe @@ -72,7 +63,7 @@ LL | fn nonzero_u128(x: Option<num::NonZeroU128>); = note: 128-bit integers don't currently have a known stable ABI error: `extern` block uses type `i128`, which is not FFI-safe - --> $DIR/lint-ctypes-enum.rs:82:23 + --> $DIR/lint-ctypes-enum.rs:81:23 | LL | fn nonzero_i128(x: Option<num::NonZeroI128>); | ^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe @@ -80,7 +71,7 @@ LL | fn nonzero_i128(x: Option<num::NonZeroI128>); = note: 128-bit integers don't currently have a known stable ABI error: `extern` block uses type `Option<TransparentUnion<NonZeroU8>>`, which is not FFI-safe - --> $DIR/lint-ctypes-enum.rs:87:28 + --> $DIR/lint-ctypes-enum.rs:86:28 | LL | fn transparent_union(x: Option<TransparentUnion<num::NonZeroU8>>); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe @@ -89,7 +80,7 @@ LL | fn transparent_union(x: Option<TransparentUnion<num::NonZeroU8>>); = note: enum has no representation hint error: `extern` block uses type `Option<Rust<NonZeroU8>>`, which is not FFI-safe - --> $DIR/lint-ctypes-enum.rs:89:20 + --> $DIR/lint-ctypes-enum.rs:88:20 | LL | fn repr_rust(x: Option<Rust<num::NonZeroU8>>); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe @@ -98,7 +89,7 @@ LL | fn repr_rust(x: Option<Rust<num::NonZeroU8>>); = note: enum has no representation hint error: `extern` block uses type `Result<(), NonZeroI32>`, which is not FFI-safe - --> $DIR/lint-ctypes-enum.rs:90:20 + --> $DIR/lint-ctypes-enum.rs:89:20 | LL | fn no_result(x: Result<(), num::NonZeroI32>); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe @@ -106,5 +97,5 @@ LL | fn no_result(x: Result<(), num::NonZeroI32>); = 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 9 previous errors +error: aborting due to 8 previous errors |
