-
Notifications
You must be signed in to change notification settings - Fork 46
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
Fix two unsoundness bugs #49
Conversation
Codecov Report
|
Ugh, that's awkward that
There are no lifetimes between those either, so it should work just fine to hold both in the same struct. I guess you don't even really need the |
As a first, minimal step, I'd suggest just requiring |
I think this change is strictly more general than it was previously? If you just use It might be nice to provide |
53f9c00
to
fcb7dcc
Compare
You can only assume that if you know that the map was never in the hands of anything that might have called |
Yes, I think any code that takes a |
But provide `HashMap::guard` as a convenience method for getting a `Guard`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Fixes both #46 and the issue highlighted here (
K
andV
must both be'static
in case of a global collector!).@cuviper I wonder if we could do something cool with this change now that we have the
Collector
. I'm specifically thinking something likeHashMap::pin
, which returns aHashMapRef
(like in #45), which internally holds aLocalHandle
and aGuard
(not sure how to make the lifetimes work out).