]> git.lizzy.rs Git - rust.git/blob - src/test/ui/hygiene/assoc_ty_bindings.rs
Rollup merge of #90202 - matthewjasper:xcrate-hygiene, r=petrochenkov
[rust.git] / src / test / ui / hygiene / assoc_ty_bindings.rs
1 // check-pass
2 // ignore-pretty pretty-printing is unhygienic
3
4 #![feature(decl_macro, associated_type_defaults)]
5
6 trait Base {
7     type AssocTy;
8     fn f();
9 }
10 trait Derived: Base {
11     fn g();
12 }
13
14 macro mac() {
15     type A = dyn Base<AssocTy = u8>;
16     type B = dyn Derived<AssocTy = u8>;
17
18     impl Base for u8 {
19         type AssocTy = u8;
20         fn f() {
21             let _: Self::AssocTy;
22         }
23     }
24     impl Derived for u8 {
25         fn g() {
26             let _: Self::AssocTy;
27         }
28     }
29
30     fn h<T: Base, U: Derived>() {
31         let _: T::AssocTy;
32         let _: U::AssocTy;
33     }
34 }
35
36 mac!();
37
38 fn main() {}