1
Fork 0

add guard patterns to HIR and implement lowering

This commit is contained in:
Max Niederman 2024-08-24 21:56:12 -07:00
parent d117b7f211
commit b579c36224
11 changed files with 40 additions and 7 deletions

View file

@ -1999,6 +1999,12 @@ impl<'a> State<'a> {
self.commasep(Inconsistent, after, |s, p| s.print_pat(p));
self.word("]");
}
PatKind::Guard(inner, cond) => {
self.print_pat(inner);
self.space();
self.word_space("if");
self.print_expr(cond);
}
PatKind::Err(_) => {
self.popen();
self.word("/*ERROR*/");