Generate discriminants
Closed this issue · 1 comments
wycats commented
There doesn't seem to be any specific reason to require discriminants to be manually created. Can this be generated automatically?
meithecatte commented
I have thought about this before. The issue here is that derive
-style macros can't change the code, only add more. This means that an attribute-style macro (#[bitflags]
) would be needed.
I can see two ways forward here:
- Add the attribute macro alongside the derive macro. Downsides: potentially confusing to users, increased maintenance burden.
- Replace the derive macro with an attribute macro. Downsides: breaking change.
2b. As above, but with a transition period, and perhaps a deprecation warning.
I'll think about this some more.