Skip to content

Commit

Permalink
Work around compile errors due to bitflags 2.3.0 (#26)
Browse files Browse the repository at this point in the history
It looks like bitflags 2.3.0 rearranged some internal details and that
caused `Self` within bitflag constants to no longer refer to the
top-level struct.

I have reported the issue upstream in bitflags/bitflags#353
  • Loading branch information
Phantomical authored May 17, 2023
1 parent 989262a commit 39318ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Fixed compile breakage due to https://github.com/bitflags/bitflags/issues/353

## [0.1.1] - 2023-05-14
### Added
Expand Down
6 changes: 3 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ bitflags! {
/// sample_type to its own field).
#[derive(Copy, Clone, Debug, Default)]
struct ConfigFlags : u64 {
const READ_FORMAT = ((1u64 << Self::READ_FORMAT_WIDTH) - 1);
const SAMPLE_TYPE = (u64::MAX << Self::READ_FORMAT_WIDTH) & (Self::SAMPLE_ID_ALL.bits() - 1);
const READ_FORMAT = ((1u64 << ConfigFlags::READ_FORMAT_WIDTH) - 1);
const SAMPLE_TYPE = (u64::MAX << ConfigFlags::READ_FORMAT_WIDTH) & (ConfigFlags::SAMPLE_ID_ALL.bits() - 1);

const SAMPLE_ID_ALL = 1 << 46;
const BRANCH_HW_INDEX = 1 << 47;
const MISC = u64::MAX << Self::MISC_OFFSET;
const MISC = u64::MAX << ConfigFlags::MISC_OFFSET;
}
}

Expand Down

0 comments on commit 39318ed

Please sign in to comment.