-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
add implementation of Ord for Cell<T> and RefCell<T> where T: Ord #33306
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
I think these sort of proxy impls for |
It is safe code. Borrow on |
Of course it's safe, but it might be surprising. I don't think there's any other operator impl in the standard library that can panic.
Why isn't
The difference is that the I don't think it's too much of a hassle to have to write Regarding |
Eq is implemented on RefCell. That will cause the same issue. To be consistent we should add this as well. |
Huh, indeed. In that case, I agree that these should be added for consistency. Same for |
For historical context: #25744 |
I'd be fine merging this. This is just extending what we already have with |
The libs team discussed this during triage the other day and the conclusion was to merge. Thanks again for the PR @vadixidav! |
⌛ Testing commit 4dcb637 with merge 992bb13... |
add implementation of Ord for Cell<T> and RefCell<T> where T: Ord Raised this in issue #33305.
Raised this in issue #33305.