All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
v0.15.0 - 2024-10-01
This update contains breaking changes that remove the raw
API with the hope of
centralising on the HashTable
API in the future. You can follow the discussion
and progress in #545 to discuss features you think should be added to this API
that were previously only possible on the raw
API.
- Added
borsh
feature withBorshSerialize
andBorshDeserialize
impls. (#525) - Added
Assign
impls forHashSet
operators. (#529) - Added
Default
impls for iterator types. (#542) - Added
HashTable::iter_hash{,_mut}
methods. (#549) - Added
Hash{Table,Map,Set}::allocation_size
methods. (#553) - Implemented
Debug
andFusedIterator
for allHashTable
iterators. (#561) - Specialized
Iterator::fold
for allHashTable
iterators. (#561)
- Changed
hash_set::VacantEntry::insert
to returnOccupiedEntry
. (#495) - Improved
hash_set::Difference::size_hint
lower-bound. (#530) - Improved
HashSet::is_disjoint
performance. (#531) equivalent
feature is now enabled by default. (#532)HashSet
operators now return a set with the same allocator. (#529)- Changed the default hasher to foldhash. (#563)
ahash
feature has been renamed todefault-hasher
. (#533)- Entry API has been reworked and several methods have been renamed. (#535)
Hash{Map,Set}::insert_unique_unchecked
is now unsafe. (#556)- The signature of
get_many_mut
and related methods was changed. (#562)
- Fixed typos, stray backticks in docs. (#558, #560)
- Raw entry API is now under
raw-entry
feature, to be eventually removed. (#534, #555) - Raw table API has been made private and the
raw
feature is removed; in the future, all code should be using theHashTable
API instead. (#531, #546) rykv
feature was removed; this is now provided by therykv
crate instead. (#554)HashSet::get_or_insert_owned
was removed in favor ofget_or_insert_with
. (#555)
v0.14.5 - 2024-04-28
- Fixed index calculation in panic guard of
clone_from_impl
. (#511)
v0.14.4 - 2024-03-19
This release was yanked due to a breaking change.
v0.14.3 - 2023-11-26
- Specialized
fold
implementation of iterators. (#480)
- Avoid using unstable
ptr::invalid_mut
on nightly. (#481)
v0.14.2 - 2023-10-19
HashTable
type which provides a low-level but safe API with explicit hashing. (#466)
- Disabled the use of NEON instructions on big-endian ARM. (#475)
- Disabled the use of NEON instructions on Miri. (#476)
v0.14.1 - 2023-09-28
- Allow serializing
HashMap
s that use a custom allocator. (#449)
- Use the
Equivalent
trait from theequivalent
crate. (#442) - Slightly improved performance of table resizing. (#451)
- Relaxed MSRV to 1.63.0. (#457)
- Removed
Clone
requirement from custom allocators. (#468)
- Fixed custom allocators being leaked in some situations. (#439, #465)
v0.14.0 - 2023-06-01
- Support for
allocator-api2
crate for interfacing with custom allocators on stable. (#417) - Optimized implementation for ARM using NEON instructions. (#430)
- Support for rkyv serialization. (#432)
Equivalent
trait to look up values withoutBorrow
. (#345)Hash{Map,Set}::raw_table_mut
is added which returns a mutable reference. (#404)- Fast path for
clear
on empty tables. (#428)
- Optimized insertion to only perform a single lookup. (#277)
DrainFilter
(drain_filter
) has been renamed toExtractIf
and no longer drops remaining elements when the iterator is dropped. #(374)- Bumped MSRV to 1.64.0. (#431)
{Map,Set}::raw_table
now returns an immutable reference. (#404)VacantEntry
andOccupiedEntry
now use the default hasher if none is specified in generics. (#389)RawTable::data_start
now returns aNonNull
to matchRawTable::data_end
. (#387)RawIter::{reflect_insert, reflect_remove}
are now unsafe. (#429)RawTable::find_potential
is renamed tofind_or_find_insert_slot
and returns anInsertSlot
. (#429)RawTable::remove
now also returns anInsertSlot
. (#429)InsertSlot
can be used to insert an element withRawTable::insert_in_slot
. (#429)RawIterHash
no longer has a lifetime tied to that of theRawTable
. (#427)- The trait bounds of
HashSet::raw_table
have been relaxed to not requireEq + Hash
. (#423) EntryRef::and_replace_entry_with
andOccupiedEntryRef::replace_entry_with
were changed to give a&K
instead of a&Q
to the closure.
- Support for
bumpalo
as an allocator with custom wrapper. Useallocator-api2
feature inbumpalo
to use it as an allocator forhashbrown
collections. (#417)
v0.13.2 - 2023-01-12
- Added
#[inline(always)]
tofind_inner
. (#375) - Fixed
RawTable::allocation_info
for empty tables. (#376)
v0.13.1 - 2022-11-10
- Added
Equivalent
trait to customize key lookups. (#350) - Added support for 16-bit targets. (#368)
- Added
RawTable::allocation_info
which provides information about the memory usage of a table. (#371)
- Bumped MSRV to 1.61.0.
- Upgraded to
ahash
0.8. (#357) - Make
with_hasher_in
const. (#355) - The following methods have been removed from the
RawTable
API in favor of safer alternatives:RawTable::erase_no_drop
=> UseRawTable::erase
orRawTable::remove
instead.Bucket::read
=> UseRawTable::remove
instead.Bucket::drop
=> UseRawTable::erase
instead.Bucket::write
=> UseBucket::as_mut
instead.
- Ensure that
HashMap
allocations don't exceedisize::MAX
. (#362) - Fixed issue with field retagging in scopeguard. (#359)
v0.12.3 - 2022-07-17
- Fixed double-drop in
RawTable::clone_from
. (#348)
v0.12.2 - 2022-07-09
- Added
Entry
API forHashSet
. (#342) - Added
Extend<&'a (K, V)> for HashMap<K, V, S, A>
. (#340) - Added length-based short-circuiting for hash table iteration. (#338)
- Added a function to access the
RawTable
of aHashMap
. (#335)
- Edited
do_alloc
to reduce LLVM IR generated. (#341)
v0.12.1 - 2022-05-02
- Fixed underflow in
RawIterRange::size_hint
. (#325) - Fixed the implementation of
Debug
forValuesMut
andIntoValues
. (#325)
v0.12.0 - 2022-01-17
- Added
From<[T; N]>
andFrom<[(K, V); N]>
forHashSet
andHashMap
respectively. (#297) - Added an
allocator()
getter to HashMap and HashSet. (#257) - Added
insert_unique_unchecked
toHashMap
andHashSet
. (#293) - Added
into_keys
andinto_values
to HashMap. (#295) - Implement
From<array>
onHashSet
andHashMap
. (#298) - Added
entry_ref
API toHashMap
. (#201)
- Bumped minimum Rust version to 1.56.1 and edition to 2021.
- Use u64 for the GroupWord on WebAssembly. (#271)
- Optimized
find
. (#279) - Made rehashing and resizing less generic to reduce compilation time. (#282)
- Inlined small functions. (#283)
- Use
BuildHasher::hash_one
whenfeature = "nightly"
is enabled. (#292) - Relaxed the bounds on
Debug
forHashSet
. (#296) - Rename
get_each_mut
toget_many_mut
and align API with the stdlib. (#291) - Don't hash the key when searching in an empty table. (#305)
- Guard against allocations exceeding isize::MAX. (#268)
- Made
RawTable::insert_no_grow
unsafe. (#254) - Inline
static_empty
. (#280) - Fixed trait bounds on Send/Sync impls. (#303)
v0.11.2 - 2021-03-25
- Added missing allocator type parameter to
HashMap
's andHashSet
'sClone
impls. (#252)
v0.11.1 - 2021-03-20
- Added missing
pub
modifier toBumpWrapper
. (#251)
v0.11.0 - 2021-03-14
- Added safe
try_insert_no_grow
method toRawTable
. (#229) - Added support for
bumpalo
as an allocator without thenightly
feature. (#231) - Implemented
Default
forRawTable
. (#237) - Added new safe methods
RawTable::get_each_mut
,HashMap::get_each_mut
, andHashMap::get_each_key_value_mut
. (#239) - Added
From<HashMap<T, ()>>
forHashSet<T>
. (#235) - Added
try_insert
method toHashMap
. (#247)
- The minimum Rust version has been bumped to 1.49.0. (#230)
- Significantly improved compilation times by reducing the amount of generated IR. (#205)
- We no longer re-export the unstable allocator items from the standard library, nor the stable shims approximating the same. (#227)
- Removed hasher specialization support from
aHash
, which was resulting in inconsistent hashes being generated for a key. (#248)
- Fixed union length comparison. (#228)
v0.10.0 - 2021-01-16
This release was yanked due to inconsistent hashes being generated with the nightly
feature. (#248)
- Parametrized
RawTable
,HashSet
andHashMap
over an allocator. (#133) - Improved branch prediction hints on stable. (#209)
- Optimized hashing of primitive types with AHash using specialization. (#207)
- Only instantiate
RawTable
's reserve functions once per key-value. (#204)
v0.9.1 - 2020-09-28
- Added safe methods to
RawTable
(#202):get
:find
andas_ref
get_mut
:find
andas_mut
insert_entry
:insert
andas_mut
remove_entry
:find
andremove
erase_entry
:find
anderase
- Removed
from_key_hashed_nocheck
'sQ: Hash
. (#200) - Made
RawTable::drain
safe. (#201)
v0.9.0 - 2020-09-03
drain_filter
now removes and yields items that do match the predicate, rather than items that don't. This is a breaking change to match the behavior of thedrain_filter
methods instd
. (#187)
- Added
replace_entry_with
toOccupiedEntry
, andand_replace_entry_with
toEntry
. (#190) - Implemented
FusedIterator
andsize_hint
forDrainFilter
. (#188)
- The minimum Rust version has been bumped to 1.36 (due to
crossbeam
dependency). (#193) - Updated
ahash
dependency to 0.4. (#198) HashMap::with_hasher
andHashSet::with_hasher
are nowconst fn
. (#195)- Removed
T: Hash + Eq
andS: BuildHasher
bounds onHashSet::new
,with_capacity
,with_hasher
, andwith_capacity_and_hasher
. (#185)
v0.8.2 - 2020-08-08
- Avoid closures to improve compile times. (#183)
- Do not iterate to drop if empty. (#182)
v0.8.1 - 2020-07-16
- Added
erase
andremove
toRawTable
. (#171) - Added
try_with_capacity
toRawTable
. (#174) - Added methods that allow re-using a
RawIter
forRawDrain
,RawIntoIter
, andRawParIter
. (#175) - Added
reflect_remove
andreflect_insert
toRawIter
. (#175) - Added a
drain_filter
function toHashSet
. (#179)
- Deprecated
RawTable::erase_no_drop
in favor oferase
andremove
. (#176) insert_no_grow
is now exposed under the"raw"
feature. (#180)
v0.8.0 - 2020-06-18
- Marked
RawTable::par_iter
asunsafe
. (#157)
- Reduced the size of
HashMap
. (#159) - No longer create tables with a capacity of 1 element. (#162)
- Removed
K: Eq + Hash
bounds onretain
. (#163) - Pulled in
HashMap
changes from rust-lang/rust (#164):extend_one
support on nightly.CollectionAllocErr
renamed toTryReserveError
.- Added
HashSet::get_or_insert_owned
. Default
forHashSet
no longer requiresT: Eq + Hash
andS: BuildHasher
.
v0.7.2 - 2020-04-27
- Added
or_insert_with_key
toEntry
. (#152)
- Partially reverted
Clone
optimization which was unsound. (#154)
- Disabled use of
const-random
by default, which prevented reproducible builds. (#155) - Optimized
repeat
function. (#150) - Use
NonNull
for buckets, which improves codegen for iterators. (#148)
v0.7.1 - 2020-03-16
- Added
HashMap::get_key_value_mut
. (#145)
- Optimized
Clone
implementation. (#146)
v0.7.0 - 2020-01-31
- Added a
drain_filter
function toHashMap
. (#135)
- Updated
ahash
dependency to 0.3. (#141) - Optimized set union and intersection. (#130)
raw_entry
can now be used without requiringS: BuildHasher
. (#123)RawTable::bucket_index
can now be used under theraw
feature. (#128)
v0.6.3 - 2019-10-31
- Added an
ahash-compile-time-rng
feature (enabled by default) which allows disabling thecompile-time-rng
feature inahash
to work around a Cargo bug. (#125)
v0.6.2 - 2019-10-23
- Added an
inline-more
feature (enabled by default) which allows choosing a tradeoff between runtime performance and compilation time. (#119)
v0.6.1 - 2019-10-04
- Added
Entry::insert
andRawEntryMut::insert
. (#118)
Group::static_empty
was changed from aconst
to astatic
(#116).
v0.6.0 - 2019-08-13
- Fixed AHash accidentally depending on
std
. (#110)
- The minimum Rust version has been bumped to 1.32 (due to
rand
dependency).
v0.5.1 - 2019-08-04
This release was yanked due to a breaking change for users of no-default-features
.
- The experimental and unsafe
RawTable
API is available under the "raw" feature. (#108) - Added entry-like methods for
HashSet
. (#98)
- Changed the default hasher from FxHash to AHash. (#97)
hashbrown
is now fullyno_std
on recent Rust versions (1.36+). (#96)
- We now avoid growing the table during insertions when it wasn't necessary. (#106)
RawOccupiedEntryMut
now properly implementsSend
andSync
. (#100)- Relaxed
lazy_static
version. (#92)
v0.5.0 - 2019-06-12
- Resize with a more conservative amount of space after deletions. (#86)
- Exposed the Layout of the failed allocation in CollectionAllocErr::AllocErr. (#89)
v0.4.0 - 2019-05-30
- Fixed
Send
trait bounds onIterMut
not matching the libstd one. (#82)
v0.3.1 - 2019-05-30
- Fixed incorrect use of slice in unsafe code. (#80)
v0.3.0 - 2019-04-23
- Changed shrink_to to not panic if min_capacity < capacity. (#67)
- Worked around emscripten bug emscripten-core/emscripten-fastcomp#258. (#66)
v0.2.2 - 2019-04-16
- Inlined non-nightly lowest_set_bit_nonzero. (#64)
- Fixed build on latest nightly. (#65)
v0.2.1 - 2019-04-14
- Use for_each in map Extend and FromIterator. (#58)
- Improved worst-case performance of HashSet.is_subset. (#61)
- Removed incorrect debug_assert. (#60)
v0.2.0 - 2019-03-31
- The code has been updated to Rust 2018 edition. This means that the minimum Rust version has been bumped to 1.31 (2018 edition).
- Added
insert_with_hasher
to the raw_entry API to allowK: !(Hash + Eq)
. (#54) - Added support for using hashbrown as the hash table implementation in libstd. (#46)
- Fixed cargo build with minimal-versions. (#45)
- Fixed
#[may_dangle]
attributes to match the libstdHashMap
. (#46) - ZST keys and values are now handled properly. (#46)
v0.1.8 - 2019-01-14
- Rayon parallel iterator support (#37)
raw_entry
support (#31)#[may_dangle]
on nightly (#31)try_reserve
support (#31)
- Fixed variance on
IterMut
. (#31)
v0.1.7 - 2018-12-05
- Fixed non-SSE version of convert_special_to_empty_and_full_to_deleted. (#32)
- Fixed overflow in rehash_in_place. (#33)
v0.1.6 - 2018-11-17
- Fixed compile error on nightly. (#29)
v0.1.5 - 2018-11-08
- Fixed subtraction overflow in generic::Group::match_byte. (#28)
v0.1.4 - 2018-11-04
- Fixed a bug in the
erase_no_drop
implementation. (#26)
v0.1.3 - 2018-11-01
- Serde support. (#14)
- Make the compiler inline functions more aggressively. (#20)
v0.1.2 - 2018-10-31
clear
segfaults when called on an empty table. (#13)
v0.1.1 - 2018-10-30
erase_no_drop
optimization not triggering in the SSE2 implementation. (#3)- Missing
Send
andSync
for hash map and iterator types. (#7) - Bug when inserting into a table smaller than the group width. (#5)
- Initial release