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

feat: added new lint enum_variant_field_deprecated #1096

Closed
wants to merge 1 commit into from

Conversation

Gmin2
Copy link

@Gmin2 Gmin2 commented Feb 2, 2025

part of #57

Copy link
Owner

@obi1kenobi obi1kenobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is also broadly in the right direction, though it seems to have some of the same issues as #1095. I didn't point out those duplicate issues since I figured you can probably spot them already, but feel free to ask questions if you aren't sure.

public_api @filter(op: "=", value: ["$true"])
}
variant {
... on StructVariant {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tuple variants can also have deprecated fields:

pub enum Example {
    Variant(#[deprecated] i64),
}

We'll need to add separate lints for struct and tuple variants, so let's name this lint enum_struct_variant_field_deprecated and the tuple one enum_tuple_variant_field_deprecated.

... on StructVariant {
variant_name: name @output
field {
field_name: name @output @tag
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both variants and their fields can be #[doc(hidden)], so we'll need public_api_eligible checks in both the variant and the field blocks, in both baseline and current. Test cases for all these situations would be good too.

@obi1kenobi
Copy link
Owner

Going to close this for inactivity for now, just to un-claim the issue it's attached to. If you get a chance to come back to it and complete it, feel free to reopen the PR. Hope all is well!

@obi1kenobi obi1kenobi closed this Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants