From ce1f28a7497903cf00431d6976c162c37683232a Mon Sep 17 00:00:00 2001 From: Matthew Lugg Date: Wed, 4 Mar 2026 16:34:09 +0000 Subject: [PATCH] behavior: update for `std.builtin.Type` changes --- test/behavior/tuple_declarations.zig | 4 ++-- test/behavior/type_info.zig | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/behavior/tuple_declarations.zig b/test/behavior/tuple_declarations.zig index 643d79baa1..cc87913975 100644 --- a/test/behavior/tuple_declarations.zig +++ b/test/behavior/tuple_declarations.zig @@ -22,13 +22,13 @@ test "tuple declaration type info" { try expect(info.fields[0].type == u32); try expect(info.fields[0].defaultValue() == 1); try expect(info.fields[0].is_comptime); - try expect(info.fields[0].alignment == @alignOf(u32)); + try expect(info.fields[0].alignment == null); try expectEqualStrings(info.fields[1].name, "1"); try expect(info.fields[1].type == []const u8); try expect(info.fields[1].defaultValue() == null); try expect(!info.fields[1].is_comptime); - try expect(info.fields[1].alignment == @alignOf([]const u8)); + try expect(info.fields[1].alignment == null); } } diff --git a/test/behavior/type_info.zig b/test/behavior/type_info.zig index 48b10c458a..cd1455e523 100644 --- a/test/behavior/type_info.zig +++ b/test/behavior/type_info.zig @@ -82,7 +82,7 @@ fn testPointer() !void { try expect(u32_ptr_info.pointer.size == .one); try expect(u32_ptr_info.pointer.is_const == false); try expect(u32_ptr_info.pointer.is_volatile == false); - try expect(u32_ptr_info.pointer.alignment == @alignOf(u32)); + try expect(u32_ptr_info.pointer.alignment == null); try expect(u32_ptr_info.pointer.child == u32); try expect(u32_ptr_info.pointer.sentinel() == null); } @@ -99,7 +99,7 @@ fn testUnknownLenPtr() !void { try expect(u32_ptr_info.pointer.is_const == true); try expect(u32_ptr_info.pointer.is_volatile == true); try expect(u32_ptr_info.pointer.sentinel() == null); - try expect(u32_ptr_info.pointer.alignment == @alignOf(f64)); + try expect(u32_ptr_info.pointer.alignment == null); try expect(u32_ptr_info.pointer.child == f64); } @@ -130,7 +130,7 @@ fn testSlice() !void { try expect(u32_slice_info.pointer.size == .slice); try expect(u32_slice_info.pointer.is_const == false); try expect(u32_slice_info.pointer.is_volatile == false); - try expect(u32_slice_info.pointer.alignment == 4); + try expect(u32_slice_info.pointer.alignment == null); try expect(u32_slice_info.pointer.child == u32); } @@ -266,9 +266,9 @@ fn testUnion() !void { try expect(notag_union_info.@"union".tag_type == null); try expect(notag_union_info.@"union".layout == .auto); try expect(notag_union_info.@"union".fields.len == 2); - try expect(notag_union_info.@"union".fields[0].alignment == @alignOf(void)); + try expect(notag_union_info.@"union".fields[0].alignment == null); try expect(notag_union_info.@"union".fields[1].type == u32); - try expect(notag_union_info.@"union".fields[1].alignment == @alignOf(u32)); + try expect(notag_union_info.@"union".fields[1].alignment == null); const TestExternUnion = extern union { foo: *anyopaque, @@ -292,7 +292,7 @@ fn testStruct() !void { const unpacked_struct_info = @typeInfo(TestStruct); try expect(unpacked_struct_info.@"struct".is_tuple == false); try expect(unpacked_struct_info.@"struct".backing_integer == null); - try expect(unpacked_struct_info.@"struct".fields[0].alignment == @alignOf(u32)); + try expect(unpacked_struct_info.@"struct".fields[0].alignment == null); try expect(unpacked_struct_info.@"struct".fields[0].defaultValue().? == 4); try expect(mem.eql(u8, "foobar", unpacked_struct_info.@"struct".fields[1].defaultValue().?)); } @@ -314,11 +314,11 @@ fn testPackedStruct() !void { try expect(struct_info.@"struct".layout == .@"packed"); try expect(struct_info.@"struct".backing_integer == u128); try expect(struct_info.@"struct".fields.len == 4); - try expect(struct_info.@"struct".fields[0].alignment == 0); + try expect(struct_info.@"struct".fields[0].alignment == null); try expect(struct_info.@"struct".fields[2].type == f32); try expect(struct_info.@"struct".fields[2].defaultValue() == null); try expect(struct_info.@"struct".fields[3].defaultValue().? == 4); - try expect(struct_info.@"struct".fields[3].alignment == 0); + try expect(struct_info.@"struct".fields[3].alignment == null); try expect(struct_info.@"struct".decls.len == 1); }