-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.
Description
The invalid_value
lint has no issue with the following type being zero-initialized or left uninit:
enum OneFruitNonzero {
Apple(!),
Banana(NonZeroU32),
}
That seems like a case we should be able to handle.
I think for non-is_multi_variant
enums, we probably can compute the variant that does exist, and then we can recursively check if that one is valid? We'd also need a smarter is_multi_variant
that can handle some dataful variants (ensuring they are definitely inhabited).
Cc @5225225
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.