Skip to content

Commit 1176883

Browse files
Change to explicit cases for expressions with optional values when being checked for trailing braces
1 parent 27fc55b commit 1176883

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler/rustc_ast/src/util/classify.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ pub fn expr_trailing_brace(mut expr: &ast::Expr) -> Option<&ast::Expr> {
5050
}
5151
Gen(..) | Block(..) | ForLoop(..) | If(..) | Loop(..) | Match(..) | Struct(..)
5252
| TryBlock(..) | While(..) | ConstBlock(_) => break Some(expr),
53-
Break(_, _)
54-
| Range(_, _, _)
55-
| Ret(_)
56-
| Yield(_)
53+
Break(_, None)
54+
| Range(_, None, _)
55+
| Ret(None)
56+
| Yield(None)
5757
| Array(_)
5858
| Call(_, _)
5959
| MethodCall(_)
@@ -70,7 +70,7 @@ pub fn expr_trailing_brace(mut expr: &ast::Expr) -> Option<&ast::Expr> {
7070
| Repeat(_, _)
7171
| Paren(_)
7272
| Try(_)
73-
| Yeet(_)
73+
| Yeet(None)
7474
| InlineAsm(_)
7575
| OffsetOf(_, _)
7676
| MacCall(_)

0 commit comments

Comments
 (0)