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
update bitflags
dependency to 2.0
#152
Conversation
Codecov Report
@@ Coverage Diff @@
## master #152 +/- ##
==========================================
- Coverage 39.34% 34.75% -4.60%
==========================================
Files 4 4
Lines 4072 4610 +538
==========================================
Hits 1602 1602
- Misses 2470 3008 +538
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Interestingly, updating to the usage of The requisite bits have been put in their respective places, and all tests now pass. |
Hi @semiviral Thanks a lot for this PR. This looks great.
My thoughts on this is that |
Going with I suppose it's a trade-off? Either we truncate and lose the surety that our bit patterns are correct, or we panic when we've missed something (and hopefully implement it). Whichever you think is better, I'll run with. |
I checked the code and I think from_bits_truncate is fine because we never expose the members anyways to the user so they wouldn't be able to query the bits that got truncated in the first place. Will merge this thanks a lot! |
I rebased this to latest master and merge it, thanks! |
As title says, simply updates the bitflags dependency to 2.0, and fixes up the code for any of the API changes from
1.2 -> 2.0
.Namely, bitflags structs no longer implicitly define the following attributes:
These are re-implemented manually to reflect the proper derivations for the various bitflags types in the crate.
Additionally, many of the direct bitflags type constructors were broken:
While this is an effective behaviour change, the old behaviour can be retained via
::from_bits_retain
; however, this would only need to be used in cases where we fail to implement all of the bits of a specific CPUID bitflag (so, shouldn't be a concern with proper code coverage).