-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Derive Eq for RandomState #32068
Derive Eq for RandomState #32068
Conversation
Test doesn't appear to compile: https://travis-ci.org/rust-lang/rust/builds/113961471#L3473 |
Errors should be fixed now. I ran |
Tagging with T-libs so we can discuss in triage (just some new API surface area) |
We discussed this in the libs meeting, and we weren't entirely convinced by the motivation. In particular, it seems to me that something like unioning bloom filters would be better served by having a custom hasher that's the same globally, so bitor-ing always works (also, how does one union two bloom filters if the hashers are different? Storing all the elements added to be able rehash them? Isn't the point of a bloom filter to avoid that sort of memory overhead?). Additionally, as it stands, two Could you expand a little on your thoughts here? |
Not by much. You would still need them to have the same size and number of buckets in order to union them. Ensuring equal hash function, buckets, and size is easy enough; you just clone a Bloom filter (which you can already do, as Having a single, global hash function would work, but it would be less flexible (you would be bound to use whatever hash function the library defines), and it would not make unioning much easier due to the restrictions on size and number of buckets mentioned above.
Yeah, you can't union two different filters at all, at least not without iterating over all the original items inserted into them. I should probably have formulated myself a bit differently. |
☔ The latest upstream changes (presumably #32248) made this pull request unmergeable. Please resolve the merge conflicts. |
Closing due to inactivity, but feel free to resubmit with a rebase! |
It should be possible to see if two hash functions are equal. In my case I need this in order to quickly union two Bloom filters (a simple bitwise OR if the hash functions are equal).