authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-06-04 20:12:22 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-06-04 20:12:22 -07:00
log5a7d257bf4ea983f504fbdd32b236a93aacff715
tree06bba0f7a79f0b4a2d45d98c14d320c4a309e002
parentdb70f7e35558c0df34cce0497ec0eea8e984d30d
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

update to zig 0.16.0

ran the tests this time

7 files changed, 11 insertions(+), 10 deletions(-)

src/FieldUnion.zig+3-3
...@@ -5,9 +5,9 @@ const expectSimilarType = extras.expectSimilarType;...@@ -5,9 +5,9 @@ const expectSimilarType = extras.expectSimilarType;
55
6pub fn FieldUnion(comptime T: type) type {6pub fn FieldUnion(comptime T: type) type {
7 const fields = std.meta.fields(T);7 const fields = std.meta.fields(T);
8 var names: [fields.fields.len][]const u8 = undefined;8 var names: [fields.len][]const u8 = undefined;
9 var types: [fields.fields.len]type = undefined;9 var types: [fields.len]type = undefined;
10 var attrs: [fields.fields.len]std.builtin.Type.UnionField.Attributes = undefined;10 var attrs: [fields.len]std.builtin.Type.UnionField.Attributes = undefined;
1111
12 inline for (fields, 0..) |field, i| {12 inline for (fields, 0..) |field, i| {
13 names[i] = field.name;13 names[i] = field.name;
src/FlippedInt.zig+1-1
...@@ -9,7 +9,7 @@ pub fn FlippedInt(comptime T: type) type {...@@ -9,7 +9,7 @@ pub fn FlippedInt(comptime T: type) type {
9 .signed => .unsigned,9 .signed => .unsigned,
10 .unsigned => .signed,10 .unsigned => .signed,
11 },11 },
12 info.signedness,12 info.bits,
13 );13 );
14}14}
1515
src/ManyArrayList.zig+2-2
...@@ -10,8 +10,8 @@ pub fn ManyArrayList(T: type) type {...@@ -10,8 +10,8 @@ pub fn ManyArrayList(T: type) type {
10 pub fn init(allocator: std.mem.Allocator) @This() {10 pub fn init(allocator: std.mem.Allocator) @This() {
11 return .{11 return .{
12 .allocator = allocator,12 .allocator = allocator,
13 .list = .{},13 .list = .empty,
14 .lengths = .{},14 .lengths = .empty,
15 };15 };
16 }16 }
1717
src/StructOfArrays.zig+1
...@@ -12,6 +12,7 @@ pub fn StructOfArrays(len: usize, T: type) type {...@@ -12,6 +12,7 @@ pub fn StructOfArrays(len: usize, T: type) type {
12 names[i] = item.name;12 names[i] = item.name;
13 types[i] = [len]item.type;13 types[i] = [len]item.type;
14 }14 }
15 if (info.is_tuple) return @Tuple(&types);
15 return @Struct(.auto, null, &names, &types, &@splat(.{}));16 return @Struct(.auto, null, &names, &types, &@splat(.{}));
16}17}
1718
src/StructOfSlices.zig+1
...@@ -12,6 +12,7 @@ pub fn StructOfSlices(T: type) type {...@@ -12,6 +12,7 @@ pub fn StructOfSlices(T: type) type {
12 names[i] = item.name;12 names[i] = item.name;
13 types[i] = []const item.type;13 types[i] = []const item.type;
14 }14 }
15 if (info.is_tuple) return @Tuple(&types);
15 return @Struct(.auto, null, &names, &types, &@splat(.{}));16 return @Struct(.auto, null, &names, &types, &@splat(.{}));
16}17}
1718
src/join.zig+3-3
...@@ -14,13 +14,13 @@ pub fn join(input: anytype) Join(@TypeOf(input)) {...@@ -14,13 +14,13 @@ pub fn join(input: anytype) Join(@TypeOf(input)) {
14}14}
1515
16pub fn Join(comptime T: type) type {16pub fn Join(comptime T: type) type {
17 var names: [][]const u8 = &.{};17 var names: []const []const u8 = &.{};
18 var types: []type = &.{};18 var types: []const type = &.{};
19 inline for (std.meta.fields(T)) |item| {19 inline for (std.meta.fields(T)) |item| {
20 inline for (std.meta.fields(item.type)) |f| {20 inline for (std.meta.fields(item.type)) |f| {
21 names = names ++ &[_][]const u8{f.name};21 names = names ++ &[_][]const u8{f.name};
22 types = types ++ &[_]type{f.type};22 types = types ++ &[_]type{f.type};
23 }23 }
24 }24 }
25 return @Struct(.auto, null, &names, &types, &@splat(.{}));25 return @Struct(.auto, null, names, types[0..], &@splat(.{}));
26}26}
src/omit.zig-1
...@@ -31,5 +31,4 @@ pub fn Omit(T: type, field_name: []const u8) type {...@@ -31,5 +31,4 @@ pub fn Omit(T: type, field_name: []const u8) type {
31 i += 1;31 i += 1;
32 }32 }
33 return @Struct(.auto, null, &names, &types, &attrs);33 return @Struct(.auto, null, &names, &types, &attrs);
34 // return @Type(.{ .@"struct" = .{ .layout = .auto, .fields = &fields, .decls = &.{}, .is_tuple = false } });
35}34}