Remix.run Logo
▲ afdbcreid an hour ago

This is a minor advantage (but is an advantage) and when needed (rarely) you can usually workaround with a different fieldless enum and potentially a proc-macro to autogenerate it.

▲xeubie 41 minutes ago | parent | next [-]

It's not at all minor. Sometimes the tag enum already exists. Rust can't build a data enum on top of it: a derive macro only sees its own enum, so it generates a new tag enum instead. Now you have two tag enums to keep in sync by hand. Proc macros are always used to resolve deficiencies in the rust language, and they always lead to greater complexity and longer compile times.

▲tcfhgj an hour ago | parent | prev [-]

> proc-macro to autogenerate it.

https://docs.rs/strum/latest/strum/derive.EnumDiscriminants....