The Mapping Options section in the documentation for the derive macro says:
#[enumset(map = "compact")] maps each enum variant to an unspecified bit in the set. This allows the library to use less memory than it may otherwise and allows any discrminator [sic] values to be used without issue.
But I tried
#[derive(EnumSetType)]
#[enumset(map = "compact")]
#[repr(u8)]
pub enum Cased {
CapitalA = b'A',
...
}
And got the error "Expression not supported by enumset.", even though this satisfies the Limitations section in the same docs. It seems negative discriminants aren't possible either (with a more cryptic error "expected Expr" when the #[enumset(map = "compact")] line is included), but at least this is called out in the limitations.
Is it possible to completely ignore the discriminants with the map = "compact" option? If not, the documentation should be updated.
The Mapping Options section in the documentation for the derive macro says:
But I tried
And got the error "Expression not supported by enumset.", even though this satisfies the Limitations section in the same docs. It seems negative discriminants aren't possible either (with a more cryptic error "expected Expr" when the
#[enumset(map = "compact")]line is included), but at least this is called out in the limitations.Is it possible to completely ignore the discriminants with the
map = "compact"option? If not, the documentation should be updated.