Skip to content
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

Documentation should clarify what it means for PartialEq and Ord/PartialOrd to "agree" #67938

Closed
dfoxfranke opened this issue Jan 6, 2020 · 2 comments
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@dfoxfranke
Copy link

It's obvious that if a == b, then a.partialCmp(b) == Some(Ordering::Equal). But what about the converse? Can == implement a stricter sense of equality than partialCmp does? For example, suppose I have a type that wraps Arc<String>. Could I legally give it Ord/PartialOrd instances that compare the Strings, while giving it Eq/PartialEq instances that call ptr_eq on the Arc?

@jonas-schievink jonas-schievink added A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jan 6, 2020
@JohnTitor JohnTitor added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jan 12, 2020
@Dylan-DPC
Copy link
Member

I feel the documentation specifies it well enough now. If anyone feels there it needs to be clearer, a newer issue might be a better idea than an issue that hasn't got a response for 4 years (minus 2 days :P )

@Dylan-DPC Dylan-DPC closed this as not planned Won't fix, can't repro, duplicate, stale Jun 4, 2024
@dfoxfranke
Copy link
Author

I agree, this can be closed. It was addressed by #85637.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants