зеркало из https://github.com/mozilla/fxrecord.git
ba32575185
The new message implementation macro, `message_ty!`, is written as a procedural macro to make the maintenance burden easier. Declarative macros may be conceptually simpler, but attempting to make `impl_message!` work for either `struct` or `enum` members was *hard* and got very messy very fast. Additionally [rust#22694][rust22694] prevents using declarative macros to generate item fragments (e.g., enum variants inside `enum Foo {}`), which makes creating a maintainable decl macro quite hard. It ended up being less effort to both rewrite it as a proc macro and also add support for `enum` members. As a side effect, this macro provides better error spans when it is provided with invalid input (instead of the generic `no rules expected the token {token}` error). [rust22694]: https://github.com/rust-lang/rust/issues/22694 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |