]> git.proxmox.com Git - rustc.git/blob - tests/ui/lint/lint-ctypes-73249-2.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / lint / lint-ctypes-73249-2.rs
1 #![feature(type_alias_impl_trait)]
2 #![deny(improper_ctypes)]
3
4 pub trait Baz {}
5
6 impl Baz for () {}
7
8 type Qux = impl Baz;
9
10 fn assign() -> Qux {}
11
12 pub trait Foo {
13 type Assoc: 'static;
14 }
15
16 impl Foo for () {
17 type Assoc = Qux;
18 }
19
20 #[repr(transparent)]
21 pub struct A<T: Foo> {
22 x: &'static <T as Foo>::Assoc,
23 }
24
25 extern "C" {
26 pub fn lint_me() -> A<()>; //~ ERROR: uses type `Qux`
27 }
28
29 fn main() {}