Skip to content

Allow bitflags v1 and v2 to coexist #877

Open
@Urhengulas

Description

@Urhengulas

There is a defmt::bitflags! macro which depends on the bitflags::bitflags! macro from the bitflags v1 crate. Since it's introduction there was a bitflags v2, but unfortunately we cannot just bump the dependency, since the defmt::bitflags! macro leaks implementation details of the bitflags::bitflags! macro and therefore the dependency update could break the code of defmt users.

Therefore we want to add two new cargo features to defmt: bitflags1 and bitflags2. They each gate a defmt::bitflags macro which depends on bitflags v1 and bitflags v2 respectively. To not break any existing code, the bitflags1 feature should be enabled by default. A compile_error when both are enabled sounds useful as well.

Note that there is an existing PR to update to bitflags v2: #746.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions