diff --git a/lib/std/zig/Ast/Render.zig b/lib/std/zig/Ast/Render.zig index bda190b245b3ae3a49a61a68af58511bcb698c21..198a7abc0d7327614a98800baff199f7bcf04d09 100644 --- a/lib/std/zig/Ast/Render.zig +++ b/lib/std/zig/Ast/Render.zig @@ -443,7 +443,10 @@ fn renderExpression(r: *Render, node: Ast.Node.Index, space: Space) Error!void { if (r.fixups.insert_parentheses.contains(node)) { try renderExpression(r, rhs, .none); try ais.writeByte(')'); - try renderOnlySpace(r, space); + const right_most_token = tree.lastToken(rhs); + const lexeme = tokenSliceForRender(tree, right_most_token); + // If our space is .none, then the above code functions is normal and below shouldn't run + if (space != .none) try renderSpace(r, right_most_token, lexeme.len, space); } else { try renderExpression(r, rhs, space); // fallback }