-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Field attributes lost in proc macro input #68710
Copy link
Copy link
Closed
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
If we have an attribute macro whose input contains attributes on fields of a struct-expression, those attributes all seem to disappear before the macro is invoked.
The following repro compiles successfully if #[repro::repro] is removed, but fails with "error[E0062]: field `field` specified more than once" if the macro is present even though it does nothing.
Here is a script that reproduces the behavior as of rustc 1.42.0-nightly (212b2c7 2020-01-30)
Here is the input token stream as received by the proc macro
cc dtolnay/async-trait#63