]> git.lizzy.rs Git - rust.git/blob - tests/ui/lint/lint-ctypes-66202.rs
Rollup merge of #106397 - compiler-errors:new-solver-impl-wc, r=lcnr
[rust.git] / tests / ui / lint / lint-ctypes-66202.rs
1 // check-pass
2
3 #![deny(improper_ctypes)]
4
5 // This test checks that return types are normalized before being checked for FFI-safety, and that
6 // transparent newtype wrappers are FFI-safe if the type being wrapped is FFI-safe.
7
8 #[repr(transparent)]
9 pub struct W<T>(T);
10
11 extern "C" {
12     pub fn bare() -> ();
13     pub fn normalize() -> <() as ToOwned>::Owned;
14     pub fn transparent() -> W<()>;
15 }
16
17 fn main() {}