Closed 6d7a closed 5 months ago
ASN1 allows for empty CHOICE types. Currently, rasn doesn't handle this case properly.
CHOICE
rasn
When trying to compile the CHOICE below...
#[derive(AsnType, Decode, Encode, Debug, Clone, Copy, PartialEq)] #[rasn(choice)] #[rasn(crate_root = "crate")] enum EmptyChoice { }
...the error error[E0004]: non-exhaustive patterns: type&EmptyChoiceis non-empty is thrown.
error[E0004]: non-exhaustive patterns: type
is non-empty
I'll try to provide a fix for it.
Rereading ITU-T X.680 §29, I realized that empty choices are illegal after all.
ASN1 allows for empty
CHOICE
types. Currently,rasn
doesn't handle this case properly.When trying to compile the
CHOICE
below......the error
error[E0004]: non-exhaustive patterns: type
&EmptyChoiceis non-empty
is thrown.