Closed aDotInTheVoid closed 4 years ago
The MSRV bump alone is enough to disqualify this, sorry. Moreover, IMO you have missed a really critical disadvantage: the __Nonexhaustive
variant permits crate internal implementations to do exhaustive case analysis.
The final nail in the coffin is that this enum will go away in the 0.2
release. See #7.
The MSRV bump alone is enough to disqualify this, sorry.
Totaly understood
the __Nonexhaustive variant permits crate internal implementations to do exhaustive case analysis.
So does #[non_exhaustive]
. To quote the RFC
Within the crate that defines the enum, this attribute is essentially ignored, so that the current crate can continue to exhaustively match the enum.
Outside the crate that defines the enum, users should be required to add a wildcard arm to ensure forward-compatibility
This is not an argument for reopening the pull, but I just thaught you should know, as it's a realy well designed feature.
Oh that's interesting! I did not know about that. Thank you for correcting me!
Using the
#[non_exhaustive]
, you can remove the__Nonexhaustive
varient ofDenseDFA
andSparseDFA
.Advantages:
#[doc(hidden)]
.Disadvantages
#[non_exhaustive]
requires rust 1.40 or above.This will not break code that has wildcard arm in all matches (which is must unless it explicitly matches against
__Nonexhaustive
in which case it will be broken if and when more variants are added. However, it will break codebases that compile with rust 1.39 or lower.