-
Notifications
You must be signed in to change notification settings - Fork 287
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
Possible bug in v0.10 with lookups on Box<[u8]> #225
Comments
Nice catch, it seems that #207 is actually incorrect since the specialized hash impl is only called for cc @tkaitchuck |
I've yanked 0.10.0 until this gets resolved. |
Looking into it. |
I don't think that the current approach for specialization can reliably support all forms of |
We can make all of those work correctly. They just won't be able to use the optimized hash implementation |
I don't see any way other than simply disabling the use specialization altogether. We need to ensure that |
I can modify the make_hash function to dispatch based on K and pass the function some Q: Hash. Then if the key is CustomPointer<[u8]> and lookup is done with &[u8] it will use the non specialized path even though a specialized path exists. The only complication is this requires the K: Hash, which is not actually required for some method signatures. I am not sure why not, but at the moment it appears to be possible to construct an empty map which nothing can be inserted into and to call some methods which will all reflect the fact that the map is empty. |
I have a prototype of this working locally. It requires some significant changes I'll have a PR in a few days. |
Be careful about changing method signatures. Although we can make breaking changes in hashbrown, we should still ensure that hashbrown can be used as a base for the std hashmap. |
Once I get this merged and released: tkaitchuck/aHash#72 |
Raw entry is still unstable in libstd, so I think that's probably fine. |
The following code exits cleanly using hashbrown 0.9.1, but fails on hashbrown 0.10
Lookup of a
&Box<[u8]>
seems to work fine; the issue happens when callingget
with a&[u8]
on aHashSet<Box<[u8]>>
. I've seen similar behavior withHashMap
sThe text was updated successfully, but these errors were encountered: