Skip to content

Generate discriminants #21

Closed
Closed

Description

@wycats

There doesn't seem to be any specific reason to require discriminants to be manually created. Can this be generated automatically?

Activity

  1. meithecatte commented on Dec 10, 2019

    @meithecatte
    Owner

    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:

    1. Add the attribute macro alongside the derive macro. Downsides: potentially confusing to users, increased maintenance burden.
    2. 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.

  2. added this to the Release 1.0 milestone on Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions