Skip to content

Support skip attribute in Eq/PartialEq derives (#163) #483

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

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

tyranron
Copy link
Collaborator

@tyranron tyranron commented Jun 4, 2025

Part of #163
Requires #479

Synopsis

Support of skip attribute on fields and variants:

#[derive(Eq, PartialEq)]
enum E {
    Foo(bool, #[eq(skip)] NoEq),
    #[partial_eq(skip)]
    Bar(NoEq, NoEq),
}

Solution

Allow utils::attr::Skip on fields and variants.

Ergonomics

#[eq(skip)]/#[partial_eq(skip)] attributes are visible and mean the same for both Eq and PartialEq macros, allowing to use only one and do not repeat yourself.

TODO: describe variant logic

Checklist

  • Documentation is updated
  • Tests are added/updated
  • CHANGELOG entry is added (not required)

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

Successfully merging this pull request may close these issues.

Feature idea: PartialEq and PartialOrd for the wrapped type
1 participant