From 0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9 Mon Sep 17 00:00:00 2001 From: mlugg Date: Wed, 28 Aug 2024 02:35:53 +0100 Subject: 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. --- lib/std/Build/Cache.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/std/Build/Cache.zig') diff --git a/lib/std/Build/Cache.zig b/lib/std/Build/Cache.zig index 1eabdd54e6..93908807eb 100644 --- a/lib/std/Build/Cache.zig +++ b/lib/std/Build/Cache.zig @@ -222,7 +222,7 @@ pub const HashHelper = struct { .hexstring => |hex_string| hh.addBytes(hex_string.toSlice()), }, else => switch (@typeInfo(@TypeOf(x))) { - .Bool, .Int, .Enum, .Array => hh.addBytes(mem.asBytes(&x)), + .bool, .int, .@"enum", .array => hh.addBytes(mem.asBytes(&x)), else => @compileError("unable to hash type " ++ @typeName(@TypeOf(x))), }, } @@ -1014,7 +1014,7 @@ pub const Manifest = struct { } pub fn populateFileSystemInputs(man: *Manifest, buf: *std.ArrayListUnmanaged(u8)) Allocator.Error!void { - assert(@typeInfo(std.zig.Server.Message.PathPrefix).Enum.fields.len == man.cache.prefixes_len); + assert(@typeInfo(std.zig.Server.Message.PathPrefix).@"enum".fields.len == man.cache.prefixes_len); buf.clearRetainingCapacity(); const gpa = man.cache.gpa; const files = man.files.keys(); @@ -1032,7 +1032,7 @@ pub const Manifest = struct { pub fn populateOtherManifest(man: *Manifest, other: *Manifest, prefix_map: [4]u8) Allocator.Error!void { const gpa = other.cache.gpa; - assert(@typeInfo(std.zig.Server.Message.PathPrefix).Enum.fields.len == man.cache.prefixes_len); + assert(@typeInfo(std.zig.Server.Message.PathPrefix).@"enum".fields.len == man.cache.prefixes_len); assert(man.cache.prefixes_len == 4); for (man.files.keys()) |file| { const prefixed_path: PrefixedPath = .{ -- cgit v1.2.3