]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/lint-ctypes-73251-2.rs
Auto merge of #106349 - LeSeulArtichaut:dyn-star-tracking-issue, r=jackh726
[rust.git] / src / test / ui / lint / lint-ctypes-73251-2.rs
1 #![feature(type_alias_impl_trait)]
2 #![deny(improper_ctypes)]
3
4 pub trait TraitA {
5     type Assoc;
6 }
7
8 impl TraitA for u32 {
9     type Assoc = u32;
10 }
11
12 pub trait TraitB {
13     type Assoc;
14 }
15
16 impl<T> TraitB for T
17 where
18     T: TraitA,
19 {
20     type Assoc = <T as TraitA>::Assoc;
21 }
22
23 type AliasA = impl TraitA<Assoc = u32>;
24
25 type AliasB = impl TraitB<Assoc = AliasA>;
26
27 fn use_of_a() -> AliasA {
28     3
29 }
30
31 fn use_of_b() -> AliasB {
32     3
33 }
34
35 extern "C" {
36     pub fn lint_me() -> <AliasB as TraitB>::Assoc; //~ ERROR: uses type `AliasA`
37 }
38
39 fn main() {}