-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
New lints: an enum variant changes from unit/tuple/struct to another kind. #884
Comments
Nice catch! Similarly to the For a piece of code like: pub enum Example {
Plain,
Tuple(),
Struct {},
} Note that We want the following lints:
Remaining questions:
|
Addresses the following checkbox in #884 public API struct variant with at least one public API field changes to another kind --------- Co-authored-by: frankwang <73262844+Frank-III@users.noreply.github.com> Co-authored-by: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com>
Describe your use case
We have lints for when a
struct
changes "kind":tuple_struct_to_plain_struct
unit_struct_changed_kind
However, currently
cargo-semver-checks
does not check when an enum variant changes kind like this.from:
to:
the first three variants would break with:
the second three also have breakage in a similar fashion, and
cargo-semver-checks
currently does not catch thefields_missing/removed lints because these variants changed kind
Describe the solution you'd like
Thus, it would be helpful to have lint(s) that detect this change for constructible enum variants - if a tuple/struct variant is marked
#[non_exhaustive]
in the baseline version, this is not a breaking change because it was not possible to construct these variants in the baseline version.Alternatives, if applicable
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: