diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-08-28 10:49:31 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-28 10:49:31 -0700 |
| commit | 31fef6f1103ea64a899729adea13b0ab9b66cb46 (patch) | |
| tree | 31c13b06483af84cd0977be8de00d3539e3e3c4d /lib/std/debug | |
| parent | 9a12905a2da045b0948f612583b526bca3a1b2f0 (diff) | |
| parent | aaa7e739831f39151a37c7beb08660f0fb6ae0ed (diff) | |
| download | zig-31fef6f1103ea64a899729adea13b0ab9b66cb46.tar.gz zig-31fef6f1103ea64a899729adea13b0ab9b66cb46.zip | |
Merge pull request #21225 from mlugg/std-builtin-type
std: update `std.builtin.Type` fields to follow naming conventions
Diffstat (limited to 'lib/std/debug')
| -rw-r--r-- | lib/std/debug/Dwarf.zig | 2 | ||||
| -rw-r--r-- | lib/std/debug/Dwarf/expression.zig | 6 | ||||
| -rw-r--r-- | lib/std/debug/FixedBufferReader.zig | 2 | ||||
| -rw-r--r-- | lib/std/debug/Pdb.zig | 2 | ||||
| -rw-r--r-- | lib/std/debug/SelfInfo.zig | 10 |
5 files changed, 11 insertions, 11 deletions
diff --git a/lib/std/debug/Dwarf.zig b/lib/std/debug/Dwarf.zig index 7cce30df38..c311dc4cf6 100644 --- a/lib/std/debug/Dwarf.zig +++ b/lib/std/debug/Dwarf.zig @@ -2216,7 +2216,7 @@ pub const ElfModule = struct { } var section_index: ?usize = null; - inline for (@typeInfo(Dwarf.Section.Id).Enum.fields, 0..) |sect, i| { + inline for (@typeInfo(Dwarf.Section.Id).@"enum".fields, 0..) |sect, i| { if (mem.eql(u8, "." ++ sect.name, name)) section_index = i; } if (section_index == null) continue; diff --git a/lib/std/debug/Dwarf/expression.zig b/lib/std/debug/Dwarf/expression.zig index 5fab56de6e..f71a4e02c1 100644 --- a/lib/std/debug/Dwarf/expression.zig +++ b/lib/std/debug/Dwarf/expression.zig @@ -164,7 +164,7 @@ pub fn StackMachine(comptime options: Options) type { } fn generic(value: anytype) Operand { - const int_info = @typeInfo(@TypeOf(value)).Int; + const int_info = @typeInfo(@TypeOf(value)).int; if (@sizeOf(@TypeOf(value)) > options.addr_size) { return .{ .generic = switch (int_info.signedness) { .signed => @bitCast(@as(addr_type_signed, @truncate(value))), @@ -843,7 +843,7 @@ pub fn Builder(comptime options: Options) type { } pub fn writeConst(writer: anytype, comptime T: type, value: T) !void { - if (@typeInfo(T) != .Int) @compileError("Constants must be integers"); + if (@typeInfo(T) != .int) @compileError("Constants must be integers"); switch (T) { u8, i8, u16, i16, u32, i32, u64, i64 => { @@ -861,7 +861,7 @@ pub fn Builder(comptime options: Options) type { try writer.writeInt(T, value, options.endian); }, - else => switch (@typeInfo(T).Int.signedness) { + else => switch (@typeInfo(T).int.signedness) { .unsigned => { try writer.writeByte(OP.constu); try leb.writeUleb128(writer, value); diff --git a/lib/std/debug/FixedBufferReader.zig b/lib/std/debug/FixedBufferReader.zig index 494245a9e9..e4aec1a9c6 100644 --- a/lib/std/debug/FixedBufferReader.zig +++ b/lib/std/debug/FixedBufferReader.zig @@ -32,7 +32,7 @@ pub fn readByteSigned(fbr: *FixedBufferReader) Error!i8 { } pub fn readInt(fbr: *FixedBufferReader, comptime T: type) Error!T { - const size = @divExact(@typeInfo(T).Int.bits, 8); + const size = @divExact(@typeInfo(T).int.bits, 8); if (fbr.buf.len - fbr.pos < size) return error.EndOfBuffer; defer fbr.pos += size; return std.mem.readInt(T, fbr.buf[fbr.pos..][0..size], fbr.endian); diff --git a/lib/std/debug/Pdb.zig b/lib/std/debug/Pdb.zig index bdcc108c1d..2b2f37e7b6 100644 --- a/lib/std/debug/Pdb.zig +++ b/lib/std/debug/Pdb.zig @@ -495,7 +495,7 @@ const MsfStream = struct { blocks: []u32 = undefined, block_size: u32 = undefined, - pub const Error = @typeInfo(@typeInfo(@TypeOf(read)).Fn.return_type.?).ErrorUnion.error_set; + pub const Error = @typeInfo(@typeInfo(@TypeOf(read)).@"fn".return_type.?).error_union.error_set; fn init(block_size: u32, file: File, blocks: []u32) MsfStream { const stream = MsfStream{ diff --git a/lib/std/debug/SelfInfo.zig b/lib/std/debug/SelfInfo.zig index 5d2dca960b..19adebf711 100644 --- a/lib/std/debug/SelfInfo.zig +++ b/lib/std/debug/SelfInfo.zig @@ -37,7 +37,7 @@ modules: if (native_os == .windows) std.ArrayListUnmanaged(WindowsModule) else v pub const OpenError = error{ MissingDebugInfo, UnsupportedOperatingSystem, -} || @typeInfo(@typeInfo(@TypeOf(SelfInfo.init)).Fn.return_type.?).ErrorUnion.error_set; +} || @typeInfo(@typeInfo(@TypeOf(SelfInfo.init)).@"fn".return_type.?).error_union.error_set; pub fn open(allocator: Allocator) OpenError!SelfInfo { nosuspend { @@ -582,7 +582,7 @@ pub const Module = switch (native_os) { if (!std.mem.eql(u8, "__DWARF", sect.segName())) continue; var section_index: ?usize = null; - inline for (@typeInfo(Dwarf.Section.Id).Enum.fields, 0..) |section, i| { + inline for (@typeInfo(Dwarf.Section.Id).@"enum".fields, 0..) |section, i| { if (mem.eql(u8, "__" ++ section.name, sect.sectName())) section_index = i; } if (section_index == null) continue; @@ -981,7 +981,7 @@ fn readCoffDebugInfo(allocator: Allocator, coff_obj: *coff.Coff) !Module { var sections: Dwarf.SectionArray = Dwarf.null_section_array; errdefer for (sections) |section| if (section) |s| if (s.owned) allocator.free(s.data); - inline for (@typeInfo(Dwarf.Section.Id).Enum.fields, 0..) |section, i| { + inline for (@typeInfo(Dwarf.Section.Id).@"enum".fields, 0..) |section, i| { sections[i] = if (coff_obj.getSectionByName("." ++ section.name)) |section_header| blk: { break :blk .{ .data = try coff_obj.getSectionDataAlloc(section_header, allocator), @@ -1443,7 +1443,7 @@ pub fn unwindFrameMachO( if (ma.load(usize, new_sp) == null or ma.load(usize, min_reg_addr) == null) return error.InvalidUnwindInfo; var reg_addr = fp - @sizeOf(usize); - inline for (@typeInfo(@TypeOf(encoding.value.arm64.frame.x_reg_pairs)).Struct.fields, 0..) |field, i| { + inline for (@typeInfo(@TypeOf(encoding.value.arm64.frame.x_reg_pairs)).@"struct".fields, 0..) |field, i| { if (@field(encoding.value.arm64.frame.x_reg_pairs, field.name) != 0) { (try regValueNative(context.thread_context, 19 + i, reg_context)).* = @as(*const usize, @ptrFromInt(reg_addr)).*; reg_addr += @sizeOf(usize); @@ -1452,7 +1452,7 @@ pub fn unwindFrameMachO( } } - inline for (@typeInfo(@TypeOf(encoding.value.arm64.frame.d_reg_pairs)).Struct.fields, 0..) |field, i| { + inline for (@typeInfo(@TypeOf(encoding.value.arm64.frame.d_reg_pairs)).@"struct".fields, 0..) |field, i| { if (@field(encoding.value.arm64.frame.d_reg_pairs, field.name) != 0) { // Only the lower half of the 128-bit V registers are restored during unwinding @memcpy( |
