-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.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
With cmp/ops reform, all of the comparison traits allow the types of the two sides to differ. However, the traits provide a default type for the right-hand size that is the same as the left-hand side. Thus, an impl like:
impl<T: PartialEq> PartialEq for Rc<T> { ... }
is more limited than it needs to be; it could instead be
impl<U, T: PartialEq<U>> PartialEq<Rc<U>> for Rc<T> { ... }
(Of course, you could imagine being even more general than that, allowing Rc values to be compared to other values.)
The various impls in the standard library should probably be generalized along these lines; currently a few are but most aren't.
gendxgendx
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.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.