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

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

Open
tmiasko opened this issue Feb 9, 2021 · 0 comments
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@tmiasko
Copy link
Contributor

tmiasko commented Feb 9, 2021

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

@rustbot rustbot added A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) 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

2 participants