rust/tests/ui/hygiene/fields-definition.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
320 B
Rust
Raw Normal View History

2018-04-07 11:18:44 -05:00
#![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() {}