Releases: kelpsyberry/proc-bitfield
Releases · kelpsyberry/proc-bitfield
v0.5.2
- Added the ability to specify field ranges using arbitrary expressions in addition to literals, by enclosing the expressions in parens (
(<expr>)
) - Reverted the fix from v0.5.1 due to it hindering other optimizations and the original issue only triggering in extremely specific cases
v0.5.1
- Fixed a missed LLVM optimization for single-bit writes to bitfields on AArch64 by using inline assembly; this requires both a nightly compiler and for the
aarch64-bit-fix
feature flag to be enabled (to prevent breakage due tounsafe
usage)
v0.5.0
- BREAKING: Renamed
FromRaw
,IntoRaw
andDerefRaw
toFromStorage
,IntoStorage
andDerefStorage
- Added nested bitfield support, used by specifying a field's type as
nested T
- Made bitfields
#[repr(transparent)]
- Added the ability to pack fields next to each other with
above; bits
,below; bits
,above
andbelow
FieldRange specifiers - Fixed generic bitfield support; however, if used, compile-time checks will be converted to runtime ones due to language limitations
v0.4.0
- BREAKING: Changed the default behavior of unsafe conversions to mark the accessor as unsafe; the old behavior (safe accessor that performs an unsafe conversion) can be obtained by adding a
!
suffix to the attribute name, i.e.unsafe_get! T
- Added field conversions through functions with
get_fn
,set_fn
,unsafe_get_fn
,unsafe_set_fn
,try_get_fn
,try_set_fn
,unwrap_get_fn
andunwrap_set_fn
- Made the
ConvRaw
derive implementbool
conversions for enums with only two variants with discriminants 0 and 1 (in any order) - Changes to the
BitRange<T>
andBit
traits:- Renamed and split the
BitRange<T>
trait, intoBits<T>
,WithBits<T>
andSetBits<T>
- Split the
Bit
trait intoBit
,WithBit
andSetBit
Bits<T>
andBit
read from a bitfieldWith*
traits return a changed version of the bitfieldSet*
traits modify the bitfield in-place
- Renamed and split the
- Changed the implementations of
UnsafeFrom<T>
andUnsafeInto<T>
so that eitherFrom<T>
orInto<T>
automatically implement both- Specifically,
UnsafeFrom<U> for T
now gets implemented ifU: Into<T>
(implied byT: From<U>
), andUnsafeInto<U> for T
gets implemented ifU: UnsafeFrom<T>
- Specifically,
- Added built-in
*Bits
and*Bit
implementations to use integer arrays as field and storage types, and to use unsized integer slices as storage types (only in the*bits!
macros)
v0.3.1
- Added
bits!
,with_bits!
andset_bits!
as alternatives tobitfield!
to operate on raw "bitfield storage" values without declaring a bitfield struct - Clarified
BitRange
's expected behavior in the documentation
v0.3.0
- Added
unwrap_get
/unwrap_set
/unwrap_both
/unwrap
as alternatives to thetry_*
field type conversions that also unwrap theResult
s - Added a new derive macro named
ConvRaw
for automatic fallible enum conversions to and from integer types; this allows much easier usage of enums as bitfield fields - Added a new derive macro named
UnwrapBitRange
to add an automatic implementation ofBitRange<T>
to any integer types that can be converted to (fallibly) and from (infallibly) T, unwrapping on reads - Fixed an edge case in the default
BitRange
implementation for signed storage types, and expanded the default implementations