Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hashing &T yields different results compared to T in **nightly** channel #237

Closed
cyc4188 opened this issue Jun 11, 2024 · 1 comment
Closed

Comments

@cyc4188
Copy link

cyc4188 commented Jun 11, 2024

#214 and #213 fix hash(x) != hash(&x), but this bug still exists in nightly channel

aHash Version: 0.8.11

nightly Version: nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.81.0-nightly (b5b13568f 2024-06-10)

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)  14903417265985317241
ahash hash_one(&x) 10595472914121346771
std hash_one(x)    752986751915508312
std hash_one(&x)   752986751915508312
@cyc4188
Copy link
Author

cyc4188 commented Jun 12, 2024

sorry. I find that ahash version 0.8.11 does not include the fix commit
it's correct using master branch. I'll close it

@cyc4188 cyc4188 closed this as completed Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant