rust/tests/ui/lint/lint-ctypes-73249-2.rs

30 lines
385 B
Rust

#![feature(type_alias_impl_trait)]
#![deny(improper_ctypes)]
trait Baz {}
impl Baz for () {}
type Qux = impl Baz;
fn assign() -> Qux {}
trait Foo {
type Assoc: 'static;
}
impl Foo for () {
type Assoc = Qux;
}
#[repr(transparent)]
struct A<T: Foo> {
x: &'static <T as Foo>::Assoc,
}
extern "C" {
fn lint_me() -> A<()>; //~ ERROR: uses type `Qux`
}
fn main() {}