All notable changes will be documented in this file.
This document is written according to the Keep a Changelog style.
bitvec’s initial development is now complete, and uses the one-dot series. It
will continue to receive maintenance, but its API is now stable and will not
change until const-generics allow BitArray to be rewritten.
The BitSlice::shift_{left,right} functions have been renamed to
BitSlice::shift_{start,end} to try to better reflect their behavior. These
functions move data relative to the index as defined by the O: BitOrder type
parameter, not according to the processor lsl and lsr instructions.
Performance regressions have been reported between the development series 0.20
onwards and 1.0. It appears at least some of these regressions are due to the
removal of the #[inline] attribute on bitvec public functions.
This attribute has been applied to all bitvec functions. You may see
regressions in size of your final artifact, but you should also see improvements
in your runtime speed. This is being tracked in sharksforarms/deku#246.
-
The
bits![static mut …]invocation has been madeunsafeat the invocation site, in response to Issue #156 filed by GitHub user @SimonSapin.This is technically an API break (formerly safe code now requires an
unsafeblock) but as no run-time behavior or compile-time types have changed except for this, and Rust considers breaking incorrect code to be acceptable within SemVer patches, I am publishing it as a patch. -
GitHub user @dtolnay fixed incorrect
serdebehaviors in Pull Request #185. This behavior was first reported in Issue #167 by GitHub user @Nelarius. -
Compilation no longer depends on environment variables set by Cargo, as requested in Pull Request #162 by GitHub user @rocallahan.
-
The
bitvec![val; len]macro can again takelenas a runtime value as well as a compile-time constant. Pull Request #160 was provided by GitHub user @coolreader18. -
The return types of
slice::Iter::by_{refs,vals}are restored to named types, rather thanimpl Iterator...opaque types. This allows them to be used directly in other sites. This defect was reported in Issue #169 by GitHub user @dignifiedquire.
🚨 THIS IS A BREAKING CHANGE RELEASE! 🚨
Your code has broken. You will need to change it in order to use this. This work on your part is worth it.
This release has a great deal of changes from the 0.22 development series!
Most breaking changes should have reasonable error messages indicating how they
can be repaired.
Removed APIs do not have deprecation notices! Use of removed APIs will fail to compile. You must check this changelog, or the crate documentation, to find out appropriate replacements.
The <O, T> type parameter pair that has existed since 0.10 is reversed
to be <T, O>! This will cause all of your type definitions to fail, as
suddenly all of your chosen type arguments do not satisfy the demanded traits.
This change was made in accordance with Issue #136, requested by GitHub user @changhe3.
- The MSRV is raised to
1.56. BitFieldnow supports signed integers!BitMemoryis completely removed.BitSlice::from_slice{,_mut}are now infallible constructors, and panic when the source is too long. The original fallible behavior is renamed toBitSlice::try_from_slice{,_mut}.- the
{Bit,}DomainMuttypes have been removed. The{Bit,}Domaintypes now take aMutabilitytype parameter instead. The.{bit_,}domain{,_mut}()methods onBitSliceexist as normal, but have changed their return types to specify aConstorMuttype parameter rather than{Bit,}Domainor{Bit,}DomainMut, respectively. Iter::by_{ref,val}are renamed toby_{ref,val}s, to prevent collision withIterator::by_ref.- The long-standing behavior of the
&=,|=, and^=operators has been changed! They now operate directly on data structures, rather than routing through iterators. If you want to perform boolean arithmetic using arbitraryboolstreams, use iterator combinators like.iter_mut().zip(stream).for_each(|(mut orig, new)| *orig ^= new). This change allows the arithmetic implementations to be accelerated when working between bit-slices of equal types. BitSlice::set_allis removed, as the standard-library API[T]::fillreplaces it.BitSlice::offset_fromis removed. Use.as_bitptr().offset_from().BitSlice::as_raw_sliceis removed. Use.domain()to access the underlying memory.
Module and type documentation have been lifted into the doc/ tree as Markdown
files. The user guide, in book/ has been more thoroughly rewritten.
Please file any problems or confusions about the documentation as an issue! The documentation is a project artifact equally, if not more, important as the Rust library.
As part of the migration of incidental logic out of bitvec, the following
utility libraries have been updated:
funty 2.0provides a more comprehensive coverage of the language primitives.wyz 0.5contains more logic formerly in the utility module, as well as a stronger system for generalizing over references.
bitvec’s first three and a half years of development used the zero-dot series
as it explored its behavior. These versions are now deprecated and will not
receive further support. They are listed only in summary, and may be removed
from crates.io in the future.
- Raised MSRV to
1.51for const generics. - Named the iterators produced by
Iter::by_{ref,val}. - Fixed Issue #114, reported by GitHub user @VilleHallivuori.
- Extracted pointer mutability tracking to
wyz 0.4.
- Raised
funtydependency to~1.2. - Moved bit-array typename construction out of
bitarr!and intoBitArr!. - Created
BitVec::from_{element,slice}constructors for Issue #6, reöpened by GitHub user @HamishWMC. - Fixed the behavior of
BitSlice::{first,last}_{one,zero}, requested in Issue #103 by GitHub user @seanyoung. - Added
BitSlice::{leading,trailing}_{ones,zeros}, also in #103 by @seanyoung. - Added
staticto thebits!argument for hidden-static construction. - Accelerate
Iter{Ones,Zeros}with specialization. - Pull Request #104 by GitHub user @ordian fixed crashing when calling
BitVec::insertexactly atself.len().
- Allowed use of atomic and
Celltypes as the original storage type. - Added bit-seeking APIs (
.iter_{ones,zeros}) to match APIs inbit-set, requested in Issue #83 by GitHub user @arucil. - Refined the
<T: Unsigned as BitStore>::Aliassystem to prevent improper mutation. - Implemented
IntoIteratoronBitArray. - Construct
BitVecfrom integer elements, not just bits. - Added
.remove_alias()to mutable-bit-slice iterators. - Ported more of
core::ptrasbitvec::ptr. - Renamed
BitMuttoBitRefand create single-bitBitPtrpointers. - Created
BitPtrRangeas an analogue toRange<*bool>. - Removed deprecated
BitViewmethods.
- Accelerated
BitSlice::copy_from_bitslice - Created
BitSlice::offset_fromto enable computing how far into a base bit-slice a subslice begins. - Used
radium 0.5’s stronger type system, including fallback aliases when targets do not have atomics. - Changed internal implementation of the macro constructors.
- Raised MSRV to
1.44. - Renamed the C-compatible ordering
LocaltoLocalBits. - Fixed an incomplete change of default type parameters from
LocalBitstoLsb0. - Introduced the
BitStore::Aliassystem for coöperative mutation. - Reärranged the view conversion traits, creating
BitViewalongsideAsBitsandAsBitsMut. - Greatly improved cross-compile testing with a CI suite by @AlexHuszagh.
- Removed numeric arithmetic, per Issue #17 (by me) and Issue #50 by GitHub user @luojia65.
- Created
BitArray, as requested in Issue #32 by GitHub user @FedericoPonzi. This also includes abitarr!constructor. - Merged Pull Request #68 by GitHub user @sharksforarms.
- Fixed Issue #69 by GitHub user @YoshikiTakashima.
- Per Issue #75 by GitHub user @diondokter,
BitMemorydescribes all unsigned integers, not justBitStoreimplementors, andBitFieldcan transact them all.
- In Pull Request #34, GitHub user @mystor provided a
bits!implementation that encodes buffers at compile time, and allows them to be borrowed asBitSlices. - Renamed
CursortoBitOrder, andLittleEndianandBigEndiantoLsb0andMsb0. - Removed the
Wordsalias, and implementedBitStoreon `usize. - Removed the
As{Ref,Mut}<BitSlice<_, T>>implementations for[T], as requested in [Issue #35] by GitHub user [@Fotosmile]. - Fixed [Issue #40] with [Pull Request #41], both provided by GitHub user [@ImmemorConsultrixContrarie].
- Fixed [Issue #43], reported by GitHub users @AlexHuszagh and [@obeah].
- Fixed an improper deällocation, per [Issue #55] reported by GitHub user [@kulp].
- Created
Cursor::maskfor faster direct memory access. - Created the
BitFieldtrait. - Added a
Wordalias to the target’susizeequivalent (now justusize). - Created a
Localimplementation ofCursor(now theLocalBitsalias). - Changed default type parameters to
<Local, Word>. - Created the
indexmodule, reducing runtime assertions. - Fixed [Issue #33], reported by GitHub sure [@jonas-schievink], which addressed
incorrect reällocation in
BitVec::reserve. - Updated
radiumdependency to0.3, fixing [Issue #36] reported by GitHub user [@lynaghk].
- Raised MSRV to
1.36. - Reärranged the feature set to use the now-available
extern crate alloc;. - Conditionally remove
SendfromBitSlice. - Improve the
bitvec!repetition constructor, as reported in [Issue #28] by GitHub user [@caelunshun].
- Added reversed (left-to-right) addition, requested in [Issue #16] by GitHub user [@GeorgeGkas].
- Changed the bit-region pointer encoding to its final form.
- Created
BitSlice::at, which manifests a proxy reference to a single bit. - Renamed
BitstoBitStore - Created the
BitsandBitsMuttraits to view ordinary memory as a bit-slice.
- Raised the MSRV to
1.33. - Created the
domainmodule, which manages all translations of bit-precision views into raw underlying memory. - Added a
bitbox!macro constructor. - Improved the bit-region pointer encoding.
BitBoxandBitVecare nowSync, per discussions with [@ratorx].- Implemented
serdesupport (behind theserdefeature). - Began working with atomics.
- Fixed [Issue #9], reported by GitHub user [@torce].
- Fixed [Issue #10], reported by GitHub user [@overminder].
- Fixed [Issue #12], reported by GitHub user [@koushiro].
- Fixed [Issue #15], reported by GitHub user [@schomatis].
- Raised the MSRV to
1.31. - Created the
BitPtr(nowBitSpan) pointer encoding that enables addressing any bit, not just the front of an element. - Fixed [Issue #7], reported by GitHub user [@geq1t], repairing
.count_{ones,zeros}inside single-element bit-slices. - Fixed [Issue #8], reported by GitHub user [@ratorx], implementing
SendandSynconBitSlice. - Disallowed
u64on 32-bit targets.
- Renamed
EndiantoCursor(nowBitOrder) - Removed
Defaultbound onBits(nowBitStore)
- Added
allocandstdfeatures in [Pull Request #3] by GitHub user [@rphmeier].
- Raised MSRV to
1.30. - Created the
preludemodule. - Adopted the Rust CoC.
- Raised MSRV to
1.25. - Renamed
.count_{one,zero}to.count_{ones,zeros}.
- Implemented
Hash. - Created numeric 2’s-complement arithmetic implementations.
- Created set-testing methods (
all,any,not_all,not_any,some,count_one,count_zero).
- Added
BitSlice::for_each. - Added more trait implementations.
- Added
BitSlice, and offloaded much of theBitVecAPI to it.
- Expanded
bitvec!argument syntax, and improved its codegen.
- Created
BitVecandbitvec!. - Created
Endian(nowBitOrder) andBits(nowBitStore) traits.