Plumb awaitness of for loops
This commit is contained in:
parent
d165a38de0
commit
212ea0359c
5 changed files with 24 additions and 7 deletions
|
|
@ -220,7 +220,11 @@ where
|
|||
F: FnMut(&ast::Block, Option<&ast::Label>),
|
||||
{
|
||||
if let ast::ExprKind::While(_, loop_block, label)
|
||||
| ast::ExprKind::ForLoop(_, _, loop_block, label)
|
||||
| ast::ExprKind::ForLoop {
|
||||
body: loop_block,
|
||||
label,
|
||||
..
|
||||
}
|
||||
| ast::ExprKind::Loop(loop_block, label, ..) = &expr.kind
|
||||
{
|
||||
func(loop_block, label.as_ref());
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ impl<'ast> Visitor<'ast> for BreakVisitor {
|
|||
ExprKind::If(_, ref then, Some(ref els)) => self.check_block(then) && self.check_expr(els),
|
||||
ExprKind::If(_, _, None)
|
||||
// ignore loops for simplicity
|
||||
| ExprKind::While(..) | ExprKind::ForLoop(..) | ExprKind::Loop(..) => false,
|
||||
| ExprKind::While(..) | ExprKind::ForLoop { .. } | ExprKind::Loop(..) => false,
|
||||
_ => {
|
||||
walk_expr(self, expr);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -554,7 +554,7 @@ fn ident_difference_expr_with_base_location(
|
|||
| (Closure(_), Closure(_))
|
||||
| (Match(_, _), Match(_, _))
|
||||
| (Loop(_, _, _), Loop(_, _, _))
|
||||
| (ForLoop(_, _, _, _), ForLoop(_, _, _, _))
|
||||
| (ForLoop { .. }, ForLoop { .. })
|
||||
| (While(_, _, _), While(_, _, _))
|
||||
| (If(_, _, _), If(_, _, _))
|
||||
| (Let(_, _, _, _), Let(_, _, _, _))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue