-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add enum_no_longer_non_exhaustive
lint.
#1181
Add enum_no_longer_non_exhaustive
lint.
#1181
Conversation
src/query.rs
Outdated
@@ -1246,6 +1246,7 @@ add_lints!( | |||
enum_tuple_variant_field_missing, | |||
enum_tuple_variant_field_now_doc_hidden, | |||
enum_unit_variant_changed_kind, | |||
enum_unmarked_non_exhaustive, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind renaming this lint to follow the implicit convention for items that have stopped being ? For example, consider function_abi_no_longer_unwind
.
SemverQuery( | ||
id: "enum_unmarked_non_exhaustive", | ||
human_readable_name: "enum unmarked #[non_exhaustive]", | ||
description: "A Public API enum is no longer #[non_exhaustive]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please ensure your capitalization and word/style choices match existing lints.
"public": "public", | ||
"non_exhaustive": "#[non_exhaustive]", | ||
}, | ||
error_message: "A Public API enum is no longer #[non_exhaustive]. External code may assume all variants are known, causing breaking changes if new ones are added.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here: please pay close attention to capitalization and style and ensure everything matches existing lints. For example, we don't capitalize Public
.
enum_unmarked_non_exhaustive
lint.enum_no_longer_non_exhaustive
lint.
Addresses the following checkbox in #949 -
removing #[non_exhaustive] from a public API enum