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/Step/ConfigHeader.zig | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'lib/std/Build/Step/ConfigHeader.zig') diff --git a/lib/std/Build/Step/ConfigHeader.zig b/lib/std/Build/Step/ConfigHeader.zig index 512460a532..895f50f5d0 100644 --- a/lib/std/Build/Step/ConfigHeader.zig +++ b/lib/std/Build/Step/ConfigHeader.zig @@ -109,47 +109,47 @@ pub fn getOutput(config_header: *ConfigHeader) std.Build.LazyPath { } fn addValuesInner(config_header: *ConfigHeader, values: anytype) !void { - inline for (@typeInfo(@TypeOf(values)).Struct.fields) |field| { + inline for (@typeInfo(@TypeOf(values)).@"struct".fields) |field| { try putValue(config_header, field.name, field.type, @field(values, field.name)); } } fn putValue(config_header: *ConfigHeader, field_name: []const u8, comptime T: type, v: T) !void { switch (@typeInfo(T)) { - .Null => { + .null => { try config_header.values.put(field_name, .undef); }, - .Void => { + .void => { try config_header.values.put(field_name, .defined); }, - .Bool => { + .bool => { try config_header.values.put(field_name, .{ .boolean = v }); }, - .Int => { + .int => { try config_header.values.put(field_name, .{ .int = v }); }, - .ComptimeInt => { + .comptime_int => { try config_header.values.put(field_name, .{ .int = v }); }, - .EnumLiteral => { + .enum_literal => { try config_header.values.put(field_name, .{ .ident = @tagName(v) }); }, - .Optional => { + .optional => { if (v) |x| { return putValue(config_header, field_name, @TypeOf(x), x); } else { try config_header.values.put(field_name, .undef); } }, - .Pointer => |ptr| { + .pointer => |ptr| { switch (@typeInfo(ptr.child)) { - .Array => |array| { + .array => |array| { if (ptr.size == .One and array.child == u8) { try config_header.values.put(field_name, .{ .string = v }); return; } }, - .Int => { + .int => { if (ptr.size == .Slice and ptr.child == u8) { try config_header.values.put(field_name, .{ .string = v }); return; -- cgit v1.2.3