-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed as not planned
Closed as not planned
Copy link
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
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 String
s, while giving it Eq/PartialEq
instances that call ptr_eq
on the Arc
?
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.