authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2026-04-28 12:56:38+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2026-04-29 23:27:58+01:00
log106850fd4cc218f77d5b37738095c7afd7d7b74b
treedaf8c60f9e697de83b9e156fdd4921ccc3b82239
parent2407ee954b780e5a6a73f88b0865feff365c5ce5
signaturelock-open Commit is signed but in an unrecognized format.

tests: remove uses of `void{}`

In preparation for this syntax to be removed from the language per https://github.com/ziglang/zig/issues/15213.

6 files changed, 7 insertions(+), 7 deletions(-)

test/behavior/array.zig+1-1
......@@ -196,7 +196,7 @@ test "array with sentinels" {
196196
197197test "void arrays" {
198198 var array: [4]void = undefined;
199 array[0] = void{};
199 array[0] = {};
200200 array[1] = array[2];
201201 try expect(@sizeOf(@TypeOf(array)) == 0);
202202 try expect(array.len == 4);
test/behavior/basic.zig+1-1
......@@ -465,7 +465,7 @@ fn testPointerToVoidReturnType() anyerror!void {
465465 const a = testPointerToVoidReturnType2();
466466 return a.*;
467467}
468const test_pointer_to_void_return_type_x = void{};
468const test_pointer_to_void_return_type_x = {};
469469fn testPointerToVoidReturnType2() *const void {
470470 return &test_pointer_to_void_return_type_x;
471471}
test/behavior/fn.zig+1-1
......@@ -280,7 +280,7 @@ test "implicit cast fn call result to optional in field result" {
280280test "void parameters" {
281281 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
282282
283 try voidFun(1, void{}, 2, {});
283 try voidFun(1, {}, 2, {});
284284}
285285fn voidFun(a: i32, b: void, c: i32, d: void) !void {
286286 _ = d;
test/behavior/reflection.zig+1-1
......@@ -31,7 +31,7 @@ test "reflection: @field" {
3131 var f = Foo{
3232 .one = 42,
3333 .two = true,
34 .three = void{},
34 .three = {},
3535 };
3636
3737 try expect(f.one == f.one);
test/behavior/struct.zig+2-2
......@@ -295,9 +295,9 @@ test "void struct fields" {
295295 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
296296
297297 const foo = VoidStructFieldsFoo{
298 .a = void{},
298 .a = {},
299299 .b = 1,
300 .c = void{},
300 .c = {},
301301 };
302302 try expect(foo.b == 1);
303303 try expect(@sizeOf(VoidStructFieldsFoo) == 4);
test/standalone/cmakedefine/build.zig+1-1
......@@ -16,7 +16,7 @@ pub fn build(b: *std.Build) void {
1616 .tenval = 10,
1717 .stringval = "test",
1818
19 .boolnoval = void{},
19 .boolnoval = {},
2020 .booltrueval = true,
2121 .boolfalseval = false,
2222 .boolzeroval = 0,