]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/lint-ctypes-73249-2.rs
Auto merge of #106349 - LeSeulArtichaut:dyn-star-tracking-issue, r=jackh726
[rust.git] / src / test / 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() {}