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.
This commit is contained in:
mlugg
2024-08-28 02:35:53 +01:00
parent 1a178d4995
commit 0fe3fd01dd
336 changed files with 4105 additions and 4112 deletions

View File

@@ -95,8 +95,8 @@ pub const Node = struct {
/// Not thread-safe.
fn getIpcFd(s: Storage) ?posix.fd_t {
return if (s.estimated_total_count == std.math.maxInt(u32)) switch (@typeInfo(posix.fd_t)) {
.Int => @bitCast(s.completed_count),
.Pointer => @ptrFromInt(s.completed_count),
.int => @bitCast(s.completed_count),
.pointer => @ptrFromInt(s.completed_count),
else => @compileError("unsupported fd_t of " ++ @typeName(posix.fd_t)),
} else null;
}
@@ -104,8 +104,8 @@ pub const Node = struct {
/// Thread-safe.
fn setIpcFd(s: *Storage, fd: posix.fd_t) void {
const integer: u32 = switch (@typeInfo(posix.fd_t)) {
.Int => @bitCast(fd),
.Pointer => @intFromPtr(fd),
.int => @bitCast(fd),
.pointer => @intFromPtr(fd),
else => @compileError("unsupported fd_t of " ++ @typeName(posix.fd_t)),
};
// `estimated_total_count` max int indicates the special state that
@@ -276,8 +276,8 @@ pub const Node = struct {
const storage = storageByIndex(index);
const int = @atomicLoad(u32, &storage.completed_count, .monotonic);
return switch (@typeInfo(posix.fd_t)) {
.Int => @bitCast(int),
.Pointer => @ptrFromInt(int),
.int => @bitCast(int),
.pointer => @ptrFromInt(int),
else => @compileError("unsupported fd_t of " ++ @typeName(posix.fd_t)),
};
}
@@ -381,8 +381,8 @@ pub fn start(options: Options) Node {
if (std.process.parseEnvVarInt("ZIG_PROGRESS", u31, 10)) |ipc_fd| {
global_progress.update_thread = std.Thread.spawn(.{}, ipcThreadRun, .{
@as(posix.fd_t, switch (@typeInfo(posix.fd_t)) {
.Int => ipc_fd,
.Pointer => @ptrFromInt(ipc_fd),
.int => ipc_fd,
.pointer => @ptrFromInt(ipc_fd),
else => @compileError("unsupported fd_t of " ++ @typeName(posix.fd_t)),
}),
}) catch |err| {
@@ -633,7 +633,7 @@ const TreeSymbol = enum {
fn maxByteLen(symbol: TreeSymbol) usize {
var max: usize = 0;
inline for (@typeInfo(Encoding).Enum.fields) |field| {
inline for (@typeInfo(Encoding).@"enum".fields) |field| {
const len = symbol.bytes(@field(Encoding, field.name)).len;
max = @max(max, len);
}