add guard patterns to HIR and implement lowering
This commit is contained in:
parent
d117b7f211
commit
b579c36224
11 changed files with 40 additions and 7 deletions
|
@ -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*/");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue