Make #[non_exhaustive]
in the api crate optional
#25
Labels
A-api
Area: Stable API
C-enhancement
Category: New feature or request
E-good-first-issue
Participation: Good for newcomers
Almost every enum and struct in the API has the
#[non_exhaustive]
marker to ensure that it can easily be expanded. This is nice for stability, but not ideal for driver implementations. There could also be users who would prefer a failing compilation, rather than adding wildcards to every match statement.For this reason, I would like to have a feature (which is enabled by default) that can enable the
#[non_exhaustive]
marker.The implementation will probably be as simple as using:
#[cfg_attr(feature = "add-non-exhaustive", non_exhaustive)]
The feature name is just an example, another name might be better
The feature should also include some documentation, that disabling it (not using default features) might cause compilation failures when the API is updated.
The text was updated successfully, but these errors were encountered: