Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitflags workarounds #695

Closed
Tracked by #578
sunfishcode opened this issue Jun 19, 2023 · 2 comments · Fixed by #707
Closed
Tracked by #578

Bitflags workarounds #695

sunfishcode opened this issue Jun 19, 2023 · 2 comments · Fixed by #707

Comments

@sunfishcode
Copy link
Member

sunfishcode commented Jun 19, 2023

#615 includes subtle workarounds for bitflags 2.x, commented with "Use = and - because -= behaves differently". When bitflags is updated, remove the workarounds.

This was referenced Jun 19, 2023
@sunfishcode
Copy link
Member Author

It may also be worth exploring alternatives to bitflags. The bitflags crate seems to hold a mix of functions that seem to be trying to maintain some invariants, and functions that don't maintain any invariants, and I find it counterintuitive.

At a few quick searches though, I didn't find any alternatives that cater to rustix's particular needs, where the flags defined in rustix's code should always be assumed to be a subset of the real flags defined by an external API.

sunfishcode added a commit that referenced this issue Jun 28, 2023
Bitflags 2.3.3 fixes `-=` to behave the same as `-` and `=` separately,
so we can now remove the workarounds.

Fixes #695.
sunfishcode added a commit that referenced this issue Jun 28, 2023
Bitflags 2.3.3 fixes `-=` to behave the same as `-` and `=` separately,
so we can now remove the workarounds.

Fixes #695.
@sunfishcode
Copy link
Member Author

#708 tracks migrating away from bitflags.

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 a pull request may close this issue.

1 participant