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

New lint: Exhaustive pub enum becomes #[non_exhaustive] #143

Closed
obi1kenobi opened this issue Sep 30, 2022 · 0 comments
Closed

New lint: Exhaustive pub enum becomes #[non_exhaustive] #143

obi1kenobi opened this issue Sep 30, 2022 · 0 comments
Labels
A-lint Area: new or existing lint C-enhancement Category: raise the bar on expectations E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: Mentorship is available for this issue.

Comments

@obi1kenobi
Copy link
Owner

obi1kenobi commented Sep 30, 2022

If an exhaustive pub enum becomes non-exhaustive, any pattern-matching on it outside of its own crate will be broken unless it includes a wildcard pattern like _ in the match.

We already have lints for structs that become non-exhaustive and enum variants that become non-exhaustive. This lint is quite similar and should be quite easy to add.

Mentorship available.

@obi1kenobi obi1kenobi added A-lint Area: new or existing lint C-enhancement Category: raise the bar on expectations E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: Mentorship is available for this issue. labels Sep 30, 2022
obi1kenobi added a commit that referenced this issue Oct 20, 2022
* First iteration.

* Newline at the end of non_exhaustive.rs

Co-authored-by: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com>

* Change wording in enum_marked_non_exhaustive.ron

Co-authored-by: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com>

* Change wording in enum_marked_non_exhaustive.ron

Co-authored-by: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com>

* Added missing include in src/query.rs file.

Co-authored-by: Bartosz Smolarczyk <bs429594@students.mimuw.edu.pl>
Co-authored-by: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: new or existing lint C-enhancement Category: raise the bar on expectations E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: Mentorship is available for this issue.
Projects
None yet
Development

No branches or pull requests

1 participant