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
BitFlags
without 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
BitFlags
in aconst fn
despite rustc limitations - Many improved error messages
- Implementation details do not show up in user documentation anymore
- Breaking change: rename the
RawBitFlags
trait toBitFlag
- there's nothing raw about it - Breaking change: the
not_literal
feature 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 ofusize
was used, which is a terrible idea for the size of a bitfield - Breaking change:
BitFlags::new
is now calledfrom_bits_unchecked
-new
suggests that this is the main, preferred way of creatingBitFlags
. This is not the case. - the value returned by
Default::default
can now be customized with#[bitflags(default = Foo | Bar)]