strum
strum copied to clipboard
EnumDiscriminants and non_exhaustive
Hi. Thanks for this excellent macro package.
We have something like this:
#![deny(clippy::exhaustive_enums)]
#[derive(strum::EnumDiscriminants)]
#[non_exhaustive]
pub enum ProxyAction {
This causes a warning from clippy, because the generated ProxyActionDiscriminants isn't marked #[non_exhaustive].
I tried
#[strum_discriminants(non_exhaustive)]
but strum rejected that because of a lack of () after non_exhaustive. (Adding them gets an error from rustc.)
I think we should probably allow the explicit attribute.
I'm not sure if we should forward the #[non_exhaustive] by default. If we do, there would have to be a way to suppress it.