You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When given a #[bitfield] struct with a #[repr = uN], e.g. #[repr = u32] attribute the #[bitfield] macro shall make sure that the generated bitfield struct respects the bitwidth of the uN, e.g. 8 bits for u8, 16 bits for u16, etc.
Also it shall generate From<uN> and From<BitfieldStruct> for uN implementations.
Obviously having #[repr(uN)] also changes the underlying representation of the bitfield type to uN.
* [tests] write tests for bytes=N #[bitfield] parameter
* [tests] fix test case assertions
* [tests] add some new failure tests for bytes parameter
* [impl] implement bytes parameter parsing and checking
* [tests] add test for duplicate bytes parameter
* [impl] improve span for duplicate bytes parameter
* [tests] add expected failure output for tests #33 and #34
* add implementation of new bytes=N check
* [tests] move bytes=N tests into their own directory
* [impl] apply rustfmt
* add impl sub-crate to workspace of modular_bitfield crate
* adjust GitHub actions CI to workspace
When given a
#[bitfield]
struct with a#[repr = uN]
, e.g.#[repr = u32]
attribute the#[bitfield]
macro shall make sure that the generated bitfield struct respects the bitwidth of theuN
, e.g. 8 bits foru8
, 16 bits foru16
, etc.Also it shall generate
From<uN>
andFrom<BitfieldStruct> for uN
implementations.Obviously having
#[repr(uN)]
also changes the underlying representation of the bitfield type touN
.Example
This allows the user to only conditionally have the
repr(u32)
effects taken place usingcfg_attr
:The text was updated successfully, but these errors were encountered: