diff options
| author | Eric Holk <ericholk@microsoft.com> | 2023-12-08 14:51:50 -0800 |
|---|---|---|
| committer | Eric Holk <ericholk@microsoft.com> | 2023-12-19 12:26:20 -0800 |
| commit | 27d6539a46123dcdb6fae6e043b8c1c12b3e0d6f (patch) | |
| tree | b57c35ff3b5d0f5ddd5ff8060acdcf1d8f0f2ace /compiler/rustc_ast/src/util/classify.rs | |
| parent | bf9229a2e366b4c311f059014a4aa08af16de5d8 (diff) | |
| download | rust-27d6539a46123dcdb6fae6e043b8c1c12b3e0d6f.tar.gz rust-27d6539a46123dcdb6fae6e043b8c1c12b3e0d6f.zip | |
Plumb awaitness of for loops
Diffstat (limited to 'compiler/rustc_ast/src/util/classify.rs')
| -rw-r--r-- | compiler/rustc_ast/src/util/classify.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/compiler/rustc_ast/src/util/classify.rs b/compiler/rustc_ast/src/util/classify.rs index 4dece079783..65036bcdc36 100644 --- a/compiler/rustc_ast/src/util/classify.rs +++ b/compiler/rustc_ast/src/util/classify.rs @@ -19,7 +19,7 @@ pub fn expr_requires_semi_to_be_stmt(e: &ast::Expr) -> bool { | ast::ExprKind::Block(..) | ast::ExprKind::While(..) | ast::ExprKind::Loop(..) - | ast::ExprKind::ForLoop(..) + | ast::ExprKind::ForLoop { .. } | ast::ExprKind::TryBlock(..) | ast::ExprKind::ConstBlock(..) ) @@ -48,8 +48,16 @@ pub fn expr_trailing_brace(mut expr: &ast::Expr) -> Option<&ast::Expr> { Closure(closure) => { expr = &closure.body; } - Gen(..) | Block(..) | ForLoop(..) | If(..) | Loop(..) | Match(..) | Struct(..) - | TryBlock(..) | While(..) | ConstBlock(_) => break Some(expr), + Gen(..) + | Block(..) + | ForLoop { .. } + | If(..) + | Loop(..) + | Match(..) + | Struct(..) + | TryBlock(..) + | While(..) + | ConstBlock(_) => break Some(expr), // FIXME: These can end in `}`, but changing these would break stable code. InlineAsm(_) | OffsetOf(_, _) | MacCall(_) | IncludedBytes(_) | FormatArgs(_) => { |
