authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2025-05-12 18:53:57+02:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2025-05-14 06:47:23+02:00
logbc2f7c7547dce95dfd1aa00e377ae9f366825177
tree0a6c954644e403a79895ea9d27497e92e99cb9b1
parent518105471e145c90809fb2f5baa53cd08bde31aa

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

This reverts commit c8fa767f083e610840cef688b709783c5ad66acc.

3 files changed, 4 insertions(+), 4 deletions(-)

lib/std/enums.zig+1-1
...@@ -36,7 +36,7 @@ pub fn EnumFieldStruct(comptime E: type, comptime Data: type, comptime field_def...@@ -36,7 +36,7 @@ pub fn EnumFieldStruct(comptime E: type, comptime Data: type, comptime field_def
36 var struct_fields: [@typeInfo(E).@"enum".fields.len]std.builtin.Type.StructField = undefined;36 var struct_fields: [@typeInfo(E).@"enum".fields.len]std.builtin.Type.StructField = undefined;
37 for (&struct_fields, @typeInfo(E).@"enum".fields) |*struct_field, enum_field| {37 for (&struct_fields, @typeInfo(E).@"enum".fields) |*struct_field, enum_field| {
38 struct_field.* = .{38 struct_field.* = .{
39 .name = enum_field.name ++ "",39 .name = enum_field.name,
40 .type = Data,40 .type = Data,
41 .default_value_ptr = if (field_default) |d| @as(?*const anyopaque, @ptrCast(&d)) else null,41 .default_value_ptr = if (field_default) |d| @as(?*const anyopaque, @ptrCast(&d)) else null,
42 .is_comptime = false,42 .is_comptime = false,
lib/std/io.zig+1-1
...@@ -803,7 +803,7 @@ pub fn PollFiles(comptime StreamEnum: type) type {...@@ -803,7 +803,7 @@ pub fn PollFiles(comptime StreamEnum: type) type {
803 var struct_fields: [enum_fields.len]std.builtin.Type.StructField = undefined;803 var struct_fields: [enum_fields.len]std.builtin.Type.StructField = undefined;
804 for (&struct_fields, enum_fields) |*struct_field, enum_field| {804 for (&struct_fields, enum_fields) |*struct_field, enum_field| {
805 struct_field.* = .{805 struct_field.* = .{
806 .name = enum_field.name ++ "",806 .name = enum_field.name,
807 .type = fs.File,807 .type = fs.File,
808 .default_value_ptr = null,808 .default_value_ptr = null,
809 .is_comptime = false,809 .is_comptime = false,
lib/std/meta.zig+2-2
...@@ -537,7 +537,7 @@ pub fn FieldEnum(comptime T: type) type {...@@ -537,7 +537,7 @@ pub fn FieldEnum(comptime T: type) type {
537 var decls = [_]std.builtin.Type.Declaration{};537 var decls = [_]std.builtin.Type.Declaration{};
538 inline for (field_infos, 0..) |field, i| {538 inline for (field_infos, 0..) |field, i| {
539 enumFields[i] = .{539 enumFields[i] = .{
540 .name = field.name ++ "",540 .name = field.name,
541 .value = i,541 .value = i,
542 };542 };
543 }543 }
...@@ -609,7 +609,7 @@ pub fn DeclEnum(comptime T: type) type {...@@ -609,7 +609,7 @@ pub fn DeclEnum(comptime T: type) type {
609 var enumDecls: [fieldInfos.len]std.builtin.Type.EnumField = undefined;609 var enumDecls: [fieldInfos.len]std.builtin.Type.EnumField = undefined;
610 var decls = [_]std.builtin.Type.Declaration{};610 var decls = [_]std.builtin.Type.Declaration{};
611 inline for (fieldInfos, 0..) |field, i| {611 inline for (fieldInfos, 0..) |field, i| {
612 enumDecls[i] = .{ .name = field.name ++ "", .value = i };612 enumDecls[i] = .{ .name = field.name, .value = i };
613 }613 }
614 return @Type(.{614 return @Type(.{
615 .@"enum" = .{615 .@"enum" = .{