diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/lint/opaque-ty-ffi-unsafe.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/lint/opaque-ty-ffi-unsafe.rs b/src/test/ui/lint/opaque-ty-ffi-unsafe.rs new file mode 100644 index 000000000..b7cc38e99 --- /dev/null +++ b/src/test/ui/lint/opaque-ty-ffi-unsafe.rs @@ -0,0 +1,15 @@ +#![feature(type_alias_impl_trait)] +#![deny(improper_ctypes)] + +type A = impl Fn(); + +pub fn ret_closure() -> A { + || {} +} + +extern "C" { + pub fn a(_: A); + //~^ ERROR `extern` block uses type `A`, which is not FFI-safe [improper_ctypes] +} + +fn main() {} |