hashbrown
A Rust port of Google's SwissTable hash map
0.17.1
2.2B downloads/mo
#1 most downloaded on crates.io
rust-lang/hashbrown
What this package is like to depend on
Last release 3 months ago
09 May 2026
Release timing varies
gaps range from 3 weeks to 5 months
Nearly every release is documented
notes for 52 of 52 stable releases
4 versions withdrawn
withdrawn after publishing
8 years old
56 releases · first in 2018
4 releases in the last 12 months
see the full history below
Release timeline
56 releases · Oct 2018 to May 2026Releases
latest 56-
0.17.109 May 2026 -
0.17.009 Apr 2026Release notes
Open source →Added
- Added
hash_table::OccupiedEntry::replace_entry_with(#669) - Added
hash_map::{OccupiedEntry::into_entry, VacantEntryRef::insert_entry_with_key}(#670) - Added
hash_table::UnsafeIter(#667) - Added
itermethods to variousHashTableiterators (#667) - Added
HashMap::{replace_key,replace_key_unchecked,insert_with_key_unchecked}(#681) - Added
into_mapmethods to allHashMapentry types (#686) - Added
into_tablemethods to allHashTableentry types (#686) - Added
#[must_use]to constructors (#697) TryReserveErrornow implementsError(#698)
Changed
Fixed
Release notes
Open source →Added
- Added
hash_table::OccupiedEntry::replace_entry_with(#669) - Added
hash_map::{OccupiedEntry::into_entry, VacantEntryRef::insert_entry_with_key}(#670) - Added
hash_table::UnsafeIter(#667) - Added
itermethods to variousHashTableiterators (#667) - Added
HashMap::{replace_key,replace_key_unchecked,insert_with_key_unchecked}(#681) - Added
into_mapmethods to allHashMapentry types (#686) - Added
into_tablemethods to allHashTableentry types (#686) - Added
#[must_use]to constructors (#697) TryReserveErrornow implementsError(#698)
Changed
- Changed
EntryRefto useToOwned(#670) - Bumped MSRV to 1.85 (2024 edition) (#676)
Fixed
HashTable:clone_fromnow forwards toRawTable::clone_frominstead of using the default implementation (#668)- Fixed potential UB in
RawTableInner::fallible_with_capacity(#692) - Fixed incorrect length if a hasher panics during rehash (#710)
- Added
-
0.16.120 Nov 2025Release notes
Open source →Added
- Added
HashTablemethods related to the raw bucket index (#657) - Added
VacantEntryRef::insert_with_key(#579)
Changed
- Removed specialization for
Copytypes (#662) - The
get_many_mutfamily of methods have been renamed toget_disjoint_mut
to match the standard library. The old names are still present for now, but
deprecated. (#648) - Recognize and use over-sized allocations when using custom allocators. (#523)
- Depend on
serde_coreinstead ofserde. (#649) - Optimized
collecton rayon parallel iterators. (#652)
Release notes
Open source →Added
- Added
HashTablemethods related to the raw bucket index (#657) - Added
VacantEntryRef::insert_with_key(#579)
Changed
- Removed specialization for
Copytypes (#662) - The
get_many_mutfamily of methods have been renamed toget_disjoint_mutto match the standard library. The old names are still present for now, but deprecated. (#648) - Recognize and use over-sized allocations when using custom allocators. (#523)
- Depend on
serde_coreinstead ofserde. (#649) - Optimized
collecton rayon parallel iterators. (#652)
- Added
-
0.16.029 Aug 2025Release notes
Open source →Changed
- Bump foldhash, the default hasher, to 0.2.0.
- Replaced
DefaultHashBuilderwith a newtype wrapper aroundfoldhashinstead of re-exporting it directly.
Release notes
Open source →Changed
- Bump foldhash, the default hasher, to 0.2.0.
- Replaced
DefaultHashBuilderwith a newtype wrapper aroundfoldhashinstead of re-exporting it directly.
-
0.15.507 Aug 2025Release notes
Open source →Added
- Added
Entry::or_default_entryandEntry::or_insert_entry.
Changed
- Re-implemented likely/unlikely with
#[cold]
Release notes
Open source →Added
- Added
Entry::or_default_entryandEntry::or_insert_entry.
Changed
- Re-implemented likely/unlikely with
#[cold]
- Added
-
0.15.407 Jun 2025Release notes
Open source →Changed
- Removed optional dependency on compiler-builtins. This only affects building as part of
std.
Release notes
Open source →Changed
- Removed optional dependency on compiler-builtins. This only affects building as part of
std.
- Removed optional dependency on compiler-builtins. This only affects building as part of
-
0.15.330 Apr 2025Release notes
Open source →Added
- SIMD implementation for LoongArch (#592, requires nightly)
Changed
- Optimized insertion path by avoiding an unnecessary
match_empty(#607) - Increased minimum table size for small types (#615)
- Dropped FnMut trait bounds from
ExtractIfdata structures (#616) - Relaxed constraint in
hash_map::EntryRefinsertion methodsK: From<&Q>to &Q:Into<K>(#611) - Added allocator template argument for
rustc_iter(#605) - The
allocator-api2/nightlyfeature is no longer enabled byhashbrown/nightly(#606)
Release notes
Open source →Added
- SIMD implementation for LoongArch (#592, requires nightly)
Changed
- Optimized insertion path by avoiding an unnecessary
match_empty(#607) - Increased minimum table size for small types (#615)
- Dropped FnMut trait bounds from
ExtractIfdata structures (#616) - Relaxed constraint in
hash_map::EntryRefinsertion methodsK: From<&Q>to &Q:Into<K>(#611) - Added allocator template argument for
rustc_iter(#605) - The
allocator-api2/nightlyfeature is no longer enabled byhashbrown/nightly(#606)
-
0.15.225 Nov 2024Release notes
Open source →Added
- Marked
const fnconstructors asrustc_const_stable_indirectwhen built as part of the standard library. (#586)
- Marked
-
0.15.104 Nov 2024Release notes
Open source →This release removes the
borshfeature introduced in 0.15.0 because it was found to be incorrectly implemented. Users should use thehashbrownfeature of theborshcrate instead which provides the same trait implementations. -
0.15.001 Oct 2024Release notes
Open source →Update changelog for v0.15.0, bump cargo.toml
Rather than just asking
@Amanieuto do all this, I decided to help out a bit. Put some question marks in the date field that will need to be replaced once this is actually merged.Will still need someone to do a proper release for this, but hopefully the changelog is good at least.
Release notes
Open source →This release was yanked due to a broken implementation of the
borshfeature.This update contains breaking changes that remove the
rawAPI with the hope of centralising on theHashTableAPI 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 therawAPI.Added
- Added
borshfeature withBorshSerializeandBorshDeserializeimpls. (#525) - Added
Assignimpls forHashSetoperators. (#529) - Added
Defaultimpls for iterator types. (#542) - Added
HashTable::iter_hash{,_mut}methods. (#549) - Added
Hash{Table,Map,Set}::allocation_sizemethods. (#553) - Implemented
DebugandFusedIteratorfor allHashTableiterators. (#561) - Specialized
Iterator::foldfor allHashTableiterators. (#561)
Changed
- Changed
hash_set::VacantEntry::insertto returnOccupiedEntry. (#495) - Improved
hash_set::Difference::size_hintlower-bound. (#530) - Improved
HashSet::is_disjointperformance. (#531) equivalentfeature is now enabled by default. (#532)HashSetoperators now return a set with the same allocator. (#529)- Changed the default hasher to foldhash. (#563)
ahashfeature has been renamed todefault-hasher. (#533)- Entry API has been reworked and several methods have been renamed. (#535)
Hash{Map,Set}::insert_unique_uncheckedis now unsafe. (#556)- The signature of
get_many_mutand related methods was changed. (#562)
Fixed
- Fixed typos, stray backticks in docs. (#558, #560)
Removed
- Raw entry API is now under
raw-entryfeature, to be eventually removed. (#534, #555) - Raw table API has been made private and the
rawfeature is removed; in the future, all code should be using theHashTableAPI instead. (#531, #546) rykvfeature was removed; this is now provided by therykvcrate instead. (#554)HashSet::get_or_insert_ownedwas removed in favor ofget_or_insert_with. (#555)
- Added
-
0.14.528 Apr 2024 -
0.14.419 Mar 2024 withdrawn -
0.14.326 Nov 2023Release notes
Open source →Added
- Specialized
foldimplementation of iterators. (#480)
Fixed
- Avoid using unstable
ptr::invalid_muton nightly. (#481)
- Specialized
-
0.14.219 Oct 2023Release notes
Open source →Added
HashTabletype which provides a low-level but safe API with explicit hashing. (#466)
Fixed
- Disabled the use of NEON instructions on big-endian ARM. (#475)
- Disabled the use of NEON instructions on Miri. (#476)
-
0.14.129 Sep 2023Release notes
Open source →Added
- Allow serializing
HashMaps that use a custom allocator. (#449)
Changed
- Use the
Equivalenttrait from theequivalentcrate. (#442) - Slightly improved performance of table resizing. (#451)
- Relaxed MSRV to 1.63.0. (#457)
- Removed
Clonerequirement from custom allocators. (#468)
Fixed
- Fixed custom allocators being leaked in some situations. (#439, #465)
- Allow serializing
-
0.14.005 Jun 2023Release notes
Open source →Added
- Support for
allocator-api2crate for interfacing with custom allocators on stable. (#417) - Optimized implementation for ARM using NEON instructions. (#430)
- Support for rkyv serialization. (#432)
Equivalenttrait to look up values withoutBorrow. (#345)Hash{Map,Set}::raw_table_mutis added which returns a mutable reference. (#404)- Fast path for
clearon empty tables. (#428)
Changed
- Optimized insertion to only perform a single lookup. (#277)
DrainFilter(drain_filter) has been renamed toExtractIfand no longer drops remaining elements when the iterator is dropped. #(374)- Bumped MSRV to 1.64.0. (#431)
{Map,Set}::raw_tablenow returns an immutable reference. (#404)VacantEntryandOccupiedEntrynow use the default hasher if none is specified in generics. (#389)RawTable::data_startnow returns aNonNullto matchRawTable::data_end. (#387)RawIter::{reflect_insert, reflect_remove}are now unsafe. (#429)RawTable::find_potentialis renamed tofind_or_find_insert_slotand returns anInsertSlot. (#429)RawTable::removenow also returns anInsertSlot. (#429)InsertSlotcan be used to insert an element withRawTable::insert_in_slot. (#429)RawIterHashno longer has a lifetime tied to that of theRawTable. (#427)- The trait bounds of
HashSet::raw_tablehave been relaxed to not requireEq + Hash. (#423) EntryRef::and_replace_entry_withandOccupiedEntryRef::replace_entry_withwere changed to give a&Kinstead of a&Qto the closure.
Removed
- Support for
bumpaloas an allocator with custom wrapper. Useallocator-api2feature inbumpaloto use it as an allocator forhashbrowncollections. (#417)
- Support for
-
0.13.212 Jan 2023Release notes
Open source →Fixed
- Added
#[inline(always)]tofind_inner. (#375) - Fixed
RawTable::allocation_infofor empty tables. (#376)
- Added
-
0.13.110 Nov 2022Release notes
Open source →Added
- Added
Equivalenttrait to customize key lookups. (#350) - Added support for 16-bit targets. (#368)
- Added
RawTable::allocation_infowhich provides information about the memory usage of a table. (#371)
Changed
- Bumped MSRV to 1.61.0.
- Upgraded to
ahash0.8. (#357) - Make
with_hasher_inconst. (#355) - The following methods have been removed from the
RawTableAPI in favor of safer alternatives:RawTable::erase_no_drop=> UseRawTable::eraseorRawTable::removeinstead.Bucket::read=> UseRawTable::removeinstead.Bucket::drop=> UseRawTable::eraseinstead.Bucket::write=> UseBucket::as_mutinstead.
Fixed
- Ensure that
HashMapallocations don't exceedisize::MAX. (#362) - Fixed issue with field retagging in scopeguard. (#359)
- Added
-
0.13.010 Nov 2022 withdrawnNothing published for this version
-
0.12.317 Jul 2022 -
0.12.208 Jul 2022Release notes
Open source →Added
- Added
EntryAPI 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
RawTableof aHashMap. (#335)
Changed
- Edited
do_allocto reduce LLVM IR generated. (#341)
- Added
-
0.12.102 May 2022Release notes
Open source →Fixed
- Fixed underflow in
RawIterRange::size_hint. (#325) - Fixed the implementation of
DebugforValuesMutandIntoValues. (#325)
- Fixed underflow in
-
0.12.017 Jan 2022Release notes
Open source →Added
- Added
From<[T; N]>andFrom<[(K, V); N]>forHashSetandHashMaprespectively. (#297) - Added an
allocator()getter to HashMap and HashSet. (#257) - Added
insert_unique_uncheckedtoHashMapandHashSet. (#293) - Added
into_keysandinto_valuesto HashMap. (#295) - Implement
From<array>onHashSetandHashMap. (#298) - Added
entry_refAPI toHashMap. (#201)
Changed
- 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_onewhenfeature = "nightly"is enabled. (#292) - Relaxed the bounds on
DebugforHashSet. (#296) - Rename
get_each_muttoget_many_mutand align API with the stdlib. (#291) - Don't hash the key when searching in an empty table. (#305)
Fixed
- Guard against allocations exceeding isize::MAX. (#268)
- Made
RawTable::insert_no_growunsafe. (#254) - Inline
static_empty. (#280) - Fixed trait bounds on Send/Sync impls. (#303)
- Added
-
0.11.225 Mar 2021Release notes
Open source →Fixed
- Added missing allocator type parameter to
HashMap's andHashSet'sCloneimpls. (#252)
- Added missing allocator type parameter to
-
0.11.120 Mar 2021 -
0.11.014 Mar 2021Release notes
Open source →Added
- Added safe
try_insert_no_growmethod toRawTable. (#229) - Added support for
bumpaloas an allocator without thenightlyfeature. (#231) - Implemented
DefaultforRawTable. (#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_insertmethod toHashMap. (#247)
Changed
- The minimum Rust version has been bumped to 1.49.0. (#230)
- Significantly improved compilation times by reducing the amount of generated IR. (#205)
Removed
- 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
- Fixed union length comparison. (#228)
- Added safe
-
0.10.016 Jan 2021 withdrawnRelease notes
Open source →This release was yanked due to inconsistent hashes being generated with the
nightlyfeature. (#248)Changed
- Parametrized
RawTable,HashSetandHashMapover 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)
- Parametrized
-
0.9.128 Sep 2020Release notes
Open source →Added
- Added safe methods to
RawTable(#202):get:findandas_refget_mut:findandas_mutinsert_entry:insertandas_mutremove_entry:findandremoveerase_entry:findanderase
Changed
- Removed
from_key_hashed_nocheck'sQ: Hash. (#200) - Made
RawTable::drainsafe. (#201)
- Added safe methods to
-
0.9.003 Sep 2020Release notes
Open source →Fixed
drain_filternow 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_filtermethods instd. (#187)
Added
- Added
replace_entry_withtoOccupiedEntry, andand_replace_entry_withtoEntry. (#190) - Implemented
FusedIteratorandsize_hintforDrainFilter. (#188)
Changed
- The minimum Rust version has been bumped to 1.36 (due to
crossbeamdependency). (#193) - Updated
ahashdependency to 0.4. (#198) HashMap::with_hasherandHashSet::with_hasherare nowconst fn. (#195)- Removed
T: Hash + EqandS: BuildHasherbounds onHashSet::new,with_capacity,with_hasher, andwith_capacity_and_hasher. (#185)
-
0.8.208 Aug 2020Release notes
Open source →Changed
- Avoid closures to improve compile times. (#183)
- Do not iterate to drop if empty. (#182)
-
0.8.116 Jul 2020Release notes
Open source →Added
- Added
eraseandremovetoRawTable. (#171) - Added
try_with_capacitytoRawTable. (#174) - Added methods that allow re-using a
RawIterforRawDrain,RawIntoIter, andRawParIter. (#175) - Added
reflect_removeandreflect_inserttoRawIter. (#175) - Added a
drain_filterfunction toHashSet. (#179)
Changed
- Deprecated
RawTable::erase_no_dropin favor oferaseandremove. (#176) insert_no_growis now exposed under the"raw"feature. (#180)
- Added
-
0.8.018 Jun 2020Release notes
Open source →Fixed
- Marked
RawTable::par_iterasunsafe. (#157)
Changed
- Reduced the size of
HashMap. (#159) - No longer create tables with a capacity of 1 element. (#162)
- Removed
K: Eq + Hashbounds onretain. (#163) - Pulled in
HashMapchanges from rust-lang/rust (#164):extend_onesupport on nightly.CollectionAllocErrrenamed toTryReserveError.- Added
HashSet::get_or_insert_owned. DefaultforHashSetno longer requiresT: Eq + HashandS: BuildHasher.
- Marked
-
0.7.227 Apr 2020Release notes
Open source →Added
- Added
or_insert_with_keytoEntry. (#152)
Fixed
- Partially reverted
Cloneoptimization which was unsound. (#154)
Changed
- Disabled use of
const-randomby default, which prevented reproducible builds. (#155) - Optimized
repeatfunction. (#150) - Use
NonNullfor buckets, which improves codegen for iterators. (#148)
- Added
-
0.7.116 Mar 2020Release notes
Open source →Added
- Added
HashMap::get_key_value_mut. (#145)
Changed
- Optimized
Cloneimplementation. (#146)
- Added
-
0.7.031 Jan 2020Release notes
Open source →Added
- Added a
drain_filterfunction toHashMap. (#135)
Changed
- Updated
ahashdependency to 0.3. (#141) - Optimized set union and intersection. (#130)
raw_entrycan now be used without requiringS: BuildHasher. (#123)RawTable::bucket_indexcan now be used under therawfeature. (#128)
- Added a
-
0.6.331 Oct 2019Release notes
Open source →Added
- Added an
ahash-compile-time-rngfeature (enabled by default) which allows disabling thecompile-time-rngfeature inahashto work around a Cargo bug. (#125)
- Added an
-
0.6.223 Oct 2019Release notes
Open source →Added
- Added an
inline-morefeature (enabled by default) which allows choosing a tradeoff between runtime performance and compilation time. (#119)
- Added an
-
0.6.104 Oct 2019Release notes
Open source →Added
- Added
Entry::insertandRawEntryMut::insert. (#118)
Changed
Group::static_emptywas changed from aconstto astatic(#116).
- Added
-
0.6.013 Aug 2019Release notes
Open source →Fixed
- Fixed AHash accidentally depending on
std. (#110)
Changed
- The minimum Rust version has been bumped to 1.32 (due to
randdependency).
- Fixed AHash accidentally depending on
-
0.5.104 Aug 2019 withdrawnRelease notes
Open source →This release was yanked due to a breaking change for users of
no-default-features.Added
- The experimental and unsafe
RawTableAPI is available under the "raw" feature. (#108) - Added entry-like methods for
HashSet. (#98)
Changed
- Changed the default hasher from FxHash to AHash. (#97)
hashbrownis now fullyno_stdon recent Rust versions (1.36+). (#96)
Fixed
- We now avoid growing the table during insertions when it wasn't necessary. (#106)
RawOccupiedEntryMutnow properly implementsSendandSync. (#100)- Relaxed
lazy_staticversion. (#92)
- The experimental and unsafe
-
0.5.012 Jun 2019Release notes
Open source →Fixed
- Resize with a more conservative amount of space after deletions. (#86)
Changed
- Exposed the Layout of the failed allocation in CollectionAllocErr::AllocErr. (#89)
-
0.4.030 May 2019Release notes
Open source →Fixed
- Fixed
Sendtrait bounds onIterMutnot matching the libstd one. (#82)
- Fixed
-
0.3.130 May 2019 -
0.3.022 Apr 2019Release notes
Open source →Changed
- Changed shrink_to to not panic if min_capacity < capacity. (#67)
Fixed
- Worked around emscripten bug emscripten-core/emscripten-fastcomp#258. (#66)
-
0.2.216 Apr 2019Release notes
Open source →Fixed
- Inlined non-nightly lowest_set_bit_nonzero. (#64)
- Fixed build on latest nightly. (#65)
-
0.2.114 Apr 2019Release notes
Open source →Changed
- Use for_each in map Extend and FromIterator. (#58)
- Improved worst-case performance of HashSet.is_subset. (#61)
Fixed
- Removed incorrect debug_assert. (#60)
-
0.2.002 Apr 2019Release notes
Open source →Changed
- 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
- Added
insert_with_hasherto the raw_entry API to allowK: !(Hash + Eq). (#54) - Added support for using hashbrown as the hash table implementation in libstd. (#46)
Fixed
- 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)
-
0.1.814 Jan 2019Release notes
Open source →Added
- Rayon parallel iterator support (#37)
raw_entrysupport (#31)#[may_dangle]on nightly (#31)try_reservesupport (#31)
Fixed
- Fixed variance on
IterMut. (#31)
-
0.1.705 Dec 2018Release notes
Open source →Fixed
- Fixed non-SSE version of convert_special_to_empty_and_full_to_deleted. (#32)
- Fixed overflow in rehash_in_place. (#33)
-
0.1.616 Nov 2018 -
0.1.508 Nov 2018 -
0.1.404 Nov 2018 -
0.1.301 Nov 2018Release notes
Open source →Added
- Serde support. (#14)
Fixed
- Make the compiler inline functions more aggressively. (#20)
-
0.1.231 Oct 2018 -
0.1.130 Oct 2018Release notes
Open source →Fixed
erase_no_dropoptimization not triggering in the SSE2 implementation. (#3)- Missing
SendandSyncfor hash map and iterator types. (#7) - Bug when inserting into a table smaller than the group width. (#5)
-
0.1.029 Oct 2018