diff --git a/lib/std/zig/parse.zig b/lib/std/zig/parse.zig index f7e782851f..24c34a9536 100644 --- a/lib/std/zig/parse.zig +++ b/lib/std/zig/parse.zig @@ -885,11 +885,7 @@ const Parser = struct { }, .keyword_suspend => { const token = p.nextToken(); - // TODO remove this special case when 0.9.0 is released. - const block_expr: Node.Index = if (p.eatToken(.semicolon) != null) - 0 - else - try p.expectBlockExprStatement(); + const block_expr = try p.expectBlockExprStatement(); return p.addNode(.{ .tag = .@"suspend", .main_token = token, diff --git a/lib/std/zig/parser_test.zig b/lib/std/zig/parser_test.zig index 26ef344f2c..f67b0c6179 100644 --- a/lib/std/zig/parser_test.zig +++ b/lib/std/zig/parser_test.zig @@ -92,21 +92,6 @@ test "zig fmt: rewrite callconv(.Inline) to the inline keyword" { ); } -// TODO Remove this after zig 0.9.0 is released. -test "zig fmt: rewrite suspend without block expression" { - try testTransform( - \\fn foo() void { - \\ suspend; - \\} - \\ - , - \\fn foo() void { - \\ suspend {} - \\} - \\ - ); -} - // TODO Remove this after zig 0.9.0 is released. test "zig fmt: rewrite @byteOffsetOf to @offsetOf" { try testTransform( diff --git a/lib/std/zig/render.zig b/lib/std/zig/render.zig index 36fb7f5e14..df91da8a03 100644 --- a/lib/std/zig/render.zig +++ b/lib/std/zig/render.zig @@ -275,17 +275,8 @@ fn renderExpression(gpa: *Allocator, ais: *Ais, tree: ast.Tree, node: ast.Node.I .@"suspend" => { const suspend_token = main_tokens[node]; const body = datas[node].lhs; - if (body != 0) { - try renderToken(ais, tree, suspend_token, .space); - return renderExpression(gpa, ais, tree, body, space); - } else { - // TODO remove this special case when 0.9.0 is released. - assert(space == .semicolon); - try renderToken(ais, tree, suspend_token, .space); - try ais.writer().writeAll("{}"); - try ais.insertNewline(); - return; - } + try renderToken(ais, tree, suspend_token, .space); + return renderExpression(gpa, ais, tree, body, space); }, .@"catch" => {