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

Improved Partial{Eq,Ord} derive #3

Closed
10 tasks done
mcarton opened this issue Oct 8, 2016 · 2 comments
Closed
10 tasks done

Improved Partial{Eq,Ord} derive #3

mcarton opened this issue Oct 8, 2016 · 2 comments
Labels
feature-attribute Feature request: new attribute feature-derive Feature request: new derive

Comments

@mcarton
Copy link
Owner

mcarton commented Oct 8, 2016

Provide derivative({PartialEq, Eq, PartialOrd, Ord}) with:

  • Eq:
    • custom bound
  • PartialEq:
    • custom bound
    • ignore on a field
    • compare_with on a field
  • Ord:
    • custom bound
    • ignore on a field
    • compare_with on a field
  • PartialOrd:
    • custom bound
    • ignore on a field
    • compare_with on a field

enum are tricky¹ as there is no stable way to compare discriminants yet. See rust-lang/rfcs#1696.


1: not for Eq.

@mcarton mcarton added feature-attribute Feature request: new attribute feature-derive Feature request: new derive labels Oct 8, 2016
@mcarton
Copy link
Owner Author

mcarton commented Oct 9, 2016

Eq is done. I'm going to wait a while on dtolnay/syn#27 for the others.

@elidupree
Copy link

What's the current status of this? I have a project where it would be significantly helpful if I could derive Ord with custom bounds (to work around rust-lang/rust#26925 ). I'd submit a PR, but unfortunately the proc-macro code is still fairly opaque to me and I don't want to do it wrong.

@mcarton mcarton closed this as completed Aug 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-attribute Feature request: new attribute feature-derive Feature request: new derive
Projects
None yet
Development

No branches or pull requests

2 participants