Release 0.7.0
Release 0.7.0
- Breaking change: instead of
#[derive(BitFlags)], the macro is now#[bitflags]- This allows a long-awaited feature: when a discriminant isn't provided, the macro will choose an unused bit for you.
- You can now create instances of
BitFlagswithout repeating the name:make_bitflags!(MyFlags::{Foo, Bar})instead ofMyFlags::Foo | MyFlags::Bar. Works in aconst fn, too! - Many new APIs that allow working with
BitFlagsin aconst fndespite rustc limitations - Many improved error messages
- Implementation details do not show up in user documentation anymore
- Breaking change: rename the
RawBitFlagstrait toBitFlag- there's nothing raw about it - Breaking change: the
not_literalfeature doesn't exist, the relevant functionality is now enabled by default - there is no concern about confusing error messages anymore - Breaking change: the
#[repr(u??)]attribute is now required - previously, Rust's default ofusizewas used, which is a terrible idea for the size of a bitfield - Breaking change:
BitFlags::newis now calledfrom_bits_unchecked-newsuggests that this is the main, preferred way of creatingBitFlags. This is not the case. - the value returned by
Default::defaultcan now be customized with#[bitflags(default = Foo | Bar)]