Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upSerde field attributes not written to TokenStream #585
Comments
KodrAus
changed the title
Serde attributes not to TokenStream
Serde attributes not written to TokenStream
Oct 14, 2016
KodrAus
changed the title
Serde attributes not written to TokenStream
Serde field attributes not written to TokenStream
Oct 14, 2016
This comment has been minimized.
This comment has been minimized.
|
This is intentional - the crate would fail to compile if the attributes weren't stripped since they're unknown to the compiler. It's one of the known bugs on the tracking issue for macros 1.1: rust-lang/rust#35900 |
dtolnay
referenced this issue
Oct 18, 2016
Merged
Use post-expansion crate to let other custom derives see serde attrs #592
dtolnay
added
the
derive
label
Oct 19, 2016
dtolnay
closed this
in
#592
Oct 20, 2016
dtolnay
self-assigned this
Apr 9, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
KodrAus commentedOct 14, 2016
•
edited
Previously, I've piggybacked on
serde_codegen_internalsto get whether or not a field will be serialised, and if so, what it will be called.With the new macros 1.1 stuff this doesn't work because the
serdefield attributes are being removed from the token stream output if my code runs afterSerialize:Wouldn't this also affect attributes visible to
Deserializeif you also deriveSerializefirst?