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 madeunsafe
at 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
unsafe
block) 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
serde
behaviors 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 takelen
as 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
. BitField
now supports signed integers!BitMemory
is 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,}DomainMut
types have been removed. The{Bit,}Domain
types now take aMutability
type parameter instead. The.{bit_,}domain{,_mut}()
methods onBitSlice
exist as normal, but have changed their return types to specify aConst
orMut
type parameter rather than{Bit,}Domain
or{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 arbitrarybool
streams, 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_all
is removed, as the standard-library API[T]::fill
replaces it.BitSlice::offset_from
is removed. Use.as_bitptr().offset_from()
.BitSlice::as_raw_slice
is 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.0
provides a more comprehensive coverage of the language primitives.wyz 0.5
contains 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.51
for 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
funty
dependency 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
static
to thebits!
argument for hidden-static construction. - Accelerate
Iter{Ones,Zeros}
with specialization. - Pull Request #104 by GitHub user @ordian fixed crashing when calling
BitVec::insert
exactly atself.len()
.
- Allowed use of atomic and
Cell
types 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>::Alias
system to prevent improper mutation. - Implemented
IntoIterator
onBitArray
. - Construct
BitVec
from integer elements, not just bits. - Added
.remove_alias()
to mutable-bit-slice iterators. - Ported more of
core::ptr
asbitvec::ptr
. - Renamed
BitMut
toBitRef
and create single-bitBitPtr
pointers. - Created
BitPtrRange
as an analogue toRange<*bool>
. - Removed deprecated
BitView
methods.
- Accelerated
BitSlice::copy_from_bitslice
- Created
BitSlice::offset_from
to 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
Local
toLocalBits
. - Fixed an incomplete change of default type parameters from
LocalBits
toLsb0
. - Introduced the
BitStore::Alias
system for coöperative mutation. - Reärranged the view conversion traits, creating
BitView
alongsideAsBits
andAsBitsMut
. - 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,
BitMemory
describes all unsigned integers, not justBitStore
implementors, andBitField
can 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 asBitSlice
s. - Renamed
Cursor
toBitOrder
, andLittleEndian
andBigEndian
toLsb0
andMsb0
. - Removed the
Words
alias, and implementedBitStore
on `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::mask
for faster direct memory access. - Created the
BitField
trait. - Added a
Word
alias to the target’susize
equivalent (now justusize
). - Created a
Local
implementation ofCursor
(now theLocalBits
alias). - Changed default type parameters to
<Local, Word>
. - Created the
index
module, reducing runtime assertions. - Fixed [Issue #33], reported by GitHub sure [@jonas-schievink], which addressed
incorrect reällocation in
BitVec::reserve
. - Updated
radium
dependency 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
Send
fromBitSlice
. - 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
Bits
toBitStore
- Created the
Bits
andBitsMut
traits to view ordinary memory as a bit-slice.
- Raised the MSRV to
1.33
. - Created the
domain
module, which manages all translations of bit-precision views into raw underlying memory. - Added a
bitbox!
macro constructor. - Improved the bit-region pointer encoding.
BitBox
andBitVec
are nowSync
, per discussions with [@ratorx].- Implemented
serde
support (behind theserde
feature). - 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
Send
andSync
onBitSlice
. - Disallowed
u64
on 32-bit targets.
- Renamed
Endian
toCursor
(nowBitOrder
) - Removed
Default
bound onBits
(nowBitStore
)
- Added
alloc
andstd
features in [Pull Request #3] by GitHub user [@rphmeier].
- Raised MSRV to
1.30
. - Created the
prelude
module. - 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 theBitVec
API to it.
- Expanded
bitvec!
argument syntax, and improved its codegen.
- Created
BitVec
andbitvec!
. - Created
Endian
(nowBitOrder
) andBits
(nowBitStore
) traits.