Skip to content

rework the way cfgs are handled#281

Merged
KodrAus merged 9 commits intobitflags:mainfrom
KodrAus:chore/all-cleanup
May 10, 2022
Merged

rework the way cfgs are handled#281
KodrAus merged 9 commits intobitflags:mainfrom
KodrAus:chore/all-cleanup

Conversation

@KodrAus
Copy link
Copy Markdown
Member

@KodrAus KodrAus commented May 3, 2022

Closes #137
Closes #198
Closes #215

The current approach for handling #[cfg]'d flags is to define a trait that includes all names unconditionally, and then only set them to values based on actual #[cfg]'s. Unfortunately this means we can't support redefining flags (they'd appear twice in the unconditional list). This approach simplifies things by defining an internal Bits trait that captures the operations we require of primitive bits types. We now define all as from_bits_truncate with all bits set.

@KodrAus
Copy link
Copy Markdown
Member Author

KodrAus commented May 3, 2022

r? @arturoc

@KodrAus
Copy link
Copy Markdown
Member Author

KodrAus commented May 4, 2022

Getting back to having a single macro that defines bitflags types should make it much easier for us to do #264 properly. After that I think we're just about ready for the next major release (the first with the BitFlags trait).

@KodrAus KodrAus merged commit 810dc35 into bitflags:main May 10, 2022
@hillin
Copy link
Copy Markdown

hillin commented Aug 16, 2022

When is this change going to be released?

@hillin
Copy link
Copy Markdown

hillin commented Aug 18, 2022

@KodrAus Is there a plan to release with this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Debug formatting leads to less desireable output Support allow non_upper_case_globals lint. Constants cannot be cfg-gated multiple times

2 participants