You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tested more things and it is possible to add support for custom attributes by creating our own attribute parser instead of using the default syn::Meta parser. However that leads to a more complex structure and duplicates some of the code from the syn library. Furthermore, because constants are evaluated much later than macros there is no way to get their actual value and validation for duplicate tags will not be possible.
Example:
constTEST_TAG:&str = "test";#[derive(Form)]enumFoo{#[form(tag = "test")]A,/// There is no way to check what the actual value of TEST_TAG is.#[form(tag = TEST_TAG)]B,}
Describe the bug
When using the
Form
derivation macro and specifying field names/enumeration tags etc, for example:the macro will only work if them name is a literal. If a constant is specified:
a compiler error is produced.
Expected behavior
The macro should accept a path to a constant string in addition to a literal.
The text was updated successfully, but these errors were encountered: