authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-08-30 14:50:33-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-08-31 12:49:18-07:00
log150169f1e0cf08d4b76fed81fc205a63177b6e01
treec39318b34c361a9a5a8ddaa1aae80cba1fe27f0c
parentab99dd9c5d22a3d927453081654b1f75b2521b48

std.fmt: delete deprecated APIs

std.fmt.Formatter -> std.fmt.Alt std.fmt.format -> std.Io.Writer.print

55 files changed, 127 insertions(+), 141 deletions(-)

lib/compiler/aro/aro/Diagnostics.zig+1-1
...@@ -470,7 +470,7 @@ pub fn renderMessage(comp: *Compilation, m: anytype, msg: Message) void {...@@ -470,7 +470,7 @@ pub fn renderMessage(comp: *Compilation, m: anytype, msg: Message) void {
470 }470 }
471 }.f;471 }.f;
472 printRt(m, prop.msg, .{"{f}"}, .{472 printRt(m, prop.msg, .{"{f}"}, .{
473 std.fmt.Formatter([]const u8, f){ .data = msg.extra.normalized },473 std.fmt.Alt([]const u8, f){ .data = msg.extra.normalized },
474 });474 });
475 },475 },
476 .none, .offset => m.write(prop.msg),476 .none, .offset => m.write(prop.msg),
lib/compiler/resinator/errors.zig+1-1
...@@ -433,7 +433,7 @@ pub const ErrorDetails = struct {...@@ -433,7 +433,7 @@ pub const ErrorDetails = struct {
433 code_page: SupportedCodePage,433 code_page: SupportedCodePage,
434 };434 };
435435
436 fn fmtToken(self: ErrorDetails, source: []const u8) std.fmt.Formatter(TokenFormatContext, formatToken) {436 fn fmtToken(self: ErrorDetails, source: []const u8) std.fmt.Alt(TokenFormatContext, formatToken) {
437 return .{ .data = .{437 return .{ .data = .{
438 .token = self.token,438 .token = self.token,
439 .code_page = self.code_page,439 .code_page = self.code_page,
lib/compiler/resinator/res.zig+1-1
...@@ -465,7 +465,7 @@ pub const NameOrOrdinal = union(enum) {...@@ -465,7 +465,7 @@ pub const NameOrOrdinal = union(enum) {
465 }465 }
466 }466 }
467467
468 pub fn fmtResourceType(type_value: NameOrOrdinal) std.fmt.Formatter(NameOrOrdinal, formatResourceType) {468 pub fn fmtResourceType(type_value: NameOrOrdinal) std.fmt.Alt(NameOrOrdinal, formatResourceType) {
469 return .{ .data = type_value };469 return .{ .data = type_value };
470 }470 }
471};471};
lib/docs/wasm/markdown/renderer.zig+1-1
...@@ -231,7 +231,7 @@ pub fn renderInlineNodeText(...@@ -231,7 +231,7 @@ pub fn renderInlineNodeText(
231 }231 }
232}232}
233233
234pub fn fmtHtml(bytes: []const u8) std.fmt.Formatter([]const u8, formatHtml) {234pub fn fmtHtml(bytes: []const u8) std.fmt.Alt([]const u8, formatHtml) {
235 return .{ .data = bytes };235 return .{ .data = bytes };
236}236}
237237
lib/std/Build/Cache/Path.zig+2-2
...@@ -147,7 +147,7 @@ pub fn toStringZ(p: Path, allocator: Allocator) Allocator.Error![:0]u8 {...@@ -147,7 +147,7 @@ pub fn toStringZ(p: Path, allocator: Allocator) Allocator.Error![:0]u8 {
147 return std.fmt.allocPrintSentinel(allocator, "{f}", .{p}, 0);147 return std.fmt.allocPrintSentinel(allocator, "{f}", .{p}, 0);
148}148}
149149
150pub fn fmtEscapeString(path: Path) std.fmt.Formatter(Path, formatEscapeString) {150pub fn fmtEscapeString(path: Path) std.fmt.Alt(Path, formatEscapeString) {
151 return .{ .data = path };151 return .{ .data = path };
152}152}
153153
...@@ -162,7 +162,7 @@ pub fn formatEscapeString(path: Path, writer: *std.Io.Writer) std.Io.Writer.Erro...@@ -162,7 +162,7 @@ pub fn formatEscapeString(path: Path, writer: *std.Io.Writer) std.Io.Writer.Erro
162}162}
163163
164/// Deprecated, use double quoted escape to print paths.164/// Deprecated, use double quoted escape to print paths.
165pub fn fmtEscapeChar(path: Path) std.fmt.Formatter(Path, formatEscapeChar) {165pub fn fmtEscapeChar(path: Path) std.fmt.Alt(Path, formatEscapeChar) {
166 return .{ .data = path };166 return .{ .data = path };
167}167}
168168
lib/std/Build/Step/CheckObject.zig+3-3
...@@ -595,7 +595,7 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void {...@@ -595,7 +595,7 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void {
595 // we either format message string with escaped codes, or not to aid debugging595 // we either format message string with escaped codes, or not to aid debugging
596 // the failed test.596 // the failed test.
597 const fmtMessageString = struct {597 const fmtMessageString = struct {
598 fn fmtMessageString(kind: Check.Kind, msg: []const u8) std.fmt.Formatter(Ctx, formatMessageString) {598 fn fmtMessageString(kind: Check.Kind, msg: []const u8) std.fmt.Alt(Ctx, formatMessageString) {
599 return .{ .data = .{599 return .{ .data = .{
600 .kind = kind,600 .kind = kind,
601 .msg = msg,601 .msg = msg,
...@@ -2281,7 +2281,7 @@ const ElfDumper = struct {...@@ -2281,7 +2281,7 @@ const ElfDumper = struct {
2281 return mem.sliceTo(@as([*:0]const u8, @ptrCast(strtab.ptr + off)), 0);2281 return mem.sliceTo(@as([*:0]const u8, @ptrCast(strtab.ptr + off)), 0);
2282 }2282 }
22832283
2284 fn fmtShType(sh_type: u32) std.fmt.Formatter(u32, formatShType) {2284 fn fmtShType(sh_type: u32) std.fmt.Alt(u32, formatShType) {
2285 return .{ .data = sh_type };2285 return .{ .data = sh_type };
2286 }2286 }
22872287
...@@ -2321,7 +2321,7 @@ const ElfDumper = struct {...@@ -2321,7 +2321,7 @@ const ElfDumper = struct {
2321 try writer.writeAll(name);2321 try writer.writeAll(name);
2322 }2322 }
23232323
2324 fn fmtPhType(ph_type: u32) std.fmt.Formatter(u32, formatPhType) {2324 fn fmtPhType(ph_type: u32) std.fmt.Alt(u32, formatPhType) {
2325 return .{ .data = ph_type };2325 return .{ .data = ph_type };
2326 }2326 }
23272327
lib/std/Build/Step/Run.zig+1-1
...@@ -1025,7 +1025,7 @@ fn formatTerm(term: ?std.process.Child.Term, w: *std.Io.Writer) std.Io.Writer.Er...@@ -1025,7 +1025,7 @@ fn formatTerm(term: ?std.process.Child.Term, w: *std.Io.Writer) std.Io.Writer.Er
1025 try w.writeAll("exited with any code");1025 try w.writeAll("exited with any code");
1026 }1026 }
1027}1027}
1028fn fmtTerm(term: ?std.process.Child.Term) std.fmt.Formatter(?std.process.Child.Term, formatTerm) {1028fn fmtTerm(term: ?std.process.Child.Term) std.fmt.Alt(?std.process.Child.Term, formatTerm) {
1029 return .{ .data = term };1029 return .{ .data = term };
1030}1030}
10311031
lib/std/Uri.zig+1-1
...@@ -359,7 +359,7 @@ pub const Format = struct {...@@ -359,7 +359,7 @@ pub const Format = struct {
359 }359 }
360};360};
361361
362pub fn fmt(uri: *const Uri, flags: Format.Flags) std.fmt.Formatter(Format, Format.default) {362pub fn fmt(uri: *const Uri, flags: Format.Flags) std.fmt.Alt(Format, Format.default) {
363 return .{ .data = .{ .uri = uri, .flags = flags } };363 return .{ .data = .{ .uri = uri, .flags = flags } };
364}364}
365365
lib/std/ascii.zig+1-1
...@@ -464,7 +464,7 @@ pub const HexEscape = struct {...@@ -464,7 +464,7 @@ pub const HexEscape = struct {
464};464};
465465
466/// Replaces non-ASCII bytes with hex escapes.466/// Replaces non-ASCII bytes with hex escapes.
467pub fn hexEscape(bytes: []const u8, case: std.fmt.Case) std.fmt.Formatter(HexEscape, HexEscape.format) {467pub fn hexEscape(bytes: []const u8, case: std.fmt.Case) std.fmt.Alt(HexEscape, HexEscape.format) {
468 return .{ .data = .{ .bytes = bytes, .charset = switch (case) {468 return .{ .data = .{ .bytes = bytes, .charset = switch (case) {
469 .lower => HexEscape.lower_charset,469 .lower => HexEscape.lower_charset,
470 .upper => HexEscape.upper_charset,470 .upper => HexEscape.upper_charset,
lib/std/fmt.zig+2-16
...@@ -28,9 +28,6 @@ pub const Case = enum { lower, upper };...@@ -28,9 +28,6 @@ pub const Case = enum { lower, upper };
28const default_alignment = .right;28const default_alignment = .right;
29const default_fill_char = ' ';29const default_fill_char = ' ';
3030
31/// Deprecated in favor of `Options`.
32pub const FormatOptions = Options;
33
34pub const Options = struct {31pub const Options = struct {
35 precision: ?usize = null,32 precision: ?usize = null,
36 width: ?usize = null,33 width: ?usize = null,
...@@ -77,14 +74,6 @@ pub const Number = struct {...@@ -77,14 +74,6 @@ pub const Number = struct {
77 };74 };
78};75};
7976
80/// Deprecated in favor of `Writer.print`.
81pub fn format(writer: anytype, comptime fmt: []const u8, args: anytype) !void {
82 var adapter = writer.adaptToNewApi(&.{});
83 return adapter.new_interface.print(fmt, args) catch |err| switch (err) {
84 error.WriteFailed => return adapter.err.?,
85 };
86}
87
88pub const Placeholder = struct {77pub const Placeholder = struct {
89 specifier_arg: []const u8,78 specifier_arg: []const u8,
90 fill: u8,79 fill: u8,
...@@ -274,9 +263,6 @@ pub fn digits2(value: u8) [2]u8 {...@@ -274,9 +263,6 @@ pub fn digits2(value: u8) [2]u8 {
274 }263 }
275}264}
276265
277/// Deprecated in favor of `Alt`.
278pub const Formatter = Alt;
279
280/// Creates a type suitable for instantiating and passing to a "{f}" placeholder.266/// Creates a type suitable for instantiating and passing to a "{f}" placeholder.
281pub fn Alt(267pub fn Alt(
282 comptime Data: type,268 comptime Data: type,
...@@ -294,7 +280,7 @@ pub fn Alt(...@@ -294,7 +280,7 @@ pub fn Alt(
294pub fn alt(280pub fn alt(
295 context: anytype,281 context: anytype,
296 comptime func_name: @TypeOf(.enum_literal),282 comptime func_name: @TypeOf(.enum_literal),
297) Formatter(@TypeOf(context), @field(@TypeOf(context), @tagName(func_name))) {283) Alt(@TypeOf(context), @field(@TypeOf(context), @tagName(func_name))) {
298 return .{ .data = context };284 return .{ .data = context };
299}285}
300286
...@@ -607,7 +593,7 @@ pub const BufPrintError = error{...@@ -607,7 +593,7 @@ pub const BufPrintError = error{
607 NoSpaceLeft,593 NoSpaceLeft,
608};594};
609595
610/// Print a Formatter string into `buf`. Returns a slice of the bytes printed.596/// Print a format string into `buf`. Returns a slice of the bytes printed.
611pub fn bufPrint(buf: []u8, comptime fmt: []const u8, args: anytype) BufPrintError![]u8 {597pub fn bufPrint(buf: []u8, comptime fmt: []const u8, args: anytype) BufPrintError![]u8 {
612 var w: Writer = .fixed(buf);598 var w: Writer = .fixed(buf);
613 w.print(fmt, args) catch |err| switch (err) {599 w.print(fmt, args) catch |err| switch (err) {
lib/std/fs/path.zig+1-1
...@@ -146,7 +146,7 @@ pub fn joinZ(allocator: Allocator, paths: []const []const u8) ![:0]u8 {...@@ -146,7 +146,7 @@ pub fn joinZ(allocator: Allocator, paths: []const []const u8) ![:0]u8 {
146 return out[0 .. out.len - 1 :0];146 return out[0 .. out.len - 1 :0];
147}147}
148148
149pub fn fmtJoin(paths: []const []const u8) std.fmt.Formatter([]const []const u8, formatJoin) {149pub fn fmtJoin(paths: []const []const u8) std.fmt.Alt([]const []const u8, formatJoin) {
150 return .{ .data = paths };150 return .{ .data = paths };
151}151}
152152
lib/std/unicode.zig+2-2
...@@ -893,7 +893,7 @@ fn formatUtf8(utf8: []const u8, writer: *std.Io.Writer) std.Io.Writer.Error!void...@@ -893,7 +893,7 @@ fn formatUtf8(utf8: []const u8, writer: *std.Io.Writer) std.Io.Writer.Error!void
893/// Ill-formed UTF-8 byte sequences are replaced by the replacement character (U+FFFD)893/// Ill-formed UTF-8 byte sequences are replaced by the replacement character (U+FFFD)
894/// according to "U+FFFD Substitution of Maximal Subparts" from Chapter 3 of894/// according to "U+FFFD Substitution of Maximal Subparts" from Chapter 3 of
895/// the Unicode standard, and as specified by https://encoding.spec.whatwg.org/#utf-8-decoder895/// the Unicode standard, and as specified by https://encoding.spec.whatwg.org/#utf-8-decoder
896pub fn fmtUtf8(utf8: []const u8) std.fmt.Formatter([]const u8, formatUtf8) {896pub fn fmtUtf8(utf8: []const u8) std.fmt.Alt([]const u8, formatUtf8) {
897 return .{ .data = utf8 };897 return .{ .data = utf8 };
898}898}
899899
...@@ -1483,7 +1483,7 @@ fn formatUtf16Le(utf16le: []const u16, writer: *std.Io.Writer) std.Io.Writer.Err...@@ -1483,7 +1483,7 @@ fn formatUtf16Le(utf16le: []const u16, writer: *std.Io.Writer) std.Io.Writer.Err
1483/// Return a Formatter for a (potentially ill-formed) UTF-16 LE string,1483/// Return a Formatter for a (potentially ill-formed) UTF-16 LE string,
1484/// which will be converted to UTF-8 during formatting.1484/// which will be converted to UTF-8 during formatting.
1485/// Unpaired surrogates are replaced by the replacement character (U+FFFD).1485/// Unpaired surrogates are replaced by the replacement character (U+FFFD).
1486pub fn fmtUtf16Le(utf16le: []const u16) std.fmt.Formatter([]const u16, formatUtf16Le) {1486pub fn fmtUtf16Le(utf16le: []const u16) std.fmt.Alt([]const u16, formatUtf16Le) {
1487 return .{ .data = utf16le };1487 return .{ .data = utf16le };
1488}1488}
14891489
lib/std/zig.zig+2-2
...@@ -462,12 +462,12 @@ pub const FormatId = struct {...@@ -462,12 +462,12 @@ pub const FormatId = struct {
462};462};
463463
464/// Return a formatter for escaping a double quoted Zig string.464/// Return a formatter for escaping a double quoted Zig string.
465pub fn fmtString(bytes: []const u8) std.fmt.Formatter([]const u8, stringEscape) {465pub fn fmtString(bytes: []const u8) std.fmt.Alt([]const u8, stringEscape) {
466 return .{ .data = bytes };466 return .{ .data = bytes };
467}467}
468468
469/// Return a formatter for escaping a single quoted Zig string.469/// Return a formatter for escaping a single quoted Zig string.
470pub fn fmtChar(c: u21) std.fmt.Formatter(u21, charEscape) {470pub fn fmtChar(c: u21) std.fmt.Alt(u21, charEscape) {
471 return .{ .data = c };471 return .{ .data = c };
472}472}
473473
lib/std/zig/llvm/Builder.zig+16-16
...@@ -111,7 +111,7 @@ pub const String = enum(u32) {...@@ -111,7 +111,7 @@ pub const String = enum(u32) {
111 return printEscapedString(string_slice, quote_behavior, w);111 return printEscapedString(string_slice, quote_behavior, w);
112 }112 }
113113
114 pub fn fmt(self: String, builder: *const Builder) std.fmt.Formatter(FormatData, format) {114 pub fn fmt(self: String, builder: *const Builder) std.fmt.Alt(FormatData, format) {
115 return .{ .data = .{115 return .{ .data = .{
116 .string = self,116 .string = self,
117 .builder = builder,117 .builder = builder,
...@@ -119,7 +119,7 @@ pub const String = enum(u32) {...@@ -119,7 +119,7 @@ pub const String = enum(u32) {
119 } };119 } };
120 }120 }
121121
122 pub fn fmtQ(self: String, builder: *const Builder) std.fmt.Formatter(FormatData, format) {122 pub fn fmtQ(self: String, builder: *const Builder) std.fmt.Alt(FormatData, format) {
123 return .{ .data = .{123 return .{ .data = .{
124 .string = self,124 .string = self,
125 .builder = builder,125 .builder = builder,
...@@ -127,7 +127,7 @@ pub const String = enum(u32) {...@@ -127,7 +127,7 @@ pub const String = enum(u32) {
127 } };127 } };
128 }128 }
129129
130 pub fn fmtRaw(self: String, builder: *const Builder) std.fmt.Formatter(FormatData, format) {130 pub fn fmtRaw(self: String, builder: *const Builder) std.fmt.Alt(FormatData, format) {
131 return .{ .data = .{131 return .{ .data = .{
132 .string = self,132 .string = self,
133 .builder = builder,133 .builder = builder,
...@@ -846,7 +846,7 @@ pub const Type = enum(u32) {...@@ -846,7 +846,7 @@ pub const Type = enum(u32) {
846 },846 },
847 }847 }
848 }848 }
849 pub fn fmt(self: Type, builder: *const Builder, mode: FormatData.Mode) std.fmt.Formatter(FormatData, format) {849 pub fn fmt(self: Type, builder: *const Builder, mode: FormatData.Mode) std.fmt.Alt(FormatData, format) {
850 return .{ .data = .{ .type = self, .builder = builder, .mode = mode } };850 return .{ .data = .{ .type = self, .builder = builder, .mode = mode } };
851 }851 }
852852
...@@ -1325,7 +1325,7 @@ pub const Attribute = union(Kind) {...@@ -1325,7 +1325,7 @@ pub const Attribute = union(Kind) {
1325 .none => unreachable,1325 .none => unreachable,
1326 }1326 }
1327 }1327 }
1328 pub fn fmt(self: Index, builder: *const Builder, mode: FormatData.mode) std.fmt.Formatter(FormatData, format) {1328 pub fn fmt(self: Index, builder: *const Builder, mode: FormatData.mode) std.fmt.Alt(FormatData, format) {
1329 return .{ .data = .{ .attribute_index = self, .builder = builder, .mode = mode } };1329 return .{ .data = .{ .attribute_index = self, .builder = builder, .mode = mode } };
1330 }1330 }
13311331
...@@ -1609,7 +1609,7 @@ pub const Attributes = enum(u32) {...@@ -1609,7 +1609,7 @@ pub const Attributes = enum(u32) {
1609 .flags = data.flags,1609 .flags = data.flags,
1610 }, w);1610 }, w);
1611 }1611 }
1612 pub fn fmt(self: Attributes, builder: *const Builder, flags: FormatData.Flags) std.fmt.Formatter(FormatData, format) {1612 pub fn fmt(self: Attributes, builder: *const Builder, flags: FormatData.Flags) std.fmt.Alt(FormatData, format) {
1613 return .{ .data = .{ .attributes = self, .builder = builder, .flags = flags } };1613 return .{ .data = .{ .attributes = self, .builder = builder, .flags = flags } };
1614 }1614 }
1615};1615};
...@@ -1803,7 +1803,7 @@ pub const Linkage = enum(u4) {...@@ -1803,7 +1803,7 @@ pub const Linkage = enum(u4) {
1803 fn formatOptional(data: ?Linkage, w: *Writer) Writer.Error!void {1803 fn formatOptional(data: ?Linkage, w: *Writer) Writer.Error!void {
1804 if (data) |linkage| try w.print(" {s}", .{@tagName(linkage)});1804 if (data) |linkage| try w.print(" {s}", .{@tagName(linkage)});
1805 }1805 }
1806 pub fn fmtOptional(self: ?Linkage) std.fmt.Formatter(?Linkage, formatOptional) {1806 pub fn fmtOptional(self: ?Linkage) std.fmt.Alt(?Linkage, formatOptional) {
1807 return .{ .data = self };1807 return .{ .data = self };
1808 }1808 }
1809};1809};
...@@ -2208,7 +2208,7 @@ pub const StrtabString = enum(u32) {...@@ -2208,7 +2208,7 @@ pub const StrtabString = enum(u32) {
2208 self: StrtabString,2208 self: StrtabString,
2209 builder: *const Builder,2209 builder: *const Builder,
2210 quote_behavior: ?QuoteBehavior,2210 quote_behavior: ?QuoteBehavior,
2211 ) std.fmt.Formatter(FormatData, format) {2211 ) std.fmt.Alt(FormatData, format) {
2212 return .{ .data = .{2212 return .{ .data = .{
2213 .string = self,2213 .string = self,
2214 .builder = builder,2214 .builder = builder,
...@@ -2387,7 +2387,7 @@ pub const Global = struct {...@@ -2387,7 +2387,7 @@ pub const Global = struct {
2387 data.global.unwrap(data.builder).name(data.builder).fmt(data.builder, .quote_unless_valid_identifier),2387 data.global.unwrap(data.builder).name(data.builder).fmt(data.builder, .quote_unless_valid_identifier),
2388 });2388 });
2389 }2389 }
2390 pub fn fmt(self: Index, builder: *const Builder) std.fmt.Formatter(FormatData, format) {2390 pub fn fmt(self: Index, builder: *const Builder) std.fmt.Alt(FormatData, format) {
2391 return .{ .data = .{ .global = self, .builder = builder } };2391 return .{ .data = .{ .global = self, .builder = builder } };
2392 }2392 }
23932393
...@@ -4852,7 +4852,7 @@ pub const Function = struct {...@@ -4852,7 +4852,7 @@ pub const Function = struct {
4852 function: Function.Index,4852 function: Function.Index,
4853 builder: *Builder,4853 builder: *Builder,
4854 flags: FormatFlags,4854 flags: FormatFlags,
4855 ) std.fmt.Formatter(FormatData, format) {4855 ) std.fmt.Alt(FormatData, format) {
4856 return .{ .data = .{4856 return .{ .data = .{
4857 .instruction = self,4857 .instruction = self,
4858 .function = function,4858 .function = function,
...@@ -7790,7 +7790,7 @@ pub const Constant = enum(u32) {...@@ -7790,7 +7790,7 @@ pub const Constant = enum(u32) {
7790 .global => |global| try w.print("{f}", .{global.fmt(data.builder)}),7790 .global => |global| try w.print("{f}", .{global.fmt(data.builder)}),
7791 }7791 }
7792 }7792 }
7793 pub fn fmt(self: Constant, builder: *Builder, flags: FormatFlags) std.fmt.Formatter(FormatData, format) {7793 pub fn fmt(self: Constant, builder: *Builder, flags: FormatFlags) std.fmt.Alt(FormatData, format) {
7794 return .{ .data = .{7794 return .{ .data = .{
7795 .constant = self,7795 .constant = self,
7796 .builder = builder,7796 .builder = builder,
...@@ -7868,7 +7868,7 @@ pub const Value = enum(u32) {...@@ -7868,7 +7868,7 @@ pub const Value = enum(u32) {
7868 .metadata => unreachable,7868 .metadata => unreachable,
7869 }7869 }
7870 }7870 }
7871 pub fn fmt(self: Value, function: Function.Index, builder: *Builder, flags: FormatFlags) std.fmt.Formatter(FormatData, format) {7871 pub fn fmt(self: Value, function: Function.Index, builder: *Builder, flags: FormatFlags) std.fmt.Alt(FormatData, format) {
7872 return .{ .data = .{ .value = self, .function = function, .builder = builder, .flags = flags } };7872 return .{ .data = .{ .value = self, .function = function, .builder = builder, .flags = flags } };
7873 }7873 }
7874};7874};
...@@ -7902,7 +7902,7 @@ pub const MetadataString = enum(u32) {...@@ -7902,7 +7902,7 @@ pub const MetadataString = enum(u32) {
7902 fn format(data: FormatData, w: *Writer) Writer.Error!void {7902 fn format(data: FormatData, w: *Writer) Writer.Error!void {
7903 try printEscapedString(data.metadata_string.slice(data.builder), .always_quote, w);7903 try printEscapedString(data.metadata_string.slice(data.builder), .always_quote, w);
7904 }7904 }
7905 fn fmt(self: MetadataString, builder: *const Builder) std.fmt.Formatter(FormatData, format) {7905 fn fmt(self: MetadataString, builder: *const Builder) std.fmt.Alt(FormatData, format) {
7906 return .{ .data = .{ .metadata_string = self, .builder = builder } };7906 return .{ .data = .{ .metadata_string = self, .builder = builder } };
7907 }7907 }
7908};7908};
...@@ -8411,7 +8411,7 @@ pub const Metadata = enum(u32) {...@@ -8411,7 +8411,7 @@ pub const Metadata = enum(u32) {
8411 inline fn fmt(formatter: *Formatter, prefix: []const u8, node: anytype, special: ?FormatFlags) switch (@TypeOf(node)) {8411 inline fn fmt(formatter: *Formatter, prefix: []const u8, node: anytype, special: ?FormatFlags) switch (@TypeOf(node)) {
8412 Metadata => Allocator.Error,8412 Metadata => Allocator.Error,
8413 else => error{},8413 else => error{},
8414 }!std.fmt.Formatter(FormatData, format) {8414 }!std.fmt.Alt(FormatData, format) {
8415 const Node = @TypeOf(node);8415 const Node = @TypeOf(node);
8416 const MaybeNode = switch (@typeInfo(Node)) {8416 const MaybeNode = switch (@typeInfo(Node)) {
8417 .optional => Node,8417 .optional => Node,
...@@ -8456,7 +8456,7 @@ pub const Metadata = enum(u32) {...@@ -8456,7 +8456,7 @@ pub const Metadata = enum(u32) {
8456 prefix: []const u8,8456 prefix: []const u8,
8457 value: Value,8457 value: Value,
8458 function: Function.Index,8458 function: Function.Index,
8459 ) Allocator.Error!std.fmt.Formatter(FormatData, format) {8459 ) Allocator.Error!std.fmt.Alt(FormatData, format) {
8460 return .{ .data = .{8460 return .{ .data = .{
8461 .formatter = formatter,8461 .formatter = formatter,
8462 .prefix = prefix,8462 .prefix = prefix,
...@@ -8539,7 +8539,7 @@ pub const Metadata = enum(u32) {...@@ -8539,7 +8539,7 @@ pub const Metadata = enum(u32) {
8539 fmt_str = fmt_str ++ "(";8539 fmt_str = fmt_str ++ "(";
8540 inline for (fields[2..], names) |*field, name| {8540 inline for (fields[2..], names) |*field, name| {
8541 fmt_str = fmt_str ++ "{[" ++ name ++ "]f}";8541 fmt_str = fmt_str ++ "{[" ++ name ++ "]f}";
8542 const T = std.fmt.Formatter(FormatData, format);8542 const T = std.fmt.Alt(FormatData, format);
8543 field.* = .{8543 field.* = .{
8544 .name = name,8544 .name = name,
8545 .type = T,8545 .type = T,
lib/std/zig/string_literal.zig+1-1
...@@ -87,7 +87,7 @@ pub const Error = union(enum) {...@@ -87,7 +87,7 @@ pub const Error = union(enum) {
87 }87 }
88 }88 }
8989
90 pub fn fmt(self: @This(), raw_string: []const u8) std.fmt.Formatter(FormatMessage, formatMessage) {90 pub fn fmt(self: @This(), raw_string: []const u8) std.fmt.Alt(FormatMessage, formatMessage) {
91 return .{ .data = .{91 return .{ .data = .{
92 .err = self,92 .err = self,
93 .raw_string = raw_string,93 .raw_string = raw_string,
src/Compilation.zig+1-1
...@@ -6465,7 +6465,7 @@ fn updateWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, win32...@@ -6465,7 +6465,7 @@ fn updateWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, win32
6465 };6465 };
6466 }6466 }
64676467
6468 pub fn fmtRcEscape(bytes: []const u8) std.fmt.Formatter([]const u8, formatRcEscape) {6468 pub fn fmtRcEscape(bytes: []const u8) std.fmt.Alt([]const u8, formatRcEscape) {
6469 return .{ .data = bytes };6469 return .{ .data = bytes };
6470 }6470 }
6471 }.fmtRcEscape;6471 }.fmtRcEscape;
src/InternPool.zig+2-2
...@@ -1904,11 +1904,11 @@ pub const NullTerminatedString = enum(u32) {...@@ -1904,11 +1904,11 @@ pub const NullTerminatedString = enum(u32) {
1904 }1904 }
1905 }1905 }
19061906
1907 pub fn fmt(string: NullTerminatedString, ip: *const InternPool) std.fmt.Formatter(FormatData, format) {1907 pub fn fmt(string: NullTerminatedString, ip: *const InternPool) std.fmt.Alt(FormatData, format) {
1908 return .{ .data = .{ .string = string, .ip = ip, .id = false } };1908 return .{ .data = .{ .string = string, .ip = ip, .id = false } };
1909 }1909 }
19101910
1911 pub fn fmtId(string: NullTerminatedString, ip: *const InternPool) std.fmt.Formatter(FormatData, format) {1911 pub fn fmtId(string: NullTerminatedString, ip: *const InternPool) std.fmt.Alt(FormatData, format) {
1912 return .{ .data = .{ .string = string, .ip = ip, .id = true } };1912 return .{ .data = .{ .string = string, .ip = ip, .id = true } };
1913 }1913 }
19141914
src/Type.zig+2-2
...@@ -127,7 +127,7 @@ pub fn format(ty: Type, writer: *std.Io.Writer) !void {...@@ -127,7 +127,7 @@ pub fn format(ty: Type, writer: *std.Io.Writer) !void {
127 @compileError("do not format types directly; use either ty.fmtDebug() or ty.fmt()");127 @compileError("do not format types directly; use either ty.fmtDebug() or ty.fmt()");
128}128}
129129
130pub const Formatter = std.fmt.Formatter(Format, Format.default);130pub const Formatter = std.fmt.Alt(Format, Format.default);
131131
132pub fn fmt(ty: Type, pt: Zcu.PerThread) Formatter {132pub fn fmt(ty: Type, pt: Zcu.PerThread) Formatter {
133 return .{ .data = .{133 return .{ .data = .{
...@@ -145,7 +145,7 @@ const Format = struct {...@@ -145,7 +145,7 @@ const Format = struct {
145 }145 }
146};146};
147147
148pub fn fmtDebug(ty: Type) std.fmt.Formatter(Type, dump) {148pub fn fmtDebug(ty: Type) std.fmt.Alt(Type, dump) {
149 return .{ .data = ty };149 return .{ .data = ty };
150}150}
151151
src/Value.zig+4-4
...@@ -27,11 +27,11 @@ pub fn dump(start_val: Value, w: std.Io.Writer) std.Io.Writer.Error!void {...@@ -27,11 +27,11 @@ pub fn dump(start_val: Value, w: std.Io.Writer) std.Io.Writer.Error!void {
27 try w.print("(interned: {})", .{start_val.toIntern()});27 try w.print("(interned: {})", .{start_val.toIntern()});
28}28}
2929
30pub fn fmtDebug(val: Value) std.fmt.Formatter(Value, dump) {30pub fn fmtDebug(val: Value) std.fmt.Alt(Value, dump) {
31 return .{ .data = val };31 return .{ .data = val };
32}32}
3333
34pub fn fmtValue(val: Value, pt: Zcu.PerThread) std.fmt.Formatter(print_value.FormatContext, print_value.format) {34pub fn fmtValue(val: Value, pt: Zcu.PerThread) std.fmt.Alt(print_value.FormatContext, print_value.format) {
35 return .{ .data = .{35 return .{ .data = .{
36 .val = val,36 .val = val,
37 .pt = pt,37 .pt = pt,
...@@ -40,7 +40,7 @@ pub fn fmtValue(val: Value, pt: Zcu.PerThread) std.fmt.Formatter(print_value.For...@@ -40,7 +40,7 @@ pub fn fmtValue(val: Value, pt: Zcu.PerThread) std.fmt.Formatter(print_value.For
40 } };40 } };
41}41}
4242
43pub fn fmtValueSema(val: Value, pt: Zcu.PerThread, sema: *Sema) std.fmt.Formatter(print_value.FormatContext, print_value.formatSema) {43pub fn fmtValueSema(val: Value, pt: Zcu.PerThread, sema: *Sema) std.fmt.Alt(print_value.FormatContext, print_value.formatSema) {
44 return .{ .data = .{44 return .{ .data = .{
45 .val = val,45 .val = val,
46 .pt = pt,46 .pt = pt,
...@@ -49,7 +49,7 @@ pub fn fmtValueSema(val: Value, pt: Zcu.PerThread, sema: *Sema) std.fmt.Formatte...@@ -49,7 +49,7 @@ pub fn fmtValueSema(val: Value, pt: Zcu.PerThread, sema: *Sema) std.fmt.Formatte
49 } };49 } };
50}50}
5151
52pub fn fmtValueSemaFull(ctx: print_value.FormatContext) std.fmt.Formatter(print_value.FormatContext, print_value.formatSema) {52pub fn fmtValueSemaFull(ctx: print_value.FormatContext) std.fmt.Alt(print_value.FormatContext, print_value.formatSema) {
53 return .{ .data = ctx };53 return .{ .data = ctx };
54}54}
5555
src/Zcu.zig+2-2
...@@ -4306,10 +4306,10 @@ pub fn navFileScope(zcu: *Zcu, nav: InternPool.Nav.Index) *File {...@@ -4306,10 +4306,10 @@ pub fn navFileScope(zcu: *Zcu, nav: InternPool.Nav.Index) *File {
4306 return zcu.fileByIndex(zcu.navFileScopeIndex(nav));4306 return zcu.fileByIndex(zcu.navFileScopeIndex(nav));
4307}4307}
43084308
4309pub fn fmtAnalUnit(zcu: *Zcu, unit: AnalUnit) std.fmt.Formatter(FormatAnalUnit, formatAnalUnit) {4309pub fn fmtAnalUnit(zcu: *Zcu, unit: AnalUnit) std.fmt.Alt(FormatAnalUnit, formatAnalUnit) {
4310 return .{ .data = .{ .unit = unit, .zcu = zcu } };4310 return .{ .data = .{ .unit = unit, .zcu = zcu } };
4311}4311}
4312pub fn fmtDependee(zcu: *Zcu, d: InternPool.Dependee) std.fmt.Formatter(FormatDependee, formatDependee) {4312pub fn fmtDependee(zcu: *Zcu, d: InternPool.Dependee) std.fmt.Alt(FormatDependee, formatDependee) {
4313 return .{ .data = .{ .dependee = d, .zcu = zcu } };4313 return .{ .data = .{ .dependee = d, .zcu = zcu } };
4314}4314}
43154315
src/arch/riscv64/CodeGen.zig+4-4
...@@ -972,7 +972,7 @@ fn formatWipMir(data: FormatWipMirData, writer: *std.Io.Writer) std.Io.Writer.Er...@@ -972,7 +972,7 @@ fn formatWipMir(data: FormatWipMirData, writer: *std.Io.Writer) std.Io.Writer.Er
972 first = false;972 first = false;
973 }973 }
974}974}
975fn fmtWipMir(func: *Func, inst: Mir.Inst.Index) std.fmt.Formatter(FormatWipMirData, formatWipMir) {975fn fmtWipMir(func: *Func, inst: Mir.Inst.Index) std.fmt.Alt(FormatWipMirData, formatWipMir) {
976 return .{ .data = .{ .func = func, .inst = inst } };976 return .{ .data = .{ .func = func, .inst = inst } };
977}977}
978978
...@@ -983,7 +983,7 @@ const FormatNavData = struct {...@@ -983,7 +983,7 @@ const FormatNavData = struct {
983fn formatNav(data: FormatNavData, writer: *std.Io.Writer) std.Io.Writer.Error!void {983fn formatNav(data: FormatNavData, writer: *std.Io.Writer) std.Io.Writer.Error!void {
984 try writer.print("{f}", .{data.ip.getNav(data.nav_index).fqn.fmt(data.ip)});984 try writer.print("{f}", .{data.ip.getNav(data.nav_index).fqn.fmt(data.ip)});
985}985}
986fn fmtNav(nav_index: InternPool.Nav.Index, ip: *const InternPool) std.fmt.Formatter(FormatNavData, formatNav) {986fn fmtNav(nav_index: InternPool.Nav.Index, ip: *const InternPool) std.fmt.Alt(FormatNavData, formatNav) {
987 return .{ .data = .{987 return .{ .data = .{
988 .ip = ip,988 .ip = ip,
989 .nav_index = nav_index,989 .nav_index = nav_index,
...@@ -1001,7 +1001,7 @@ fn formatAir(data: FormatAirData, writer: *std.Io.Writer) std.Io.Writer.Error!vo...@@ -1001,7 +1001,7 @@ fn formatAir(data: FormatAirData, writer: *std.Io.Writer) std.Io.Writer.Error!vo
1001 _ = writer;1001 _ = writer;
1002 @panic("unimplemented");1002 @panic("unimplemented");
1003}1003}
1004fn fmtAir(func: *Func, inst: Air.Inst.Index) std.fmt.Formatter(FormatAirData, formatAir) {1004fn fmtAir(func: *Func, inst: Air.Inst.Index) std.fmt.Alt(FormatAirData, formatAir) {
1005 return .{ .data = .{ .func = func, .inst = inst } };1005 return .{ .data = .{ .func = func, .inst = inst } };
1006}1006}
10071007
...@@ -1012,7 +1012,7 @@ fn formatTracking(data: FormatTrackingData, writer: *std.Io.Writer) std.Io.Write...@@ -1012,7 +1012,7 @@ fn formatTracking(data: FormatTrackingData, writer: *std.Io.Writer) std.Io.Write
1012 var it = data.func.inst_tracking.iterator();1012 var it = data.func.inst_tracking.iterator();
1013 while (it.next()) |entry| try writer.print("\n%{d} = {f}", .{ entry.key_ptr.*, entry.value_ptr.* });1013 while (it.next()) |entry| try writer.print("\n%{d} = {f}", .{ entry.key_ptr.*, entry.value_ptr.* });
1014}1014}
1015fn fmtTracking(func: *Func) std.fmt.Formatter(FormatTrackingData, formatTracking) {1015fn fmtTracking(func: *Func) std.fmt.Alt(FormatTrackingData, formatTracking) {
1016 return .{ .data = .{ .func = func } };1016 return .{ .data = .{ .func = func } };
1017}1017}
10181018
src/arch/x86_64/CodeGen.zig+4-4
...@@ -1091,7 +1091,7 @@ const FormatNavData = struct {...@@ -1091,7 +1091,7 @@ const FormatNavData = struct {
1091fn formatNav(data: FormatNavData, w: *Writer) Writer.Error!void {1091fn formatNav(data: FormatNavData, w: *Writer) Writer.Error!void {
1092 try w.print("{f}", .{data.ip.getNav(data.nav_index).fqn.fmt(data.ip)});1092 try w.print("{f}", .{data.ip.getNav(data.nav_index).fqn.fmt(data.ip)});
1093}1093}
1094fn fmtNav(nav_index: InternPool.Nav.Index, ip: *const InternPool) std.fmt.Formatter(FormatNavData, formatNav) {1094fn fmtNav(nav_index: InternPool.Nav.Index, ip: *const InternPool) std.fmt.Alt(FormatNavData, formatNav) {
1095 return .{ .data = .{1095 return .{ .data = .{
1096 .ip = ip,1096 .ip = ip,
1097 .nav_index = nav_index,1097 .nav_index = nav_index,
...@@ -1105,7 +1105,7 @@ const FormatAirData = struct {...@@ -1105,7 +1105,7 @@ const FormatAirData = struct {
1105fn formatAir(data: FormatAirData, w: *Writer) Writer.Error!void {1105fn formatAir(data: FormatAirData, w: *Writer) Writer.Error!void {
1106 data.self.air.writeInst(w, data.inst, data.self.pt, data.self.liveness);1106 data.self.air.writeInst(w, data.inst, data.self.pt, data.self.liveness);
1107}1107}
1108fn fmtAir(self: *CodeGen, inst: Air.Inst.Index) std.fmt.Formatter(FormatAirData, formatAir) {1108fn fmtAir(self: *CodeGen, inst: Air.Inst.Index) std.fmt.Alt(FormatAirData, formatAir) {
1109 return .{ .data = .{ .self = self, .inst = inst } };1109 return .{ .data = .{ .self = self, .inst = inst } };
1110}1110}
11111111
...@@ -1197,7 +1197,7 @@ fn formatWipMir(data: FormatWipMirData, w: *Writer) Writer.Error!void {...@@ -1197,7 +1197,7 @@ fn formatWipMir(data: FormatWipMirData, w: *Writer) Writer.Error!void {
1197 }1197 }
1198 }1198 }
1199}1199}
1200fn fmtWipMir(self: *CodeGen, inst: Mir.Inst.Index) std.fmt.Formatter(FormatWipMirData, formatWipMir) {1200fn fmtWipMir(self: *CodeGen, inst: Mir.Inst.Index) std.fmt.Alt(FormatWipMirData, formatWipMir) {
1201 return .{ .data = .{ .self = self, .inst = inst } };1201 return .{ .data = .{ .self = self, .inst = inst } };
1202}1202}
12031203
...@@ -1208,7 +1208,7 @@ fn formatTracking(data: FormatTrackingData, w: *Writer) Writer.Error!void {...@@ -1208,7 +1208,7 @@ fn formatTracking(data: FormatTrackingData, w: *Writer) Writer.Error!void {
1208 var it = data.self.inst_tracking.iterator();1208 var it = data.self.inst_tracking.iterator();
1209 while (it.next()) |entry| try w.print("\n{f} = {f}", .{ entry.key_ptr.*, entry.value_ptr.* });1209 while (it.next()) |entry| try w.print("\n{f} = {f}", .{ entry.key_ptr.*, entry.value_ptr.* });
1210}1210}
1211fn fmtTracking(self: *CodeGen) std.fmt.Formatter(FormatTrackingData, formatTracking) {1211fn fmtTracking(self: *CodeGen) std.fmt.Alt(FormatTrackingData, formatTracking) {
1212 return .{ .data = .{ .self = self } };1212 return .{ .data = .{ .self = self } };
1213}1213}
12141214
src/arch/x86_64/encoder.zig+1-1
...@@ -301,7 +301,7 @@ pub const Instruction = struct {...@@ -301,7 +301,7 @@ pub const Instruction = struct {
301 }301 }
302 };302 };
303303
304 pub fn fmt(op: Operand, enc_op: Encoding.Op) std.fmt.Formatter(Format, Format.default) {304 pub fn fmt(op: Operand, enc_op: Encoding.Op) std.fmt.Alt(Format, Format.default) {
305 return .{ .data = .{ .op = op, .enc_op = enc_op } };305 return .{ .data = .{ .op = op, .enc_op = enc_op } };
306 }306 }
307 };307 };
src/codegen/c.zig+10-10
...@@ -371,11 +371,11 @@ fn formatIdentOptions(ident: []const u8, w: *Writer, solo: bool) Writer.Error!vo...@@ -371,11 +371,11 @@ fn formatIdentOptions(ident: []const u8, w: *Writer, solo: bool) Writer.Error!vo
371 }371 }
372}372}
373373
374pub fn fmtIdentSolo(ident: []const u8) std.fmt.Formatter([]const u8, formatIdentSolo) {374pub fn fmtIdentSolo(ident: []const u8) std.fmt.Alt([]const u8, formatIdentSolo) {
375 return .{ .data = ident };375 return .{ .data = ident };
376}376}
377377
378pub fn fmtIdentUnsolo(ident: []const u8) std.fmt.Formatter([]const u8, formatIdentUnsolo) {378pub fn fmtIdentUnsolo(ident: []const u8) std.fmt.Alt([]const u8, formatIdentUnsolo) {
379 return .{ .data = ident };379 return .{ .data = ident };
380}380}
381381
...@@ -394,7 +394,7 @@ pub fn fmtCTypePoolString(...@@ -394,7 +394,7 @@ pub fn fmtCTypePoolString(
394 ctype_pool_string: CType.Pool.String,394 ctype_pool_string: CType.Pool.String,
395 ctype_pool: *const CType.Pool,395 ctype_pool: *const CType.Pool,
396 solo: bool,396 solo: bool,
397) std.fmt.Formatter(CTypePoolStringFormatData, formatCTypePoolString) {397) std.fmt.Alt(CTypePoolStringFormatData, formatCTypePoolString) {
398 return .{ .data = .{398 return .{ .data = .{
399 .ctype_pool_string = ctype_pool_string,399 .ctype_pool_string = ctype_pool_string,
400 .ctype_pool = ctype_pool,400 .ctype_pool = ctype_pool,
...@@ -610,11 +610,11 @@ pub const Function = struct {...@@ -610,11 +610,11 @@ pub const Function = struct {
610 return f.object.dg.renderIntCast(w, dest_ty, .{ .c_value = .{ .f = f, .value = src, .v = v } }, src_ty, location);610 return f.object.dg.renderIntCast(w, dest_ty, .{ .c_value = .{ .f = f, .value = src, .v = v } }, src_ty, location);
611 }611 }
612612
613 fn fmtIntLiteralDec(f: *Function, val: Value) !std.fmt.Formatter(FormatIntLiteralContext, formatIntLiteral) {613 fn fmtIntLiteralDec(f: *Function, val: Value) !std.fmt.Alt(FormatIntLiteralContext, formatIntLiteral) {
614 return f.object.dg.fmtIntLiteralDec(val, .Other);614 return f.object.dg.fmtIntLiteralDec(val, .Other);
615 }615 }
616616
617 fn fmtIntLiteralHex(f: *Function, val: Value) !std.fmt.Formatter(FormatIntLiteralContext, formatIntLiteral) {617 fn fmtIntLiteralHex(f: *Function, val: Value) !std.fmt.Alt(FormatIntLiteralContext, formatIntLiteral) {
618 return f.object.dg.fmtIntLiteralHex(val, .Other);618 return f.object.dg.fmtIntLiteralHex(val, .Other);
619 }619 }
620620
...@@ -1919,7 +1919,7 @@ pub const DeclGen = struct {...@@ -1919,7 +1919,7 @@ pub const DeclGen = struct {
1919 kind: CType.Kind,1919 kind: CType.Kind,
1920 name: union(enum) {1920 name: union(enum) {
1921 nav: InternPool.Nav.Index,1921 nav: InternPool.Nav.Index,
1922 fmt_ctype_pool_string: std.fmt.Formatter(CTypePoolStringFormatData, formatCTypePoolString),1922 fmt_ctype_pool_string: std.fmt.Alt(CTypePoolStringFormatData, formatCTypePoolString),
1923 @"export": struct {1923 @"export": struct {
1924 main_name: InternPool.NullTerminatedString,1924 main_name: InternPool.NullTerminatedString,
1925 extern_name: InternPool.NullTerminatedString,1925 extern_name: InternPool.NullTerminatedString,
...@@ -2439,7 +2439,7 @@ pub const DeclGen = struct {...@@ -2439,7 +2439,7 @@ pub const DeclGen = struct {
2439 loc: ValueRenderLocation,2439 loc: ValueRenderLocation,
2440 base: u8,2440 base: u8,
2441 case: std.fmt.Case,2441 case: std.fmt.Case,
2442 ) !std.fmt.Formatter(FormatIntLiteralContext, formatIntLiteral) {2442 ) !std.fmt.Alt(FormatIntLiteralContext, formatIntLiteral) {
2443 const zcu = dg.pt.zcu;2443 const zcu = dg.pt.zcu;
2444 const kind = loc.toCTypeKind();2444 const kind = loc.toCTypeKind();
2445 const ty = val.typeOf(zcu);2445 const ty = val.typeOf(zcu);
...@@ -2461,7 +2461,7 @@ pub const DeclGen = struct {...@@ -2461,7 +2461,7 @@ pub const DeclGen = struct {
2461 dg: *DeclGen,2461 dg: *DeclGen,
2462 val: Value,2462 val: Value,
2463 loc: ValueRenderLocation,2463 loc: ValueRenderLocation,
2464 ) !std.fmt.Formatter(FormatIntLiteralContext, formatIntLiteral) {2464 ) !std.fmt.Alt(FormatIntLiteralContext, formatIntLiteral) {
2465 return fmtIntLiteral(dg, val, loc, 10, .lower);2465 return fmtIntLiteral(dg, val, loc, 10, .lower);
2466 }2466 }
24672467
...@@ -2469,7 +2469,7 @@ pub const DeclGen = struct {...@@ -2469,7 +2469,7 @@ pub const DeclGen = struct {
2469 dg: *DeclGen,2469 dg: *DeclGen,
2470 val: Value,2470 val: Value,
2471 loc: ValueRenderLocation,2471 loc: ValueRenderLocation,
2472 ) !std.fmt.Formatter(FormatIntLiteralContext, formatIntLiteral) {2472 ) !std.fmt.Alt(FormatIntLiteralContext, formatIntLiteral) {
2473 return fmtIntLiteral(dg, val, loc, 16, .lower);2473 return fmtIntLiteral(dg, val, loc, 16, .lower);
2474 }2474 }
2475};2475};
...@@ -8295,7 +8295,7 @@ fn formatStringLiteral(data: FormatStringContext, w: *Writer) Writer.Error!void...@@ -8295,7 +8295,7 @@ fn formatStringLiteral(data: FormatStringContext, w: *Writer) Writer.Error!void
8295 try literal.end();8295 try literal.end();
8296}8296}
82978297
8298fn fmtStringLiteral(str: []const u8, sentinel: ?u8) std.fmt.Formatter(FormatStringContext, formatStringLiteral) {8298fn fmtStringLiteral(str: []const u8, sentinel: ?u8) std.fmt.Alt(FormatStringContext, formatStringLiteral) {
8299 return .{ .data = .{ .str = str, .sentinel = sentinel } };8299 return .{ .data = .{ .str = str, .sentinel = sentinel } };
8300}8300}
83018301
src/codegen/c/Type.zig+1-1
...@@ -989,7 +989,7 @@ pub const Pool = struct {...@@ -989,7 +989,7 @@ pub const Pool = struct {
989 else989 else
990 try writer.print("f{d}", .{@intFromEnum(data.string.index)});990 try writer.print("f{d}", .{@intFromEnum(data.string.index)});
991 }991 }
992 pub fn fmt(str: String, pool: *const Pool) std.fmt.Formatter(FormatData, format) {992 pub fn fmt(str: String, pool: *const Pool) std.fmt.Alt(FormatData, format) {
993 return .{ .data = .{ .string = str, .pool = pool } };993 return .{ .data = .{ .string = str, .pool = pool } };
994 }994 }
995995
src/link/Coff.zig+1-1
...@@ -3053,7 +3053,7 @@ const ImportTable = struct {...@@ -3053,7 +3053,7 @@ const ImportTable = struct {
3053 }3053 }
3054 };3054 };
30553055
3056 fn fmtDebug(itab: ImportTable, ctx: Context) fmt.Formatter(Format, Format.default) {3056 fn fmtDebug(itab: ImportTable, ctx: Context) fmt.Alt(Format, Format.default) {
3057 return .{ .data = .{ .itab = itab, .ctx = ctx } };3057 return .{ .data = .{ .itab = itab, .ctx = ctx } };
3058 }3058 }
30593059
src/link/Elf.zig+4-4
...@@ -3862,7 +3862,7 @@ const FormatShdr = struct {...@@ -3862,7 +3862,7 @@ const FormatShdr = struct {
3862 shdr: elf.Elf64_Shdr,3862 shdr: elf.Elf64_Shdr,
3863};3863};
38643864
3865fn fmtShdr(self: *Elf, shdr: elf.Elf64_Shdr) std.fmt.Formatter(FormatShdr, formatShdr) {3865fn fmtShdr(self: *Elf, shdr: elf.Elf64_Shdr) std.fmt.Alt(FormatShdr, formatShdr) {
3866 return .{ .data = .{3866 return .{ .data = .{
3867 .shdr = shdr,3867 .shdr = shdr,
3868 .elf_file = self,3868 .elf_file = self,
...@@ -3879,7 +3879,7 @@ fn formatShdr(ctx: FormatShdr, writer: *std.Io.Writer) std.Io.Writer.Error!void...@@ -3879,7 +3879,7 @@ fn formatShdr(ctx: FormatShdr, writer: *std.Io.Writer) std.Io.Writer.Error!void
3879 });3879 });
3880}3880}
38813881
3882pub fn fmtShdrFlags(sh_flags: u64) std.fmt.Formatter(u64, formatShdrFlags) {3882pub fn fmtShdrFlags(sh_flags: u64) std.fmt.Alt(u64, formatShdrFlags) {
3883 return .{ .data = sh_flags };3883 return .{ .data = sh_flags };
3884}3884}
38853885
...@@ -3933,7 +3933,7 @@ const FormatPhdr = struct {...@@ -3933,7 +3933,7 @@ const FormatPhdr = struct {
3933 phdr: elf.Elf64_Phdr,3933 phdr: elf.Elf64_Phdr,
3934};3934};
39353935
3936fn fmtPhdr(self: *Elf, phdr: elf.Elf64_Phdr) std.fmt.Formatter(FormatPhdr, formatPhdr) {3936fn fmtPhdr(self: *Elf, phdr: elf.Elf64_Phdr) std.fmt.Alt(FormatPhdr, formatPhdr) {
3937 return .{ .data = .{3937 return .{ .data = .{
3938 .phdr = phdr,3938 .phdr = phdr,
3939 .elf_file = self,3939 .elf_file = self,
...@@ -3967,7 +3967,7 @@ fn formatPhdr(ctx: FormatPhdr, writer: *std.Io.Writer) std.Io.Writer.Error!void...@@ -3967,7 +3967,7 @@ fn formatPhdr(ctx: FormatPhdr, writer: *std.Io.Writer) std.Io.Writer.Error!void
3967 });3967 });
3968}3968}
39693969
3970pub fn dumpState(self: *Elf) std.fmt.Formatter(*Elf, fmtDumpState) {3970pub fn dumpState(self: *Elf) std.fmt.Alt(*Elf, fmtDumpState) {
3971 return .{ .data = self };3971 return .{ .data = self };
3972}3972}
39733973
src/link/Elf/Archive.zig+1-1
...@@ -215,7 +215,7 @@ pub const ArSymtab = struct {...@@ -215,7 +215,7 @@ pub const ArSymtab = struct {
215 }215 }
216 };216 };
217217
218 pub fn fmt(ar: ArSymtab, elf_file: *Elf) std.fmt.Formatter(Format, Format.default) {218 pub fn fmt(ar: ArSymtab, elf_file: *Elf) std.fmt.Alt(Format, Format.default) {
219 return .{ .data = .{219 return .{ .data = .{
220 .ar = ar,220 .ar = ar,
221 .elf_file = elf_file,221 .elf_file = elf_file,
src/link/Elf/Atom.zig+1-1
...@@ -894,7 +894,7 @@ pub fn setExtra(atom: Atom, extras: Extra, elf_file: *Elf) void {...@@ -894,7 +894,7 @@ pub fn setExtra(atom: Atom, extras: Extra, elf_file: *Elf) void {
894 atom.file(elf_file).?.setAtomExtra(atom.extra_index, extras);894 atom.file(elf_file).?.setAtomExtra(atom.extra_index, extras);
895}895}
896896
897pub fn fmt(atom: Atom, elf_file: *Elf) std.fmt.Formatter(Format, Format.default) {897pub fn fmt(atom: Atom, elf_file: *Elf) std.fmt.Alt(Format, Format.default) {
898 return .{ .data = .{898 return .{ .data = .{
899 .atom = atom,899 .atom = atom,
900 .elf_file = elf_file,900 .elf_file = elf_file,
src/link/Elf/AtomList.zig+1-1
...@@ -187,7 +187,7 @@ const Format = struct {...@@ -187,7 +187,7 @@ const Format = struct {
187 }187 }
188};188};
189189
190pub fn fmt(atom_list: AtomList, elf_file: *Elf) std.fmt.Formatter(Format, Format.default) {190pub fn fmt(atom_list: AtomList, elf_file: *Elf) std.fmt.Alt(Format, Format.default) {
191 return .{ .data = .{ .atom_list = atom_list, .elf_file = elf_file } };191 return .{ .data = .{ .atom_list = atom_list, .elf_file = elf_file } };
192}192}
193193
src/link/Elf/LinkerDefined.zig+1-1
...@@ -437,7 +437,7 @@ pub fn setSymbolExtra(self: *LinkerDefined, index: u32, extra: Symbol.Extra) voi...@@ -437,7 +437,7 @@ pub fn setSymbolExtra(self: *LinkerDefined, index: u32, extra: Symbol.Extra) voi
437 }437 }
438}438}
439439
440pub fn fmtSymtab(self: *LinkerDefined, elf_file: *Elf) std.fmt.Formatter(Format, Format.symtab) {440pub fn fmtSymtab(self: *LinkerDefined, elf_file: *Elf) std.fmt.Alt(Format, Format.symtab) {
441 return .{ .data = .{441 return .{ .data = .{
442 .self = self,442 .self = self,
443 .elf_file = elf_file,443 .elf_file = elf_file,
src/link/Elf/Merge.zig+2-2
...@@ -157,7 +157,7 @@ pub const Section = struct {...@@ -157,7 +157,7 @@ pub const Section = struct {
157 }157 }
158 };158 };
159159
160 pub fn fmt(msec: Section, elf_file: *Elf) std.fmt.Formatter(Format, Format.default) {160 pub fn fmt(msec: Section, elf_file: *Elf) std.fmt.Alt(Format, Format.default) {
161 return .{ .data = .{161 return .{ .data = .{
162 .msec = msec,162 .msec = msec,
163 .elf_file = elf_file,163 .elf_file = elf_file,
...@@ -211,7 +211,7 @@ pub const Subsection = struct {...@@ -211,7 +211,7 @@ pub const Subsection = struct {
211 return msec.bytes.items[msub.string_index..][0..msub.size];211 return msec.bytes.items[msub.string_index..][0..msub.size];
212 }212 }
213213
214 pub fn fmt(msub: Subsection, elf_file: *Elf) std.fmt.Formatter(Format, Format.default) {214 pub fn fmt(msub: Subsection, elf_file: *Elf) std.fmt.Alt(Format, Format.default) {
215 return .{ .data = .{215 return .{ .data = .{
216 .msub = msub,216 .msub = msub,
217 .elf_file = elf_file,217 .elf_file = elf_file,
src/link/Elf/Object.zig+6-6
...@@ -1431,7 +1431,7 @@ pub fn group(self: *Object, index: Elf.Group.Index) *Elf.Group {...@@ -1431,7 +1431,7 @@ pub fn group(self: *Object, index: Elf.Group.Index) *Elf.Group {
1431 return &self.groups.items[index];1431 return &self.groups.items[index];
1432}1432}
14331433
1434pub fn fmtSymtab(self: *Object, elf_file: *Elf) std.fmt.Formatter(Format, Format.symtab) {1434pub fn fmtSymtab(self: *Object, elf_file: *Elf) std.fmt.Alt(Format, Format.symtab) {
1435 return .{ .data = .{1435 return .{ .data = .{
1436 .object = self,1436 .object = self,
1437 .elf_file = elf_file,1437 .elf_file = elf_file,
...@@ -1504,35 +1504,35 @@ const Format = struct {...@@ -1504,35 +1504,35 @@ const Format = struct {
1504 }1504 }
1505};1505};
15061506
1507pub fn fmtAtoms(self: *Object, elf_file: *Elf) std.fmt.Formatter(Format, Format.atoms) {1507pub fn fmtAtoms(self: *Object, elf_file: *Elf) std.fmt.Alt(Format, Format.atoms) {
1508 return .{ .data = .{1508 return .{ .data = .{
1509 .object = self,1509 .object = self,
1510 .elf_file = elf_file,1510 .elf_file = elf_file,
1511 } };1511 } };
1512}1512}
15131513
1514pub fn fmtCies(self: *Object, elf_file: *Elf) std.fmt.Formatter(Format, Format.cies) {1514pub fn fmtCies(self: *Object, elf_file: *Elf) std.fmt.Alt(Format, Format.cies) {
1515 return .{ .data = .{1515 return .{ .data = .{
1516 .object = self,1516 .object = self,
1517 .elf_file = elf_file,1517 .elf_file = elf_file,
1518 } };1518 } };
1519}1519}
15201520
1521pub fn fmtFdes(self: *Object, elf_file: *Elf) std.fmt.Formatter(Format, Format.fdes) {1521pub fn fmtFdes(self: *Object, elf_file: *Elf) std.fmt.Alt(Format, Format.fdes) {
1522 return .{ .data = .{1522 return .{ .data = .{
1523 .object = self,1523 .object = self,
1524 .elf_file = elf_file,1524 .elf_file = elf_file,
1525 } };1525 } };
1526}1526}
15271527
1528pub fn fmtGroups(self: *Object, elf_file: *Elf) std.fmt.Formatter(Format, Format.groups) {1528pub fn fmtGroups(self: *Object, elf_file: *Elf) std.fmt.Alt(Format, Format.groups) {
1529 return .{ .data = .{1529 return .{ .data = .{
1530 .object = self,1530 .object = self,
1531 .elf_file = elf_file,1531 .elf_file = elf_file,
1532 } };1532 } };
1533}1533}
15341534
1535pub fn fmtPath(self: Object) std.fmt.Formatter(Object, formatPath) {1535pub fn fmtPath(self: Object) std.fmt.Alt(Object, formatPath) {
1536 return .{ .data = self };1536 return .{ .data = self };
1537}1537}
15381538
src/link/Elf/SharedObject.zig+1-1
...@@ -509,7 +509,7 @@ pub fn setSymbolExtra(self: *SharedObject, index: u32, extra: Symbol.Extra) void...@@ -509,7 +509,7 @@ pub fn setSymbolExtra(self: *SharedObject, index: u32, extra: Symbol.Extra) void
509 }509 }
510}510}
511511
512pub fn fmtSymtab(self: SharedObject, elf_file: *Elf) std.fmt.Formatter(Format, Format.symtab) {512pub fn fmtSymtab(self: SharedObject, elf_file: *Elf) std.fmt.Alt(Format, Format.symtab) {
513 return .{ .data = .{513 return .{ .data = .{
514 .shared = self,514 .shared = self,
515 .elf_file = elf_file,515 .elf_file = elf_file,
src/link/Elf/Symbol.zig+2-2
...@@ -368,14 +368,14 @@ const Format = struct {...@@ -368,14 +368,14 @@ const Format = struct {
368 }368 }
369};369};
370370
371pub fn fmtName(symbol: Symbol, elf_file: *Elf) std.fmt.Formatter(Format, Format.name) {371pub fn fmtName(symbol: Symbol, elf_file: *Elf) std.fmt.Alt(Format, Format.name) {
372 return .{ .data = .{372 return .{ .data = .{
373 .symbol = symbol,373 .symbol = symbol,
374 .elf_file = elf_file,374 .elf_file = elf_file,
375 } };375 } };
376}376}
377377
378pub fn fmt(symbol: Symbol, elf_file: *Elf) std.fmt.Formatter(Format, Format.default) {378pub fn fmt(symbol: Symbol, elf_file: *Elf) std.fmt.Alt(Format, Format.default) {
379 return .{ .data = .{379 return .{ .data = .{
380 .symbol = symbol,380 .symbol = symbol,
381 .elf_file = elf_file,381 .elf_file = elf_file,
src/link/Elf/Thunk.zig+1-1
...@@ -65,7 +65,7 @@ fn trampolineSize(cpu_arch: std.Target.Cpu.Arch) usize {...@@ -65,7 +65,7 @@ fn trampolineSize(cpu_arch: std.Target.Cpu.Arch) usize {
65 };65 };
66}66}
6767
68pub fn fmt(thunk: Thunk, elf_file: *Elf) std.fmt.Formatter(Format, Format.default) {68pub fn fmt(thunk: Thunk, elf_file: *Elf) std.fmt.Alt(Format, Format.default) {
69 return .{ .data = .{69 return .{ .data = .{
70 .thunk = thunk,70 .thunk = thunk,
71 .elf_file = elf_file,71 .elf_file = elf_file,
src/link/Elf/ZigObject.zig+2-2
...@@ -2225,14 +2225,14 @@ const Format = struct {...@@ -2225,14 +2225,14 @@ const Format = struct {
2225 }2225 }
2226};2226};
22272227
2228pub fn fmtSymtab(self: *ZigObject, elf_file: *Elf) std.fmt.Formatter(Format, Format.symtab) {2228pub fn fmtSymtab(self: *ZigObject, elf_file: *Elf) std.fmt.Alt(Format, Format.symtab) {
2229 return .{ .data = .{2229 return .{ .data = .{
2230 .self = self,2230 .self = self,
2231 .elf_file = elf_file,2231 .elf_file = elf_file,
2232 } };2232 } };
2233}2233}
22342234
2235pub fn fmtAtoms(self: *ZigObject, elf_file: *Elf) std.fmt.Formatter(Format, Format.atoms) {2235pub fn fmtAtoms(self: *ZigObject, elf_file: *Elf) std.fmt.Alt(Format, Format.atoms) {
2236 return .{ .data = .{2236 return .{ .data = .{
2237 .self = self,2237 .self = self,
2238 .elf_file = elf_file,2238 .elf_file = elf_file,
src/link/Elf/eh_frame.zig+2-2
...@@ -47,7 +47,7 @@ pub const Fde = struct {...@@ -47,7 +47,7 @@ pub const Fde = struct {
47 return object.relocs.items[fde.rel_index..][0..fde.rel_num];47 return object.relocs.items[fde.rel_index..][0..fde.rel_num];
48 }48 }
4949
50 pub fn fmt(fde: Fde, elf_file: *Elf) std.fmt.Formatter(Format, Format.default) {50 pub fn fmt(fde: Fde, elf_file: *Elf) std.fmt.Alt(Format, Format.default) {
51 return .{ .data = .{51 return .{ .data = .{
52 .fde = fde,52 .fde = fde,
53 .elf_file = elf_file,53 .elf_file = elf_file,
...@@ -130,7 +130,7 @@ pub const Cie = struct {...@@ -130,7 +130,7 @@ pub const Cie = struct {
130 return true;130 return true;
131 }131 }
132132
133 pub fn fmt(cie: Cie, elf_file: *Elf) std.fmt.Formatter(Format, Format.default) {133 pub fn fmt(cie: Cie, elf_file: *Elf) std.fmt.Alt(Format, Format.default) {
134 return .{ .data = .{134 return .{ .data = .{
135 .cie = cie,135 .cie = cie,
136 .elf_file = elf_file,136 .elf_file = elf_file,
src/link/Elf/file.zig+1-1
...@@ -10,7 +10,7 @@ pub const File = union(enum) {...@@ -10,7 +10,7 @@ pub const File = union(enum) {
10 };10 };
11 }11 }
1212
13 pub fn fmtPath(file: File) std.fmt.Formatter(File, formatPath) {13 pub fn fmtPath(file: File) std.fmt.Alt(File, formatPath) {
14 return .{ .data = file };14 return .{ .data = file };
15 }15 }
1616
src/link/Elf/relocation.zig+1-1
...@@ -153,7 +153,7 @@ const FormatRelocTypeCtx = struct {...@@ -153,7 +153,7 @@ const FormatRelocTypeCtx = struct {
153 cpu_arch: std.Target.Cpu.Arch,153 cpu_arch: std.Target.Cpu.Arch,
154};154};
155155
156pub fn fmtRelocType(r_type: u32, cpu_arch: std.Target.Cpu.Arch) std.fmt.Formatter(FormatRelocTypeCtx, formatRelocType) {156pub fn fmtRelocType(r_type: u32, cpu_arch: std.Target.Cpu.Arch) std.fmt.Alt(FormatRelocTypeCtx, formatRelocType) {
157 return .{ .data = .{157 return .{ .data = .{
158 .r_type = r_type,158 .r_type = r_type,
159 .cpu_arch = cpu_arch,159 .cpu_arch = cpu_arch,
src/link/Elf/synthetic_sections.zig+2-2
...@@ -622,7 +622,7 @@ pub const GotSection = struct {...@@ -622,7 +622,7 @@ pub const GotSection = struct {
622 }622 }
623 };623 };
624624
625 pub fn fmt(got: GotSection, elf_file: *Elf) std.fmt.Formatter(Format, Format.default) {625 pub fn fmt(got: GotSection, elf_file: *Elf) std.fmt.Alt(Format, Format.default) {
626 return .{ .data = .{ .got = got, .elf_file = elf_file } };626 return .{ .data = .{ .got = got, .elf_file = elf_file } };
627 }627 }
628};628};
...@@ -758,7 +758,7 @@ pub const PltSection = struct {...@@ -758,7 +758,7 @@ pub const PltSection = struct {
758 }758 }
759 };759 };
760760
761 pub fn fmt(plt: PltSection, elf_file: *Elf) std.fmt.Formatter(Format, Format.default) {761 pub fn fmt(plt: PltSection, elf_file: *Elf) std.fmt.Alt(Format, Format.default) {
762 return .{ .data = .{ .plt = plt, .elf_file = elf_file } };762 return .{ .data = .{ .plt = plt, .elf_file = elf_file } };
763 }763 }
764764
src/link/MachO.zig+5-5
...@@ -3906,7 +3906,7 @@ pub fn ptraceDetach(self: *MachO, pid: std.posix.pid_t) !void {...@@ -3906,7 +3906,7 @@ pub fn ptraceDetach(self: *MachO, pid: std.posix.pid_t) !void {
3906 self.hot_state.mach_task = null;3906 self.hot_state.mach_task = null;
3907}3907}
39083908
3909pub fn dumpState(self: *MachO) std.fmt.Formatter(*MachO, fmtDumpState) {3909pub fn dumpState(self: *MachO) std.fmt.Alt(*MachO, fmtDumpState) {
3910 return .{ .data = self };3910 return .{ .data = self };
3911}3911}
39123912
...@@ -3964,7 +3964,7 @@ fn fmtDumpState(self: *MachO, w: *Writer) Writer.Error!void {...@@ -3964,7 +3964,7 @@ fn fmtDumpState(self: *MachO, w: *Writer) Writer.Error!void {
3964 try w.print("segments\n{f}\n", .{self.fmtSegments()});3964 try w.print("segments\n{f}\n", .{self.fmtSegments()});
3965}3965}
39663966
3967fn fmtSections(self: *MachO) std.fmt.Formatter(*MachO, formatSections) {3967fn fmtSections(self: *MachO) std.fmt.Alt(*MachO, formatSections) {
3968 return .{ .data = self };3968 return .{ .data = self };
3969}3969}
39703970
...@@ -3981,7 +3981,7 @@ fn formatSections(self: *MachO, w: *Writer) Writer.Error!void {...@@ -3981,7 +3981,7 @@ fn formatSections(self: *MachO, w: *Writer) Writer.Error!void {
3981 }3981 }
3982}3982}
39833983
3984fn fmtSegments(self: *MachO) std.fmt.Formatter(*MachO, formatSegments) {3984fn fmtSegments(self: *MachO) std.fmt.Alt(*MachO, formatSegments) {
3985 return .{ .data = self };3985 return .{ .data = self };
3986}3986}
39873987
...@@ -3994,7 +3994,7 @@ fn formatSegments(self: *MachO, w: *Writer) Writer.Error!void {...@@ -3994,7 +3994,7 @@ fn formatSegments(self: *MachO, w: *Writer) Writer.Error!void {
3994 }3994 }
3995}3995}
39963996
3997pub fn fmtSectType(tt: u8) std.fmt.Formatter(u8, formatSectType) {3997pub fn fmtSectType(tt: u8) std.fmt.Alt(u8, formatSectType) {
3998 return .{ .data = tt };3998 return .{ .data = tt };
3999}3999}
40004000
...@@ -4257,7 +4257,7 @@ pub const Platform = struct {...@@ -4257,7 +4257,7 @@ pub const Platform = struct {
4257 return false;4257 return false;
4258 }4258 }
42594259
4260 pub fn fmtTarget(plat: Platform, cpu_arch: std.Target.Cpu.Arch) std.fmt.Formatter(Format, Format.target) {4260 pub fn fmtTarget(plat: Platform, cpu_arch: std.Target.Cpu.Arch) std.fmt.Alt(Format, Format.target) {
4261 return .{ .data = .{ .platform = plat, .cpu_arch = cpu_arch } };4261 return .{ .data = .{ .platform = plat, .cpu_arch = cpu_arch } };
4262 }4262 }
42634263
src/link/MachO/Archive.zig+1-1
...@@ -225,7 +225,7 @@ pub const ArSymtab = struct {...@@ -225,7 +225,7 @@ pub const ArSymtab = struct {
225 }225 }
226 };226 };
227227
228 pub fn fmt(ar: ArSymtab, macho_file: *MachO) std.fmt.Formatter(PrintFormat, PrintFormat.default) {228 pub fn fmt(ar: ArSymtab, macho_file: *MachO) std.fmt.Alt(PrintFormat, PrintFormat.default) {
229 return .{ .data = .{ .ar = ar, .macho_file = macho_file } };229 return .{ .data = .{ .ar = ar, .macho_file = macho_file } };
230 }230 }
231231
src/link/MachO/Atom.zig+1-1
...@@ -1073,7 +1073,7 @@ pub fn writeRelocs(self: Atom, macho_file: *MachO, code: []u8, buffer: []macho.r...@@ -1073,7 +1073,7 @@ pub fn writeRelocs(self: Atom, macho_file: *MachO, code: []u8, buffer: []macho.r
1073 assert(i == buffer.len);1073 assert(i == buffer.len);
1074}1074}
10751075
1076pub fn fmt(atom: Atom, macho_file: *MachO) std.fmt.Formatter(Format, Format.print) {1076pub fn fmt(atom: Atom, macho_file: *MachO) std.fmt.Alt(Format, Format.print) {
1077 return .{ .data = .{1077 return .{ .data = .{
1078 .atom = atom,1078 .atom = atom,
1079 .macho_file = macho_file,1079 .macho_file = macho_file,
src/link/MachO/Dylib.zig+1-1
...@@ -667,7 +667,7 @@ pub fn setSymbolExtra(self: *Dylib, index: u32, extra: Symbol.Extra) void {...@@ -667,7 +667,7 @@ pub fn setSymbolExtra(self: *Dylib, index: u32, extra: Symbol.Extra) void {
667 }667 }
668}668}
669669
670pub fn fmtSymtab(self: *Dylib, macho_file: *MachO) std.fmt.Formatter(Format, Format.symtab) {670pub fn fmtSymtab(self: *Dylib, macho_file: *MachO) std.fmt.Alt(Format, Format.symtab) {
671 return .{ .data = .{671 return .{ .data = .{
672 .dylib = self,672 .dylib = self,
673 .macho_file = macho_file,673 .macho_file = macho_file,
src/link/MachO/InternalObject.zig+2-2
...@@ -864,14 +864,14 @@ const Format = struct {...@@ -864,14 +864,14 @@ const Format = struct {
864 }864 }
865};865};
866866
867pub fn fmtAtoms(self: *InternalObject, macho_file: *MachO) std.fmt.Formatter(Format, Format.atoms) {867pub fn fmtAtoms(self: *InternalObject, macho_file: *MachO) std.fmt.Alt(Format, Format.atoms) {
868 return .{ .data = .{868 return .{ .data = .{
869 .self = self,869 .self = self,
870 .macho_file = macho_file,870 .macho_file = macho_file,
871 } };871 } };
872}872}
873873
874pub fn fmtSymtab(self: *InternalObject, macho_file: *MachO) std.fmt.Formatter(Format, Format.symtab) {874pub fn fmtSymtab(self: *InternalObject, macho_file: *MachO) std.fmt.Alt(Format, Format.symtab) {
875 return .{ .data = .{875 return .{ .data = .{
876 .self = self,876 .self = self,
877 .macho_file = macho_file,877 .macho_file = macho_file,
src/link/MachO/Object.zig+7-7
...@@ -2578,42 +2578,42 @@ const Format = struct {...@@ -2578,42 +2578,42 @@ const Format = struct {
2578 }2578 }
2579};2579};
25802580
2581pub fn fmtAtoms(self: *Object, macho_file: *MachO) std.fmt.Formatter(Format, Format.atoms) {2581pub fn fmtAtoms(self: *Object, macho_file: *MachO) std.fmt.Alt(Format, Format.atoms) {
2582 return .{ .data = .{2582 return .{ .data = .{
2583 .object = self,2583 .object = self,
2584 .macho_file = macho_file,2584 .macho_file = macho_file,
2585 } };2585 } };
2586}2586}
25872587
2588pub fn fmtCies(self: *Object, macho_file: *MachO) std.fmt.Formatter(Format, Format.cies) {2588pub fn fmtCies(self: *Object, macho_file: *MachO) std.fmt.Alt(Format, Format.cies) {
2589 return .{ .data = .{2589 return .{ .data = .{
2590 .object = self,2590 .object = self,
2591 .macho_file = macho_file,2591 .macho_file = macho_file,
2592 } };2592 } };
2593}2593}
25942594
2595pub fn fmtFdes(self: *Object, macho_file: *MachO) std.fmt.Formatter(Format, Format.fdes) {2595pub fn fmtFdes(self: *Object, macho_file: *MachO) std.fmt.Alt(Format, Format.fdes) {
2596 return .{ .data = .{2596 return .{ .data = .{
2597 .object = self,2597 .object = self,
2598 .macho_file = macho_file,2598 .macho_file = macho_file,
2599 } };2599 } };
2600}2600}
26012601
2602pub fn fmtUnwindRecords(self: *Object, macho_file: *MachO) std.fmt.Formatter(Format, Format.unwindRecords) {2602pub fn fmtUnwindRecords(self: *Object, macho_file: *MachO) std.fmt.Alt(Format, Format.unwindRecords) {
2603 return .{ .data = .{2603 return .{ .data = .{
2604 .object = self,2604 .object = self,
2605 .macho_file = macho_file,2605 .macho_file = macho_file,
2606 } };2606 } };
2607}2607}
26082608
2609pub fn fmtSymtab(self: *Object, macho_file: *MachO) std.fmt.Formatter(Format, Format.symtab) {2609pub fn fmtSymtab(self: *Object, macho_file: *MachO) std.fmt.Alt(Format, Format.symtab) {
2610 return .{ .data = .{2610 return .{ .data = .{
2611 .object = self,2611 .object = self,
2612 .macho_file = macho_file,2612 .macho_file = macho_file,
2613 } };2613 } };
2614}2614}
26152615
2616pub fn fmtPath(self: Object) std.fmt.Formatter(Object, formatPath) {2616pub fn fmtPath(self: Object) std.fmt.Alt(Object, formatPath) {
2617 return .{ .data = self };2617 return .{ .data = self };
2618}2618}
26192619
...@@ -2694,7 +2694,7 @@ const StabFile = struct {...@@ -2694,7 +2694,7 @@ const StabFile = struct {
2694 }2694 }
2695 };2695 };
26962696
2697 pub fn fmt(stab: Stab, object: Object) std.fmt.Formatter(Stab.Format, Stab.Format.default) {2697 pub fn fmt(stab: Stab, object: Object) std.fmt.Alt(Stab.Format, Stab.Format.default) {
2698 return .{ .data = .{ .stab = stab, .object = object } };2698 return .{ .data = .{ .stab = stab, .object = object } };
2699 }2699 }
2700 };2700 };
src/link/MachO/Relocation.zig+1-1
...@@ -70,7 +70,7 @@ pub fn lessThan(ctx: void, lhs: Relocation, rhs: Relocation) bool {...@@ -70,7 +70,7 @@ pub fn lessThan(ctx: void, lhs: Relocation, rhs: Relocation) bool {
70 return lhs.offset < rhs.offset;70 return lhs.offset < rhs.offset;
71}71}
7272
73pub fn fmtPretty(rel: Relocation, cpu_arch: std.Target.Cpu.Arch) std.fmt.Formatter(Format, Format.pretty) {73pub fn fmtPretty(rel: Relocation, cpu_arch: std.Target.Cpu.Arch) std.fmt.Alt(Format, Format.pretty) {
74 return .{ .data = .{ .relocation = rel, .arch = cpu_arch } };74 return .{ .data = .{ .relocation = rel, .arch = cpu_arch } };
75}75}
7676
src/link/MachO/Symbol.zig+1-1
...@@ -286,7 +286,7 @@ pub fn setOutputSym(symbol: Symbol, macho_file: *MachO, out: *macho.nlist_64) vo...@@ -286,7 +286,7 @@ pub fn setOutputSym(symbol: Symbol, macho_file: *MachO, out: *macho.nlist_64) vo
286 }286 }
287}287}
288288
289pub fn fmt(symbol: Symbol, macho_file: *MachO) std.fmt.Formatter(Format, Format.default) {289pub fn fmt(symbol: Symbol, macho_file: *MachO) std.fmt.Alt(Format, Format.default) {
290 return .{ .data = .{290 return .{ .data = .{
291 .symbol = symbol,291 .symbol = symbol,
292 .macho_file = macho_file,292 .macho_file = macho_file,
src/link/MachO/Thunk.zig+1-1
...@@ -63,7 +63,7 @@ pub fn writeSymtab(thunk: Thunk, macho_file: *MachO, ctx: anytype) void {...@@ -63,7 +63,7 @@ pub fn writeSymtab(thunk: Thunk, macho_file: *MachO, ctx: anytype) void {
63 }63 }
64}64}
6565
66pub fn fmt(thunk: Thunk, macho_file: *MachO) std.fmt.Formatter(Format, Format.default) {66pub fn fmt(thunk: Thunk, macho_file: *MachO) std.fmt.Alt(Format, Format.default) {
67 return .{ .data = .{67 return .{ .data = .{
68 .thunk = thunk,68 .thunk = thunk,
69 .macho_file = macho_file,69 .macho_file = macho_file,
src/link/MachO/UnwindInfo.zig+2-2
...@@ -509,7 +509,7 @@ pub const Record = struct {...@@ -509,7 +509,7 @@ pub const Record = struct {
509 return lsda.getAddress(macho_file) + rec.lsda_offset;509 return lsda.getAddress(macho_file) + rec.lsda_offset;
510 }510 }
511511
512 pub fn fmt(rec: Record, macho_file: *MachO) std.fmt.Formatter(Format, Format.default) {512 pub fn fmt(rec: Record, macho_file: *MachO) std.fmt.Alt(Format, Format.default) {
513 return .{ .data = .{513 return .{ .data = .{
514 .rec = rec,514 .rec = rec,
515 .macho_file = macho_file,515 .macho_file = macho_file,
...@@ -603,7 +603,7 @@ const Page = struct {...@@ -603,7 +603,7 @@ const Page = struct {
603 }603 }
604 };604 };
605605
606 fn fmt(page: Page, info: UnwindInfo) std.fmt.Formatter(Format, Format.default) {606 fn fmt(page: Page, info: UnwindInfo) std.fmt.Alt(Format, Format.default) {
607 return .{ .data = .{607 return .{ .data = .{
608 .page = page,608 .page = page,
609 .info = info,609 .info = info,
src/link/MachO/ZigObject.zig+2-2
...@@ -1680,7 +1680,7 @@ pub fn asFile(self: *ZigObject) File {...@@ -1680,7 +1680,7 @@ pub fn asFile(self: *ZigObject) File {
1680 return .{ .zig_object = self };1680 return .{ .zig_object = self };
1681}1681}
16821682
1683pub fn fmtSymtab(self: *ZigObject, macho_file: *MachO) std.fmt.Formatter(Format, Format.symtab) {1683pub fn fmtSymtab(self: *ZigObject, macho_file: *MachO) std.fmt.Alt(Format, Format.symtab) {
1684 return .{ .data = .{1684 return .{ .data = .{
1685 .self = self,1685 .self = self,
1686 .macho_file = macho_file,1686 .macho_file = macho_file,
...@@ -1717,7 +1717,7 @@ const Format = struct {...@@ -1717,7 +1717,7 @@ const Format = struct {
1717 }1717 }
1718};1718};
17191719
1720pub fn fmtAtoms(self: *ZigObject, macho_file: *MachO) std.fmt.Formatter(Format, Format.atoms) {1720pub fn fmtAtoms(self: *ZigObject, macho_file: *MachO) std.fmt.Alt(Format, Format.atoms) {
1721 return .{ .data = .{1721 return .{ .data = .{
1722 .self = self,1722 .self = self,
1723 .macho_file = macho_file,1723 .macho_file = macho_file,
src/link/MachO/eh_frame.zig+2-2
...@@ -79,7 +79,7 @@ pub const Cie = struct {...@@ -79,7 +79,7 @@ pub const Cie = struct {
79 return true;79 return true;
80 }80 }
8181
82 pub fn fmt(cie: Cie, macho_file: *MachO) std.fmt.Formatter(Format, Format.default) {82 pub fn fmt(cie: Cie, macho_file: *MachO) std.fmt.Alt(Format, Format.default) {
83 return .{ .data = .{83 return .{ .data = .{
84 .cie = cie,84 .cie = cie,
85 .macho_file = macho_file,85 .macho_file = macho_file,
...@@ -208,7 +208,7 @@ pub const Fde = struct {...@@ -208,7 +208,7 @@ pub const Fde = struct {
208 return fde.getObject(macho_file).getAtom(fde.lsda);208 return fde.getObject(macho_file).getAtom(fde.lsda);
209 }209 }
210210
211 pub fn fmt(fde: Fde, macho_file: *MachO) std.fmt.Formatter(Format, Format.default) {211 pub fn fmt(fde: Fde, macho_file: *MachO) std.fmt.Alt(Format, Format.default) {
212 return .{ .data = .{212 return .{ .data = .{
213 .fde = fde,213 .fde = fde,
214 .macho_file = macho_file,214 .macho_file = macho_file,
src/link/MachO/file.zig+1-1
...@@ -10,7 +10,7 @@ pub const File = union(enum) {...@@ -10,7 +10,7 @@ pub const File = union(enum) {
10 };10 };
11 }11 }
1212
13 pub fn fmtPath(file: File) std.fmt.Formatter(File, formatPath) {13 pub fn fmtPath(file: File) std.fmt.Alt(File, formatPath) {
14 return .{ .data = file };14 return .{ .data = file };
15 }15 }
1616
src/link/MachO/synthetic.zig+4-4
...@@ -55,7 +55,7 @@ pub const GotSection = struct {...@@ -55,7 +55,7 @@ pub const GotSection = struct {
55 }55 }
56 };56 };
5757
58 pub fn fmt(got: GotSection, macho_file: *MachO) std.fmt.Formatter(Format, Format.print) {58 pub fn fmt(got: GotSection, macho_file: *MachO) std.fmt.Alt(Format, Format.print) {
59 return .{ .data = .{ .got = got, .macho_file = macho_file } };59 return .{ .data = .{ .got = got, .macho_file = macho_file } };
60 }60 }
61};61};
...@@ -120,7 +120,7 @@ pub const StubsSection = struct {...@@ -120,7 +120,7 @@ pub const StubsSection = struct {
120 }120 }
121 }121 }
122122
123 pub fn fmt(stubs: StubsSection, macho_file: *MachO) std.fmt.Formatter(Format, Format.print) {123 pub fn fmt(stubs: StubsSection, macho_file: *MachO) std.fmt.Alt(Format, Format.print) {
124 return .{ .data = .{ .stubs = stubs, .macho_file = macho_file } };124 return .{ .data = .{ .stubs = stubs, .macho_file = macho_file } };
125 }125 }
126126
...@@ -337,7 +337,7 @@ pub const TlvPtrSection = struct {...@@ -337,7 +337,7 @@ pub const TlvPtrSection = struct {
337 }337 }
338 }338 }
339339
340 pub fn fmt(tlv: TlvPtrSection, macho_file: *MachO) std.fmt.Formatter(Format, Format.print) {340 pub fn fmt(tlv: TlvPtrSection, macho_file: *MachO) std.fmt.Alt(Format, Format.print) {
341 return .{ .data = .{ .tlv = tlv, .macho_file = macho_file } };341 return .{ .data = .{ .tlv = tlv, .macho_file = macho_file } };
342 }342 }
343343
...@@ -452,7 +452,7 @@ pub const ObjcStubsSection = struct {...@@ -452,7 +452,7 @@ pub const ObjcStubsSection = struct {
452 }452 }
453 }453 }
454454
455 pub fn fmt(objc: ObjcStubsSection, macho_file: *MachO) std.fmt.Formatter(Format, Format.print) {455 pub fn fmt(objc: ObjcStubsSection, macho_file: *MachO) std.fmt.Alt(Format, Format.print) {
456 return .{ .data = .{ .objc = objc, .macho_file = macho_file } };456 return .{ .data = .{ .objc = objc, .macho_file = macho_file } };
457 }457 }
458458