authorgravatar for carl@astholm.seCarl Åstholm <carl@astholm.se> 2024-01-07 15:52:24+01:00
committergravatar for carl@astholm.seCarl Åstholm <carl@astholm.se> 2024-01-07 16:21:08+01:00
logc8fa767f083e610840cef688b709783c5ad66acc
tree3b5e75ba381e722eb1e2c8cbc44d1df870b534dd
parenta02bd81760166d679ccee0e190bf62115272ffbe

Work around stage1 not yet returning null-terminated `@typeInfo` strings

These changes can be reverted the next time stage1 is updated.

5 files changed, 6 insertions(+), 6 deletions(-)

deps/aro/aro/Attribute.zig+1-1
...@@ -645,7 +645,7 @@ pub const Arguments = blk: {...@@ -645,7 +645,7 @@ pub const Arguments = blk: {
645 var union_fields: [decls.len]ZigType.UnionField = undefined;645 var union_fields: [decls.len]ZigType.UnionField = undefined;
646 for (decls, &union_fields) |decl, *field| {646 for (decls, &union_fields) |decl, *field| {
647 field.* = .{647 field.* = .{
648 .name = decl.name,648 .name = decl.name ++ "",
649 .type = @field(attributes, decl.name),649 .type = @field(attributes, decl.name),
650 .alignment = 0,650 .alignment = 0,
651 };651 };
lib/std/enums.zig+1-1
...@@ -14,7 +14,7 @@ pub fn EnumFieldStruct(comptime E: type, comptime Data: type, comptime field_def...@@ -14,7 +14,7 @@ pub fn EnumFieldStruct(comptime E: type, comptime Data: type, comptime field_def
14 var fields: []const StructField = &[_]StructField{};14 var fields: []const StructField = &[_]StructField{};
15 for (std.meta.fields(E)) |field| {15 for (std.meta.fields(E)) |field| {
16 fields = fields ++ &[_]StructField{.{16 fields = fields ++ &[_]StructField{.{
17 .name = field.name,17 .name = field.name ++ "",
18 .type = Data,18 .type = Data,
19 .default_value = if (field_default) |d| @as(?*const anyopaque, @ptrCast(&d)) else null,19 .default_value = if (field_default) |d| @as(?*const anyopaque, @ptrCast(&d)) else null,
20 .is_comptime = false,20 .is_comptime = false,
lib/std/io.zig+1-1
...@@ -635,7 +635,7 @@ pub fn PollFiles(comptime StreamEnum: type) type {...@@ -635,7 +635,7 @@ pub fn PollFiles(comptime StreamEnum: type) type {
635 var struct_fields: [enum_fields.len]std.builtin.Type.StructField = undefined;635 var struct_fields: [enum_fields.len]std.builtin.Type.StructField = undefined;
636 for (&struct_fields, enum_fields) |*struct_field, enum_field| {636 for (&struct_fields, enum_fields) |*struct_field, enum_field| {
637 struct_field.* = .{637 struct_field.* = .{
638 .name = enum_field.name,638 .name = enum_field.name ++ "",
639 .type = fs.File,639 .type = fs.File,
640 .default_value = null,640 .default_value = null,
641 .is_comptime = false,641 .is_comptime = false,
lib/std/meta.zig+2-2
...@@ -556,7 +556,7 @@ pub fn FieldEnum(comptime T: type) type {...@@ -556,7 +556,7 @@ pub fn FieldEnum(comptime T: type) type {
556 var decls = [_]std.builtin.Type.Declaration{};556 var decls = [_]std.builtin.Type.Declaration{};
557 inline for (field_infos, 0..) |field, i| {557 inline for (field_infos, 0..) |field, i| {
558 enumFields[i] = .{558 enumFields[i] = .{
559 .name = field.name,559 .name = field.name ++ "",
560 .value = i,560 .value = i,
561 };561 };
562 }562 }
...@@ -628,7 +628,7 @@ pub fn DeclEnum(comptime T: type) type {...@@ -628,7 +628,7 @@ pub fn DeclEnum(comptime T: type) type {
628 var enumDecls: [fieldInfos.len]std.builtin.Type.EnumField = undefined;628 var enumDecls: [fieldInfos.len]std.builtin.Type.EnumField = undefined;
629 var decls = [_]std.builtin.Type.Declaration{};629 var decls = [_]std.builtin.Type.Declaration{};
630 inline for (fieldInfos, 0..) |field, i| {630 inline for (fieldInfos, 0..) |field, i| {
631 enumDecls[i] = .{ .name = field.name, .value = i };631 enumDecls[i] = .{ .name = field.name ++ "", .value = i };
632 }632 }
633 return @Type(.{633 return @Type(.{
634 .Enum = .{634 .Enum = .{
src/value.zig+1-1
...@@ -4050,7 +4050,7 @@ pub const Value = struct {...@@ -4050,7 +4050,7 @@ pub const Value = struct {
4050 const tags = @typeInfo(Tag).Enum.fields;4050 const tags = @typeInfo(Tag).Enum.fields;
4051 var fields: [tags.len]std.builtin.Type.StructField = undefined;4051 var fields: [tags.len]std.builtin.Type.StructField = undefined;
4052 for (&fields, tags) |*field, t| field.* = .{4052 for (&fields, tags) |*field, t| field.* = .{
4053 .name = t.name,4053 .name = t.name ++ "",
4054 .type = *@field(Tag, t.name).Type(),4054 .type = *@field(Tag, t.name).Type(),
4055 .default_value = null,4055 .default_value = null,
4056 .is_comptime = false,4056 .is_comptime = false,