diff options
Diffstat (limited to 'tests/ui/lint/lint-ctypes-73249-2.rs')
-rw-r--r-- | tests/ui/lint/lint-ctypes-73249-2.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/ui/lint/lint-ctypes-73249-2.rs b/tests/ui/lint/lint-ctypes-73249-2.rs new file mode 100644 index 000000000..691047c8a --- /dev/null +++ b/tests/ui/lint/lint-ctypes-73249-2.rs @@ -0,0 +1,29 @@ +#![feature(type_alias_impl_trait)] +#![deny(improper_ctypes)] + +pub trait Baz {} + +impl Baz for () {} + +type Qux = impl Baz; + +fn assign() -> Qux {} + +pub trait Foo { + type Assoc: 'static; +} + +impl Foo for () { + type Assoc = Qux; +} + +#[repr(transparent)] +pub struct A<T: Foo> { + x: &'static <T as Foo>::Assoc, +} + +extern "C" { + pub fn lint_me() -> A<()>; //~ ERROR: uses type `Qux` +} + +fn main() {} |