Skip to content

Commit 0c8f029

Browse files
committed
Auto merge of #248 - Amanieu:remove_specialization, r=Amanieu
Remove aHash specialization support Unfortunately this feature causes compatibility issues with code that calculates hashes manually and then uses them with `RawEntryBuilderMut::from_hash` or `RawEntryBuilderMut::from_key_hashed_nocheck`. We may want to re-introduce this in the future, but this would require a comprehensive plan to address the breakage.
2 parents 2297523 + e7a7e4d commit 0c8f029

File tree

2 files changed

+9
-29
lines changed

2 files changed

+9
-29
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ edition = "2018"
1313

1414
[dependencies]
1515
# For the default hasher
16-
ahash = { version = "0.6.1", default-features = false, optional = true }
16+
ahash = { version = "0.7.0", default-features = false, optional = true }
1717

1818
# For external trait impls
1919
rayon = { version = "1.0", optional = true }

src/map.rs

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -251,20 +251,10 @@ where
251251
Q: Hash + ?Sized,
252252
S: BuildHasher,
253253
{
254-
#[cfg(feature = "ahash")]
255-
{
256-
//This enables specialization to improve performance on primitive types
257-
use ahash::CallHasher;
258-
let state = hash_builder.build_hasher();
259-
Q::get_hash(val, state)
260-
}
261-
#[cfg(not(feature = "ahash"))]
262-
{
263-
use core::hash::Hasher;
264-
let mut state = hash_builder.build_hasher();
265-
val.hash(&mut state);
266-
state.finish()
267-
}
254+
use core::hash::Hasher;
255+
let mut state = hash_builder.build_hasher();
256+
val.hash(&mut state);
257+
state.finish()
268258
}
269259

270260
#[cfg_attr(feature = "inline-more", inline)]
@@ -273,20 +263,10 @@ where
273263
K: Hash,
274264
S: BuildHasher,
275265
{
276-
#[cfg(feature = "ahash")]
277-
{
278-
//This enables specialization to improve performance on primitive types
279-
use ahash::CallHasher;
280-
let state = hash_builder.build_hasher();
281-
K::get_hash(val, state)
282-
}
283-
#[cfg(not(feature = "ahash"))]
284-
{
285-
use core::hash::Hasher;
286-
let mut state = hash_builder.build_hasher();
287-
val.hash(&mut state);
288-
state.finish()
289-
}
266+
use core::hash::Hasher;
267+
let mut state = hash_builder.build_hasher();
268+
val.hash(&mut state);
269+
state.finish()
290270
}
291271

292272
#[cfg(feature = "ahash")]

0 commit comments

Comments
 (0)