Plumb awaitness of for loops

This commit is contained in:
Eric Holk 2023-12-08 14:51:50 -08:00
parent bf9229a2e3
commit 27d6539a46
No known key found for this signature in database
GPG key ID: 8EA6B43ED4CE0911
26 changed files with 137 additions and 53 deletions

View file

@ -4252,11 +4252,11 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
});
}
ExprKind::ForLoop(ref pat, ref iter_expr, ref block, label) => {
self.visit_expr(iter_expr);
ExprKind::ForLoop { ref pat, ref iter, ref body, label, kind: _ } => {
self.visit_expr(iter);
self.with_rib(ValueNS, RibKind::Normal, |this| {
this.resolve_pattern_top(pat, PatternSource::For);
this.resolve_labeled_block(label, expr.id, block);
this.resolve_labeled_block(label, expr.id, body);
});
}

View file

@ -1409,7 +1409,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
| ExprKind::Unary(..)
| ExprKind::If(..)
| ExprKind::While(..)
| ExprKind::ForLoop(..)
| ExprKind::ForLoop { .. }
| ExprKind::Match(..),
..
}),