diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2024-08-28 02:35:53 +0100 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2024-08-28 08:39:59 +0100 |
| commit | 0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9 (patch) | |
| tree | 2c07fddf2b6230360fe618c4de192bc2d24eeaf7 /test/src/Cases.zig | |
| parent | 1a178d499537b922ff05c5d0186ed5a00dbb1a9b (diff) | |
| download | zig-0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9.tar.gz zig-0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9.zip | |
std: update `std.builtin.Type` fields to follow naming conventions
The compiler actually doesn't need any functional changes for this: Sema
does reification based on the tag indices of `std.builtin.Type` already!
So, no zig1.wasm update is necessary.
This change is necessary to disallow name clashes between fields and
decls on a type, which is a prerequisite of #9938.
Diffstat (limited to 'test/src/Cases.zig')
| -rw-r--r-- | test/src/Cases.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/src/Cases.zig b/test/src/Cases.zig index dbf409f53b..0e88bdd133 100644 --- a/test/src/Cases.zig +++ b/test/src/Cases.zig @@ -1188,12 +1188,12 @@ const TestManifest = struct { }.parse; switch (@typeInfo(T)) { - .Int => return struct { + .int => return struct { fn parse(str: []const u8) anyerror!T { return try std.fmt.parseInt(T, str, 0); } }.parse, - .Bool => return struct { + .bool => return struct { fn parse(str: []const u8) anyerror!T { if (std.mem.eql(u8, str, "true")) return true; if (std.mem.eql(u8, str, "false")) return false; @@ -1201,7 +1201,7 @@ const TestManifest = struct { return error.InvalidBool; } }.parse, - .Enum => return struct { + .@"enum" => return struct { fn parse(str: []const u8) anyerror!T { return std.meta.stringToEnum(T, str) orelse { std.log.err("unknown enum variant for {s}: {s}", .{ @typeName(T), str }); @@ -1209,7 +1209,7 @@ const TestManifest = struct { }; } }.parse, - .Struct => @compileError("no default parser for " ++ @typeName(T)), + .@"struct" => @compileError("no default parser for " ++ @typeName(T)), else => @compileError("no default parser for " ++ @typeName(T)), } } |
