Skip to content

Commit b359ab0

Browse files
committed
Look into Group expressions for statement termination
1 parent 6623df0 commit b359ab0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/expr.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,6 @@ fn requires_terminator(expr: &Expr) -> bool {
10431043
| Expr::Closure(_)
10441044
| Expr::Continue(_)
10451045
| Expr::Field(_)
1046-
| Expr::Group(_)
10471046
| Expr::Index(_)
10481047
| Expr::Infer(_)
10491048
| Expr::Let(_)
@@ -1064,6 +1063,8 @@ fn requires_terminator(expr: &Expr) -> bool {
10641063
| Expr::Verbatim(_)
10651064
| Expr::Yield(_) => true,
10661065

1066+
Expr::Group(e) => requires_terminator(&e.expr),
1067+
10671068
_ => true,
10681069
}
10691070
}
@@ -1217,7 +1218,6 @@ fn is_blocklike(expr: &Expr) -> bool {
12171218
| Expr::Continue(_)
12181219
| Expr::Field(_)
12191220
| Expr::ForLoop(_)
1220-
| Expr::Group(_)
12211221
| Expr::If(_)
12221222
| Expr::Index(_)
12231223
| Expr::Infer(_)
@@ -1240,6 +1240,8 @@ fn is_blocklike(expr: &Expr) -> bool {
12401240
| Expr::While(_)
12411241
| Expr::Yield(_) => false,
12421242

1243+
Expr::Group(e) => is_blocklike(&e.expr),
1244+
12431245
_ => false,
12441246
}
12451247
}

0 commit comments

Comments
 (0)