Skip to content

can't use private derive macros #339

@Freax13

Description

@Freax13

Starting with version 2 the generated type is a thin wrapper around an internal InternalBitFlags type that contains all the actual implementations. #[derive(...)] attributes can only be attached to the external type and not the internal type. This leads to problems for most derive macros because they require the macro to be applied to the internal type as well.
One strategy to solve this is to create a cargo feature for each crate that provides such macros and then derive its derive macros on the inner type if the feature is enabled (see #311, #312, #325). Unfortunately this is inherently limited to public crates: This solution does not work for non-public crates that use their own derive macros. I'd like to be able to use my custom derive macros on the internal type without having to publish the derive macro and adding it as a dependency on bitflags.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions