summaryrefslogtreecommitdiffstats
path: root/tests/ui/hygiene/fields-definition.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/hygiene/fields-definition.rs')
-rw-r--r--tests/ui/hygiene/fields-definition.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/hygiene/fields-definition.rs b/tests/ui/hygiene/fields-definition.rs
new file mode 100644
index 000000000..173c357bd
--- /dev/null
+++ b/tests/ui/hygiene/fields-definition.rs
@@ -0,0 +1,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() {}