diff options
| author | Carl Åstholm <carl@astholm.se> | 2024-01-07 15:52:24 +0100 |
|---|---|---|
| committer | Carl Åstholm <carl@astholm.se> | 2024-01-07 16:21:08 +0100 |
| commit | c8fa767f083e610840cef688b709783c5ad66acc (patch) | |
| tree | 3b5e75ba381e722eb1e2c8cbc44d1df870b534dd /lib/std/meta.zig | |
| parent | a02bd81760166d679ccee0e190bf62115272ffbe (diff) | |
| download | zig-c8fa767f083e610840cef688b709783c5ad66acc.tar.gz zig-c8fa767f083e610840cef688b709783c5ad66acc.zip | |
Work around stage1 not yet returning null-terminated `@typeInfo` strings
These changes can be reverted the next time stage1 is updated.
Diffstat (limited to 'lib/std/meta.zig')
| -rw-r--r-- | lib/std/meta.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/meta.zig b/lib/std/meta.zig index 5531242e30..41b3ca291f 100644 --- a/lib/std/meta.zig +++ b/lib/std/meta.zig @@ -556,7 +556,7 @@ pub fn FieldEnum(comptime T: type) type { var decls = [_]std.builtin.Type.Declaration{}; inline for (field_infos, 0..) |field, i| { enumFields[i] = .{ - .name = field.name, + .name = field.name ++ "", .value = i, }; } @@ -628,7 +628,7 @@ pub fn DeclEnum(comptime T: type) type { var enumDecls: [fieldInfos.len]std.builtin.Type.EnumField = undefined; var decls = [_]std.builtin.Type.Declaration{}; inline for (fieldInfos, 0..) |field, i| { - enumDecls[i] = .{ .name = field.name, .value = i }; + enumDecls[i] = .{ .name = field.name ++ "", .value = i }; } return @Type(.{ .Enum = .{ |
