Skip to content

Create a canonical implementation of traits and use it in tuples & derive macros #81915

Open

Description

I have a meta-suggestion - make the implementation of PartialOrd (and potentially other derivable traits) for tuples in libcore a golden standard, and make built-in macros follow it exactly.
All structures should be equivalent to tuples up to field names.

  • Make the same changes as this PR does to impl PartialOrd for (T1, T2, ...) in libcore, benchmark them, pass them through T-libs, etc.
  • Generate exactly the same code (up to field names) in rustc_builtin_macros and link both implementation to each other with docs telling that any changes must be synchronized.

Originally posted by @petrochenkov in #81384 (comment)

@rustbot label: +T-libs +A-macros

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)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