Make Number non-exhaustive#564
Conversation
|
@epage What are your thoughts on this compromise? |
| #[cfg(not(doc))] | ||
| #[allow(private_interfaces)] | ||
| __NonExhaustive(private::Never), |
There was a problem hiding this comment.
Unsure whats going on but this didn't make the enum exhaustive. I wonder if the compiler recognized that this variant cannot be constructed so therefore it doesn't need to be matched?
There was a problem hiding this comment.
Uff, maybe this comes from some of the newer uninhabited type matching ...
Since private::Never is private, we can make the type inhabited but not constructible. Would changing this be a breaking change?
There was a problem hiding this comment.
Currently, people can exhaustively match on Number. Making it actually non-exhaustive would then be a breaking change.
There was a problem hiding this comment.
We’ll definitely need a compile-fail test then to ensure there are no more slip ups - I’m sorry that the first fix didn’t catch this.
Fixes #563
CHANGELOG.md