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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bitfield): add .. to use all remaining bits #176

Merged
merged 4 commits into from
May 30, 2022

Conversation

hawkw
Copy link
Owner

@hawkw hawkw commented May 30, 2022

No description provided.

@hawkw hawkw marked this pull request as ready for review May 30, 2022 17:57
hawkw added 3 commits May 30, 2022 10:58
When built with `RUSTFLAGS="--cfg trace_macros"`, the bitfield crate
will now enable `trace_macros!`. This is useful for debugging macro
bugs.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
This fixes a bug where the `FromBits` impl for integers (e.g. `FromBits
for u8`, etc) would erroneously consume _all_ remaining bits in the
bitfield, rather than just the number of bits necessary for an integer
of that type.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
This commit adds support for `const NAME = ..;` in the bitfield macro to
consume all remaining bits after previous subfields.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
@hawkw hawkw force-pushed the eliza/bitfield-remaining branch from b2f57ed to 056bbb7 Compare May 30, 2022 18:00
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
@hawkw hawkw enabled auto-merge (rebase) May 30, 2022 18:02
@hawkw hawkw merged commit 1920795 into main May 30, 2022
@hawkw hawkw deleted the eliza/bitfield-remaining branch May 30, 2022 18:08
hawkw added a commit that referenced this pull request May 30, 2022
When built with `RUSTFLAGS="--cfg trace_macros"`, the bitfield crate
will now enable `trace_macros!`. This is useful for debugging macro
bugs.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
hawkw added a commit that referenced this pull request May 30, 2022
This fixes a bug where the `FromBits` impl for integers (e.g. `FromBits
for u8`, etc) would erroneously consume _all_ remaining bits in the
bitfield, rather than just the number of bits necessary for an integer
of that type.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
hawkw added a commit that referenced this pull request May 30, 2022
This commit adds support for `const NAME = ..;` in the bitfield macro to
consume all remaining bits after previous subfields.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
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.

None yet

1 participant