Pattern::Stmt cannot be malformed

This commit is contained in:
Luke Boswell 2024-03-24 12:31:30 +11:00
parent a5df0aa1c2
commit cfa7490b86
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0

View file

@ -1761,7 +1761,8 @@ impl<'a> Malformed for Pattern<'a> {
match self { match self {
Identifier(_) | Identifier(_) |
Tag(_) | Tag(_) |
OpaqueRef(_) => false, OpaqueRef(_) |
Stmt(_) => false,
Apply(func, args) => func.is_malformed() || args.iter().any(|arg| arg.is_malformed()), Apply(func, args) => func.is_malformed() || args.iter().any(|arg| arg.is_malformed()),
RecordDestructure(items) => items.iter().any(|item| item.is_malformed()), RecordDestructure(items) => items.iter().any(|item| item.is_malformed()),
RequiredField(_, pat) => pat.is_malformed(), RequiredField(_, pat) => pat.is_malformed(),
@ -1784,8 +1785,6 @@ impl<'a> Malformed for Pattern<'a> {
Malformed(_) | Malformed(_) |
MalformedIdent(_, _) | MalformedIdent(_, _) |
QualifiedIdentifier { .. } => true, QualifiedIdentifier { .. } => true,
Stmt(_) => todo!(),
} }
} }
} }