From 5a7d257bf4ea983f504fbdd32b236a93aacff715 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Thu, 4 Jun 2026 20:12:22 -0700 Subject: [PATCH] update to zig 0.16.0 ran the tests this time --- src/FieldUnion.zig | 6 +++--- src/FlippedInt.zig | 2 +- src/ManyArrayList.zig | 4 ++-- src/StructOfArrays.zig | 1 + src/StructOfSlices.zig | 1 + src/join.zig | 6 +++--- src/omit.zig | 1 - 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/FieldUnion.zig b/src/FieldUnion.zig index 294227438aeb23978020f78f4c627d02d020d8fe..c151b127d1658b69cee570920f37ab80d9d99aa4 100644 --- a/src/FieldUnion.zig +++ b/src/FieldUnion.zig @@ -5,9 +5,9 @@ const expectSimilarType = extras.expectSimilarType; pub fn FieldUnion(comptime T: type) type { const fields = std.meta.fields(T); - var names: [fields.fields.len][]const u8 = undefined; - var types: [fields.fields.len]type = undefined; - var attrs: [fields.fields.len]std.builtin.Type.UnionField.Attributes = undefined; + var names: [fields.len][]const u8 = undefined; + var types: [fields.len]type = undefined; + var attrs: [fields.len]std.builtin.Type.UnionField.Attributes = undefined; inline for (fields, 0..) |field, i| { names[i] = field.name; diff --git a/src/FlippedInt.zig b/src/FlippedInt.zig index cbd0c2787c3570bce3e15ef23308615586c7134a..536a71a0d0a94026211f5702bbf5b8fa0d28c02a 100644 --- a/src/FlippedInt.zig +++ b/src/FlippedInt.zig @@ -9,7 +9,7 @@ pub fn FlippedInt(comptime T: type) type { .signed => .unsigned, .unsigned => .signed, }, - info.signedness, + info.bits, ); } diff --git a/src/ManyArrayList.zig b/src/ManyArrayList.zig index e546d88627611d495620f4ca5fadf5f75d751005..a6c60bceb3d2fb48b7ce3f1b739728b905c8c740 100644 --- a/src/ManyArrayList.zig +++ b/src/ManyArrayList.zig @@ -10,8 +10,8 @@ pub fn ManyArrayList(T: type) type { pub fn init(allocator: std.mem.Allocator) @This() { return .{ .allocator = allocator, - .list = .{}, - .lengths = .{}, + .list = .empty, + .lengths = .empty, }; } diff --git a/src/StructOfArrays.zig b/src/StructOfArrays.zig index 02d5204f7e8186441a21fdf5c4681a3050d12ab5..2b2ca33554ea9d8418f6706d6f52a3ef69d53d65 100644 --- a/src/StructOfArrays.zig +++ b/src/StructOfArrays.zig @@ -12,6 +12,7 @@ pub fn StructOfArrays(len: usize, T: type) type { names[i] = item.name; types[i] = [len]item.type; } + if (info.is_tuple) return @Tuple(&types); return @Struct(.auto, null, &names, &types, &@splat(.{})); } diff --git a/src/StructOfSlices.zig b/src/StructOfSlices.zig index 79c41db7937c757bfc7c7272ecfa0226f92d4df9..cfd3b8eadf3a2c211eb2de93903a11ad199fbef1 100644 --- a/src/StructOfSlices.zig +++ b/src/StructOfSlices.zig @@ -12,6 +12,7 @@ pub fn StructOfSlices(T: type) type { names[i] = item.name; types[i] = []const item.type; } + if (info.is_tuple) return @Tuple(&types); return @Struct(.auto, null, &names, &types, &@splat(.{})); } diff --git a/src/join.zig b/src/join.zig index 3513401229a94e137ffe4f861689d2cb4fee8eb0..ccc8a5c8e15d6d1346a18d3d2e9fc9f761484cc0 100644 --- a/src/join.zig +++ b/src/join.zig @@ -14,13 +14,13 @@ pub fn join(input: anytype) Join(@TypeOf(input)) { } pub fn Join(comptime T: type) type { - var names: [][]const u8 = &.{}; - var types: []type = &.{}; + var names: []const []const u8 = &.{}; + var types: []const type = &.{}; inline for (std.meta.fields(T)) |item| { inline for (std.meta.fields(item.type)) |f| { names = names ++ &[_][]const u8{f.name}; types = types ++ &[_]type{f.type}; } } - return @Struct(.auto, null, &names, &types, &@splat(.{})); + return @Struct(.auto, null, names, types[0..], &@splat(.{})); } diff --git a/src/omit.zig b/src/omit.zig index c7318e2dc4920065825720d36774b8cba23b72c4..94ff517a43ce7a2039fb486b5488c3f5ab3bde77 100644 --- a/src/omit.zig +++ b/src/omit.zig @@ -31,5 +31,4 @@ pub fn Omit(T: type, field_name: []const u8) type { i += 1; } return @Struct(.auto, null, &names, &types, &attrs); - // return @Type(.{ .@"struct" = .{ .layout = .auto, .fields = &fields, .decls = &.{}, .is_tuple = false } }); } -- 2.54.0