]> git.lizzy.rs Git - rust.git/blob - src/test/ui/hygiene/fields-definition.rs
Rollup merge of #90202 - matthewjasper:xcrate-hygiene, r=petrochenkov
[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() {}