authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2026-03-04 16:34:09+00:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2026-03-10 10:38:50+00:00
logce1f28a7497903cf00431d6976c162c37683232a
treeceb508a3f0af0b4286a3c7ec0de89e5d9a5b68ff
parent5ec3a0cd54351494dfc64a4d91f72a6020505c1d
signaturelock-open Commit is signed but in an unrecognized format.

behavior: update for `std.builtin.Type` changes


2 files changed, 10 insertions(+), 10 deletions(-)

test/behavior/tuple_declarations.zig+2-2
...@@ -22,13 +22,13 @@ test "tuple declaration type info" {...@@ -22,13 +22,13 @@ test "tuple declaration type info" {
22 try expect(info.fields[0].type == u32);22 try expect(info.fields[0].type == u32);
23 try expect(info.fields[0].defaultValue() == 1);23 try expect(info.fields[0].defaultValue() == 1);
24 try expect(info.fields[0].is_comptime);24 try expect(info.fields[0].is_comptime);
25 try expect(info.fields[0].alignment == @alignOf(u32));25 try expect(info.fields[0].alignment == null);
2626
27 try expectEqualStrings(info.fields[1].name, "1");27 try expectEqualStrings(info.fields[1].name, "1");
28 try expect(info.fields[1].type == []const u8);28 try expect(info.fields[1].type == []const u8);
29 try expect(info.fields[1].defaultValue() == null);29 try expect(info.fields[1].defaultValue() == null);
30 try expect(!info.fields[1].is_comptime);30 try expect(!info.fields[1].is_comptime);
31 try expect(info.fields[1].alignment == @alignOf([]const u8));31 try expect(info.fields[1].alignment == null);
32 }32 }
33}33}
3434
test/behavior/type_info.zig+8-8
...@@ -82,7 +82,7 @@ fn testPointer() !void {...@@ -82,7 +82,7 @@ fn testPointer() !void {
82 try expect(u32_ptr_info.pointer.size == .one);82 try expect(u32_ptr_info.pointer.size == .one);
83 try expect(u32_ptr_info.pointer.is_const == false);83 try expect(u32_ptr_info.pointer.is_const == false);
84 try expect(u32_ptr_info.pointer.is_volatile == false);84 try expect(u32_ptr_info.pointer.is_volatile == false);
85 try expect(u32_ptr_info.pointer.alignment == @alignOf(u32));85 try expect(u32_ptr_info.pointer.alignment == null);
86 try expect(u32_ptr_info.pointer.child == u32);86 try expect(u32_ptr_info.pointer.child == u32);
87 try expect(u32_ptr_info.pointer.sentinel() == null);87 try expect(u32_ptr_info.pointer.sentinel() == null);
88}88}
...@@ -99,7 +99,7 @@ fn testUnknownLenPtr() !void {...@@ -99,7 +99,7 @@ fn testUnknownLenPtr() !void {
99 try expect(u32_ptr_info.pointer.is_const == true);99 try expect(u32_ptr_info.pointer.is_const == true);
100 try expect(u32_ptr_info.pointer.is_volatile == true);100 try expect(u32_ptr_info.pointer.is_volatile == true);
101 try expect(u32_ptr_info.pointer.sentinel() == null);101 try expect(u32_ptr_info.pointer.sentinel() == null);
102 try expect(u32_ptr_info.pointer.alignment == @alignOf(f64));102 try expect(u32_ptr_info.pointer.alignment == null);
103 try expect(u32_ptr_info.pointer.child == f64);103 try expect(u32_ptr_info.pointer.child == f64);
104}104}
105105
...@@ -130,7 +130,7 @@ fn testSlice() !void {...@@ -130,7 +130,7 @@ fn testSlice() !void {
130 try expect(u32_slice_info.pointer.size == .slice);130 try expect(u32_slice_info.pointer.size == .slice);
131 try expect(u32_slice_info.pointer.is_const == false);131 try expect(u32_slice_info.pointer.is_const == false);
132 try expect(u32_slice_info.pointer.is_volatile == false);132 try expect(u32_slice_info.pointer.is_volatile == false);
133 try expect(u32_slice_info.pointer.alignment == 4);133 try expect(u32_slice_info.pointer.alignment == null);
134 try expect(u32_slice_info.pointer.child == u32);134 try expect(u32_slice_info.pointer.child == u32);
135}135}
136136
...@@ -266,9 +266,9 @@ fn testUnion() !void {...@@ -266,9 +266,9 @@ fn testUnion() !void {
266 try expect(notag_union_info.@"union".tag_type == null);266 try expect(notag_union_info.@"union".tag_type == null);
267 try expect(notag_union_info.@"union".layout == .auto);267 try expect(notag_union_info.@"union".layout == .auto);
268 try expect(notag_union_info.@"union".fields.len == 2);268 try expect(notag_union_info.@"union".fields.len == 2);
269 try expect(notag_union_info.@"union".fields[0].alignment == @alignOf(void));269 try expect(notag_union_info.@"union".fields[0].alignment == null);
270 try expect(notag_union_info.@"union".fields[1].type == u32);270 try expect(notag_union_info.@"union".fields[1].type == u32);
271 try expect(notag_union_info.@"union".fields[1].alignment == @alignOf(u32));271 try expect(notag_union_info.@"union".fields[1].alignment == null);
272272
273 const TestExternUnion = extern union {273 const TestExternUnion = extern union {
274 foo: *anyopaque,274 foo: *anyopaque,
...@@ -292,7 +292,7 @@ fn testStruct() !void {...@@ -292,7 +292,7 @@ fn testStruct() !void {
292 const unpacked_struct_info = @typeInfo(TestStruct);292 const unpacked_struct_info = @typeInfo(TestStruct);
293 try expect(unpacked_struct_info.@"struct".is_tuple == false);293 try expect(unpacked_struct_info.@"struct".is_tuple == false);
294 try expect(unpacked_struct_info.@"struct".backing_integer == null);294 try expect(unpacked_struct_info.@"struct".backing_integer == null);
295 try expect(unpacked_struct_info.@"struct".fields[0].alignment == @alignOf(u32));295 try expect(unpacked_struct_info.@"struct".fields[0].alignment == null);
296 try expect(unpacked_struct_info.@"struct".fields[0].defaultValue().? == 4);296 try expect(unpacked_struct_info.@"struct".fields[0].defaultValue().? == 4);
297 try expect(mem.eql(u8, "foobar", unpacked_struct_info.@"struct".fields[1].defaultValue().?));297 try expect(mem.eql(u8, "foobar", unpacked_struct_info.@"struct".fields[1].defaultValue().?));
298}298}
...@@ -314,11 +314,11 @@ fn testPackedStruct() !void {...@@ -314,11 +314,11 @@ fn testPackedStruct() !void {
314 try expect(struct_info.@"struct".layout == .@"packed");314 try expect(struct_info.@"struct".layout == .@"packed");
315 try expect(struct_info.@"struct".backing_integer == u128);315 try expect(struct_info.@"struct".backing_integer == u128);
316 try expect(struct_info.@"struct".fields.len == 4);316 try expect(struct_info.@"struct".fields.len == 4);
317 try expect(struct_info.@"struct".fields[0].alignment == 0);317 try expect(struct_info.@"struct".fields[0].alignment == null);
318 try expect(struct_info.@"struct".fields[2].type == f32);318 try expect(struct_info.@"struct".fields[2].type == f32);
319 try expect(struct_info.@"struct".fields[2].defaultValue() == null);319 try expect(struct_info.@"struct".fields[2].defaultValue() == null);
320 try expect(struct_info.@"struct".fields[3].defaultValue().? == 4);320 try expect(struct_info.@"struct".fields[3].defaultValue().? == 4);
321 try expect(struct_info.@"struct".fields[3].alignment == 0);321 try expect(struct_info.@"struct".fields[3].alignment == null);
322 try expect(struct_info.@"struct".decls.len == 1);322 try expect(struct_info.@"struct".decls.len == 1);
323}323}
324324