-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
Implement PartialEq for WeakRef #1006
Conversation
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.
I think that's OK, yes.
Why did you decide to not also implement Eq
, PartialOrd
, Ord
and Hash
though?
No specific reason. I was just focused on an implementation of WeakMap/WeakSet and needed I've just added |
Hm thinking about it a bit more, it's a bit problematic that the pointer value can just change. So if you store this in a I think |
I don't use |
|
I think |
I was looking how weak references are implemented in I want to have something better than |
Yes In summary, I think |
The others (that are not fine) include |
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=f68c45adc9f9b1fe064be663807a1b2c FWIW for the problem I mentioned. Funny enough there is even a clippy lint warning about that: https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type |
Does it make sense?
Related to #39