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" {...@@ -196,7 +196,7 @@ test "array with sentinels" {
196196
197test "void arrays" {197test "void arrays" {
198 var array: [4]void = undefined;198 var array: [4]void = undefined;
199 array[0] = void{};199 array[0] = {};
200 array[1] = array[2];200 array[1] = array[2];
201 try expect(@sizeOf(@TypeOf(array)) == 0);201 try expect(@sizeOf(@TypeOf(array)) == 0);
202 try expect(array.len == 4);202 try expect(array.len == 4);
test/behavior/basic.zig+1-1
...@@ -465,7 +465,7 @@ fn testPointerToVoidReturnType() anyerror!void {...@@ -465,7 +465,7 @@ fn testPointerToVoidReturnType() anyerror!void {
465 const a = testPointerToVoidReturnType2();465 const a = testPointerToVoidReturnType2();
466 return a.*;466 return a.*;
467}467}
468const test_pointer_to_void_return_type_x = void{};468const test_pointer_to_void_return_type_x = {};
469fn testPointerToVoidReturnType2() *const void {469fn testPointerToVoidReturnType2() *const void {
470 return &test_pointer_to_void_return_type_x;470 return &test_pointer_to_void_return_type_x;
471}471}
test/behavior/fn.zig+1-1
...@@ -280,7 +280,7 @@ test "implicit cast fn call result to optional in field result" {...@@ -280,7 +280,7 @@ test "implicit cast fn call result to optional in field result" {
280test "void parameters" {280test "void parameters" {
281 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;281 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
282282
283 try voidFun(1, void{}, 2, {});283 try voidFun(1, {}, 2, {});
284}284}
285fn voidFun(a: i32, b: void, c: i32, d: void) !void {285fn voidFun(a: i32, b: void, c: i32, d: void) !void {
286 _ = d;286 _ = d;
test/behavior/reflection.zig+1-1
...@@ -31,7 +31,7 @@ test "reflection: @field" {...@@ -31,7 +31,7 @@ test "reflection: @field" {
31 var f = Foo{31 var f = Foo{
32 .one = 42,32 .one = 42,
33 .two = true,33 .two = true,
34 .three = void{},34 .three = {},
35 };35 };
3636
37 try expect(f.one == f.one);37 try expect(f.one == f.one);
test/behavior/struct.zig+2-2
...@@ -295,9 +295,9 @@ test "void struct fields" {...@@ -295,9 +295,9 @@ test "void struct fields" {
295 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO295 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
296296
297 const foo = VoidStructFieldsFoo{297 const foo = VoidStructFieldsFoo{
298 .a = void{},298 .a = {},
299 .b = 1,299 .b = 1,
300 .c = void{},300 .c = {},
301 };301 };
302 try expect(foo.b == 1);302 try expect(foo.b == 1);
303 try expect(@sizeOf(VoidStructFieldsFoo) == 4);303 try expect(@sizeOf(VoidStructFieldsFoo) == 4);
test/standalone/cmakedefine/build.zig+1-1
...@@ -16,7 +16,7 @@ pub fn build(b: *std.Build) void {...@@ -16,7 +16,7 @@ pub fn build(b: *std.Build) void {
16 .tenval = 10,16 .tenval = 10,
17 .stringval = "test",17 .stringval = "test",
1818
19 .boolnoval = void{},19 .boolnoval = {},
20 .booltrueval = true,20 .booltrueval = true,
21 .boolfalseval = false,21 .boolfalseval = false,
22 .boolzeroval = 0,22 .boolzeroval = 0,