Skip to content

PartialEq/Eq and PartialOrd/Ord impls generated by #[derive(...)] are not generic for RHS #20927

Closed
@murarth

Description

@murarth

(Partial)Eq and (Partial)Ord traits are now generic for right-hand side expression, but derive-generated code has not caught up. That is, Option<T> is only comparable to other Option<T> instances, rather than any Option<U> where T: Eq<U>.

I'm currently working on implementing this myself; however, as I am not familiar with the code, I'm still working out the cleanest way to get it done. I suppose I'm wondering whether anyone has any advice or if anyone is already working on this or some other changes to derive that might include this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-syntaxextArea: Syntax extensionsC-feature-requestCategory: 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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions