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" {
2222 try expect(info.fields[0].type == u32);
2323 try expect(info.fields[0].defaultValue() == 1);
2424 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
2727 try expectEqualStrings(info.fields[1].name, "1");
2828 try expect(info.fields[1].type == []const u8);
2929 try expect(info.fields[1].defaultValue() == null);
3030 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);
3232 }
3333}
3434
test/behavior/type_info.zig+8-8
......@@ -82,7 +82,7 @@ fn testPointer() !void {
8282 try expect(u32_ptr_info.pointer.size == .one);
8383 try expect(u32_ptr_info.pointer.is_const == false);
8484 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);
8686 try expect(u32_ptr_info.pointer.child == u32);
8787 try expect(u32_ptr_info.pointer.sentinel() == null);
8888}
......@@ -99,7 +99,7 @@ fn testUnknownLenPtr() !void {
9999 try expect(u32_ptr_info.pointer.is_const == true);
100100 try expect(u32_ptr_info.pointer.is_volatile == true);
101101 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);
103103 try expect(u32_ptr_info.pointer.child == f64);
104104}
105105
......@@ -130,7 +130,7 @@ fn testSlice() !void {
130130 try expect(u32_slice_info.pointer.size == .slice);
131131 try expect(u32_slice_info.pointer.is_const == false);
132132 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);
134134 try expect(u32_slice_info.pointer.child == u32);
135135}
136136
......@@ -266,9 +266,9 @@ fn testUnion() !void {
266266 try expect(notag_union_info.@"union".tag_type == null);
267267 try expect(notag_union_info.@"union".layout == .auto);
268268 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);
270270 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
273273 const TestExternUnion = extern union {
274274 foo: *anyopaque,
......@@ -292,7 +292,7 @@ fn testStruct() !void {
292292 const unpacked_struct_info = @typeInfo(TestStruct);
293293 try expect(unpacked_struct_info.@"struct".is_tuple == false);
294294 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);
296296 try expect(unpacked_struct_info.@"struct".fields[0].defaultValue().? == 4);
297297 try expect(mem.eql(u8, "foobar", unpacked_struct_info.@"struct".fields[1].defaultValue().?));
298298}
......@@ -314,11 +314,11 @@ fn testPackedStruct() !void {
314314 try expect(struct_info.@"struct".layout == .@"packed");
315315 try expect(struct_info.@"struct".backing_integer == u128);
316316 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);
318318 try expect(struct_info.@"struct".fields[2].type == f32);
319319 try expect(struct_info.@"struct".fields[2].defaultValue() == null);
320320 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);
322322 try expect(struct_info.@"struct".decls.len == 1);
323323}
324324