summaryrefslogtreecommitdiffstats
path: root/tests/ui/hygiene/fields-definition.rs
blob: 173c357bd69a2b0e2e7cfee3594fa43c1ee3f19a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#![feature(decl_macro)]

macro modern($a: ident) {
    struct Modern {
        a: u8,
        $a: u8, // OK
    }
}

macro_rules! legacy {
    ($a: ident) => {
        struct Legacy {
            a: u8,
            $a: u8, //~ ERROR field `a` is already declared
        }
    }
}

modern!(a);
legacy!(a);

fn main() {}