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.
There is a
defmt::bitflags!macro which depends on thebitflags::bitflags!macro from thebitflags v1crate. Since it's introduction there was abitflags v2, but unfortunately we cannot just bump the dependency, since thedefmt::bitflags!macro leaks implementation details of thebitflags::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:
bitflags1andbitflags2. They each gate adefmt::bitflagsmacro which depends onbitflags v1andbitflags v2respectively. To not break any existing code, thebitflags1feature should be enabled by default. Acompile_errorwhen both are enabled sounds useful as well.Note that there is an existing PR to update to bitflags v2: #746.