Closed nameexhaustion closed 7 months ago
fn test() { use std::hash::BuildHasher; let x = 10; println!("x: {}", x); let rs = ahash::RandomState::new(); println!("ahash hash_one(x) {}", rs.clone().hash_one(x)); println!("ahash hash_one(&x) {}", rs.clone().hash_one(&x)); let rs = std::hash::RandomState::new(); println!("std hash_one(x) {}", rs.clone().hash_one(x)); println!("std hash_one(&x) {}", rs.clone().hash_one(&x)); }
x: 10 ahash hash_one(x) 3042556146200844667 ahash hash_one(&x) 14656816703936529722 std hash_one(x) 3528508081386770256 std hash_one(&x) 3528508081386770256
I believe this is not desirable behavior, I would instead expect hash(x) <=> hash(&x). This appears to be due to missing an impl for hash specialization on &T where T is a type that has specialized hash impls.
hash(x) <=> hash(&x)
impl
&T
T
I believe this is not desirable behavior, I would instead expect
hash(x) <=> hash(&x)
. This appears to be due to missing animpl
for hash specialization on&T
whereT
is a type that has specialized hash impls.