#[derive(ExplicitDiscriminant)]
{
// Attributes available to this derive:
#[pattern]
}
Expand description
Require that all variants of an enum have an explicit discriminant defined.
Example:
// This works
#[derive(ExplicitDiscriminant)]
pub enum MyEnum {
One = 1,
Two = 2,
Three = 3,
}// But this won't compile
#[derive(ExplicitDiscriminant)]
pub enum MyOtherEnum {
One = 1,
Two,
Three = 3,
}