]> git.proxmox.com Git - rustc.git/blob - src/test/ui/lint/lint-ctypes-73251-2.rs
New upstream version 1.52.0~beta.3+dfsg1
[rustc.git] / src / test / ui / lint / lint-ctypes-73251-2.rs
1 // revisions: min_tait full_tait
2 #![feature(min_type_alias_impl_trait)]
3 #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
4 //[full_tait]~^ WARN incomplete
5 #![deny(improper_ctypes)]
6
7 pub trait TraitA {
8 type Assoc;
9 }
10
11 impl TraitA for u32 {
12 type Assoc = u32;
13 }
14
15 pub trait TraitB {
16 type Assoc;
17 }
18
19 impl<T> TraitB for T where T: TraitA {
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 { 3 }
28
29 fn use_of_b() -> AliasB { 3 }
30
31 extern "C" {
32 pub fn lint_me() -> <AliasB as TraitB>::Assoc; //~ ERROR: uses type `impl TraitA`
33 }
34
35 fn main() {}