Closed
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