PackageTrack
Sign in Get early access

enumflags2

Enum-based bit flags

0.7.12 100M downloads/mo #806 most downloaded on crates.io meithecatte/enumflags2

What this package is like to depend on

Last release 1 years ago

09 Jun 2025

Release timing varies

gaps range from 2 weeks to 12 months

Some releases are documented

notes for 4 of 14 stable releases

7 versions withdrawn

withdrawn after publishing

8 years old

22 releases · first in 2019

0 releases in the last 12 months

see the full history below

Release timeline

22 releases · Jan 2019 to Jun 2025
2020 2021 2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 22
  1. 0.7.12 09 Jun 2025

    Nothing published for this version

  2. 0.7.11 17 Jan 2025

    Nothing published for this version

  3. 0.7.10 07 Jun 2024
    Release notes
    • Fix a case where the #[bitflags] macro would access the crate through enumflags2::... instead of ::enumflags2::.... This makes the generated code more robust and avoids triggering the unused_qualifications lint. (#58)
    • Rework the proc-macro to use syn with the derive feature (as opposed to full). This reduces the cargo build time for enumflags2 by about 20%.
    Open source →
  4. 0.7.9 12 Feb 2024
    Release notes
    • The BitFlag trait now includes convenience re-exports for the constructors of BitFlags. This lets you do MyFlag::from_bits instead BitFlags::<MyFlag>::from_bits where the type of the flag cannot be inferred from context (thanks @ronnodas).
    • The documentation now calls out the fact that the implementation of PartialOrd may not be what you expect (reported by @ronnodas).
    Open source →
  5. 0.7.8 13 Sep 2023
    Release notes
    • New API: BitFlags::set. Sets the value of a specific flag to that of the bool passed as argument. (thanks, @m4dh0rs3)
    • BitFlags now implements PartialOrd and Ord, to make it possible to use it as a key in a BTreeMap.
    • The bounds on the implementation of Hash got improved, so that it is possible to use it in code generic over T: BitFlag.
    Open source →
  6. 0.7.7 17 Apr 2023
    Release notes

    This release fixes a soundness issue in the make_bitflags! macro. Previously, code like this was accepted:

    #[bitflags]
    #[repr(u8)]
    #[derive(Copy, Clone, Debug)]
    enum Test {
        A = 1,
        B = 2,
    }
    
    impl Test {
        const C: u8 = 69;
    }
    
    fn main() {
        let x = make_bitflags!(Test::{C});
    }

    Iterating over x would then create values of Test with bit patterns that don't correspond to any of the variants, which is undefined behavior.

    This bug has been introduced in 0.7.0, together with the make_bitflags! macro itself.

    I don't think it is likely that this was actually present in anyone's code, but in an abundance of caution, I have yanked all affected versions.

    This issue has been assigned RUSTSEC-2023-0035.

    Open source →
  7. 0.7.6 01 Apr 2023 withdrawn
    Release notes
    • Update to syn 2.0 (thanks to @mwkmwkmwk)
    • Bump MSRV to 1.56.0 to support the above
    • Update crate metadata to compensate for gender drift :3
    Open source →
  8. 0.7.5 10 Apr 2022 withdrawn
    Release notes

    BitFlags now implements Display, which only shows the flag list (without the binary representation).

    Open source →
  9. 0.7.4 24 Mar 2022 withdrawn
    Release notes
    • Added BitFlags::len, which returns the number of flags set.
    • Added BitFlags::exactly_one, which converts a singleton flag set to the flag. Returns Option::None if the input is not a singleton.
    • The iterator returned by BitFlags::iter now implements ExactSizeIterator and FusedIterator.
    • BitFlags now implements IntoIterator.
    Open source →
  10. 0.7.3 26 Dec 2021 withdrawn
    Release notes
    • The code generated by the macro no longer triggers Clippy's use_self lint. To prevent further issues of this kind, Clippy now runs on the test suite in CI, with the pedantic and nursery lints enabled too.
    • Some more functions are marked #[inline] now. This will probably improve downstream performance in non-LTO builds.
    • Some more functions are marked #[must_use] now, at the suggestion of Clippy. If this triggers, your code was probably weird and/or broken, but it's not really a mistake I'd expect anyone to make.
    • Minor documentation improvements.
    Open source →
  11. 0.7.2 14 Dec 2021 withdrawn

    Nothing published for this version

  12. 0.7.1 24 Feb 2021 withdrawn

    Nothing published for this version

  13. 0.7.0 24 Feb 2021 withdrawn

    Nothing published for this version

  14. 0.7.0-preview1 12 Aug 2020 pre-release

    Nothing published for this version

  15. 0.6.4 21 Apr 2020

    Nothing published for this version

  16. 0.6.3 11 Apr 2020

    Nothing published for this version

  17. 0.6.2 16 Nov 2019

    Nothing published for this version

  18. 0.6.1 24 Oct 2019

    Nothing published for this version

  19. 0.6.0 04 Oct 2019

    Nothing published for this version

  20. 0.5.2 02 May 2019

    Nothing published for this version

  21. 0.5.1 02 Apr 2019

    Nothing published for this version

  22. 0.5.0 29 Jan 2019

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive