Skip to content

Release 0.7.0

Compare
Choose a tag to compare
@meithecatte meithecatte released this 24 Feb 15:41
· 73 commits to master since this release

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 of MyFlags::Foo | MyFlags::Bar. Works in a const fn, too!
  • Many new APIs that allow working with BitFlags in a const fn despite rustc limitations
  • Many improved error messages
  • Implementation details do not show up in user documentation anymore
  • Breaking change: rename the RawBitFlags trait to BitFlag - 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 of usize was used, which is a terrible idea for the size of a bitfield
  • Breaking change: BitFlags::new is now called from_bits_unchecked - new suggests that this is the main, preferred way of creating BitFlags. This is not the case.
  • the value returned by Default::default can now be customized with #[bitflags(default = Foo | Bar)]