]> git.lizzy.rs Git - rust.git/blob - src/test/ui/hygiene/fields-definition.rs
Merge commit '0969bc6dde001e01e7e1f58c8ccd7750f8a49ae1' into sync_cg_clif-2021-03-29
[rust.git] / src / test / ui / hygiene / fields-definition.rs
1 #![feature(decl_macro)]
2
3 macro modern($a: ident) {
4     struct Modern {
5         a: u8,
6         $a: u8, // OK
7     }
8 }
9
10 macro_rules! legacy {
11     ($a: ident) => {
12         struct Legacy {
13             a: u8,
14             $a: u8, //~ ERROR field `a` is already declared
15         }
16     }
17 }
18
19 modern!(a);
20 legacy!(a);
21
22 fn main() {}