Run AST validation on match guards correctly
This commit is contained in:
parent
48ec50ae39
commit
72d41f3bd3
6 changed files with 240 additions and 38 deletions
|
@ -736,11 +736,10 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
|
|||
this.visit_expr(&arm.body);
|
||||
this.visit_pat(&arm.pat);
|
||||
walk_list!(this, visit_attribute, &arm.attrs);
|
||||
if let Some(guard) = &arm.guard && let ExprKind::Let(_, guard_expr, _) = &guard.kind {
|
||||
if let Some(guard) = &arm.guard {
|
||||
this.with_let_management(None, |this, _| {
|
||||
this.visit_expr(guard_expr)
|
||||
this.visit_expr(guard)
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue