]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-type-bounds/traits-assoc-type-macros.rs
Auto merge of #103894 - mati865:gnullvm-libunwind-changes, r=thomcc
[rust.git] / src / test / ui / associated-type-bounds / traits-assoc-type-macros.rs
1 // check-pass
2 // incremental
3
4 // This test case makes sure that we can compile with incremental compilation
5 // enabled when there are macros, traits, inheritance and associated types involved.
6
7 trait Deserializer {
8     type Error;
9 }
10
11 trait Deserialize {
12     fn deserialize<D>(_: D) -> D::Error
13     where
14         D: Deserializer;
15 }
16
17 macro_rules! impl_deserialize {
18     ($name:ident) => {
19         impl Deserialize for $name {
20             fn deserialize<D>(_: D) -> D::Error
21             where
22                 D: Deserializer,
23             {
24                 loop {}
25             }
26         }
27     };
28 }
29
30 macro_rules! formats {
31     {
32         $($name:ident,)*
33     } => {
34         $(
35             pub struct $name;
36
37             impl_deserialize!($name);
38         )*
39     }
40 }
41 formats! { Foo, Bar, }
42
43 fn main() {}