-
Notifications
You must be signed in to change notification settings - Fork 292
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
Issue #225: Specialization fix #232
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Tom Kaitchuck <Tom.Kaitchuck@gmail.com>
Signed-off-by: Tom Kaitchuck <Tom.Kaitchuck@gmail.com>
CI is still failing on the test_into_iter_refresh test, could you look into it? |
It seems that any scheme in which hashbrown calculates the hash in a non-standard way depending on the type can't work. This is because we expose raw hashes as part of the RawEntry and RawTable APIs, where the user will pass hashes calculated using the standard method of As I have said before, I think the only way to support "short" hashing reliably is through changes to the standard library. This should be done through changes to the |
That strikes me as both unergonomic and limiting. It's not just the hasher implementation that restricts, but it also prevents the user from doing anything fancier like a specialized algorithm for their type. It would be a shame if RawEntrys forever prevented specialization, as it would impact all maps' performance when that API is not used. @Amanieu What sort of changes could accomplish this? I don't think the changes I am doing in specialization could just be ported as-is to the default implementation. That would change for example the numeric hash value of a hashed slice with existing hashers. I assume that would be unacceptable. Perhaps the invocation path I am using of calling |
On thought: The trait I am using do do the dispatch is here: |
☔ The latest upstream changes (presumably #233) made this pull request unmergeable. Please resolve the merge conflicts. |
This fixes #225
It uses the key type as the type specialization even when lookup occurs with a different type.