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 {
470470 }
471471 }.f;
472472 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 },
474474 });
475475 },
476476 .none, .offset => m.write(prop.msg),
lib/compiler/resinator/errors.zig+1-1
......@@ -433,7 +433,7 @@ pub const ErrorDetails = struct {
433433 code_page: SupportedCodePage,
434434 };
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) {
437437 return .{ .data = .{
438438 .token = self.token,
439439 .code_page = self.code_page,
lib/compiler/resinator/res.zig+1-1
......@@ -465,7 +465,7 @@ pub const NameOrOrdinal = union(enum) {
465465 }
466466 }
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) {
469469 return .{ .data = type_value };
470470 }
471471};
lib/docs/wasm/markdown/renderer.zig+1-1
......@@ -231,7 +231,7 @@ pub fn renderInlineNodeText(
231231 }
232232}
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) {
235235 return .{ .data = bytes };
236236}
237237
lib/std/Build/Cache/Path.zig+2-2
......@@ -147,7 +147,7 @@ pub fn toStringZ(p: Path, allocator: Allocator) Allocator.Error![:0]u8 {
147147 return std.fmt.allocPrintSentinel(allocator, "{f}", .{p}, 0);
148148}
149149
150pub fn fmtEscapeString(path: Path) std.fmt.Formatter(Path, formatEscapeString) {
150pub fn fmtEscapeString(path: Path) std.fmt.Alt(Path, formatEscapeString) {
151151 return .{ .data = path };
152152}
153153
......@@ -162,7 +162,7 @@ pub fn formatEscapeString(path: Path, writer: *std.Io.Writer) std.Io.Writer.Erro
162162}
163163
164164/// 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) {
166166 return .{ .data = path };
167167}
168168
lib/std/Build/Step/CheckObject.zig+3-3
......@@ -595,7 +595,7 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void {
595595 // we either format message string with escaped codes, or not to aid debugging
596596 // the failed test.
597597 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) {
599599 return .{ .data = .{
600600 .kind = kind,
601601 .msg = msg,
......@@ -2281,7 +2281,7 @@ const ElfDumper = struct {
22812281 return mem.sliceTo(@as([*:0]const u8, @ptrCast(strtab.ptr + off)), 0);
22822282 }
22832283
2284 fn fmtShType(sh_type: u32) std.fmt.Formatter(u32, formatShType) {
2284 fn fmtShType(sh_type: u32) std.fmt.Alt(u32, formatShType) {
22852285 return .{ .data = sh_type };
22862286 }
22872287
......@@ -2321,7 +2321,7 @@ const ElfDumper = struct {
23212321 try writer.writeAll(name);
23222322 }
23232323
2324 fn fmtPhType(ph_type: u32) std.fmt.Formatter(u32, formatPhType) {
2324 fn fmtPhType(ph_type: u32) std.fmt.Alt(u32, formatPhType) {
23252325 return .{ .data = ph_type };
23262326 }
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
10251025 try w.writeAll("exited with any code");
10261026 }
10271027}
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) {
10291029 return .{ .data = term };
10301030}
10311031
lib/std/Uri.zig+1-1
......@@ -359,7 +359,7 @@ pub const Format = struct {
359359 }
360360};
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) {
363363 return .{ .data = .{ .uri = uri, .flags = flags } };
364364}
365365
lib/std/ascii.zig+1-1
......@@ -464,7 +464,7 @@ pub const HexEscape = struct {
464464};
465465
466466/// 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) {
468468 return .{ .data = .{ .bytes = bytes, .charset = switch (case) {
469469 .lower => HexEscape.lower_charset,
470470 .upper => HexEscape.upper_charset,
lib/std/fmt.zig+2-16
......@@ -28,9 +28,6 @@ pub const Case = enum { lower, upper };
2828const default_alignment = .right;
2929const default_fill_char = ' ';
3030
31/// Deprecated in favor of `Options`.
32pub const FormatOptions = Options;
33
3431pub const Options = struct {
3532 precision: ?usize = null,
3633 width: ?usize = null,
......@@ -77,14 +74,6 @@ pub const Number = struct {
7774 };
7875};
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
8877pub const Placeholder = struct {
8978 specifier_arg: []const u8,
9079 fill: u8,
......@@ -274,9 +263,6 @@ pub fn digits2(value: u8) [2]u8 {
274263 }
275264}
276265
277/// Deprecated in favor of `Alt`.
278pub const Formatter = Alt;
279
280266/// Creates a type suitable for instantiating and passing to a "{f}" placeholder.
281267pub fn Alt(
282268 comptime Data: type,
......@@ -294,7 +280,7 @@ pub fn Alt(
294280pub fn alt(
295281 context: anytype,
296282 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))) {
298284 return .{ .data = context };
299285}
300286
......@@ -607,7 +593,7 @@ pub const BufPrintError = error{
607593 NoSpaceLeft,
608594};
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.
611597pub fn bufPrint(buf: []u8, comptime fmt: []const u8, args: anytype) BufPrintError![]u8 {
612598 var w: Writer = .fixed(buf);
613599 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 {
146146 return out[0 .. out.len - 1 :0];
147147}
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) {
150150 return .{ .data = paths };
151151}
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
893893/// Ill-formed UTF-8 byte sequences are replaced by the replacement character (U+FFFD)
894894/// according to "U+FFFD Substitution of Maximal Subparts" from Chapter 3 of
895895/// 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) {
897897 return .{ .data = utf8 };
898898}
899899
......@@ -1483,7 +1483,7 @@ fn formatUtf16Le(utf16le: []const u16, writer: *std.Io.Writer) std.Io.Writer.Err
14831483/// Return a Formatter for a (potentially ill-formed) UTF-16 LE string,
14841484/// which will be converted to UTF-8 during formatting.
14851485/// 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) {
14871487 return .{ .data = utf16le };
14881488}
14891489
lib/std/zig.zig+2-2
......@@ -462,12 +462,12 @@ pub const FormatId = struct {
462462};
463463
464464/// 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) {
466466 return .{ .data = bytes };
467467}
468468
469469/// 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) {
471471 return .{ .data = c };
472472}
473473
lib/std/zig/llvm/Builder.zig+16-16
......@@ -111,7 +111,7 @@ pub const String = enum(u32) {
111111 return printEscapedString(string_slice, quote_behavior, w);
112112 }
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) {
115115 return .{ .data = .{
116116 .string = self,
117117 .builder = builder,
......@@ -119,7 +119,7 @@ pub const String = enum(u32) {
119119 } };
120120 }
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) {
123123 return .{ .data = .{
124124 .string = self,
125125 .builder = builder,
......@@ -127,7 +127,7 @@ pub const String = enum(u32) {
127127 } };
128128 }
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) {
131131 return .{ .data = .{
132132 .string = self,
133133 .builder = builder,
......@@ -846,7 +846,7 @@ pub const Type = enum(u32) {
846846 },
847847 }
848848 }
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) {
850850 return .{ .data = .{ .type = self, .builder = builder, .mode = mode } };
851851 }
852852
......@@ -1325,7 +1325,7 @@ pub const Attribute = union(Kind) {
13251325 .none => unreachable,
13261326 }
13271327 }
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) {
13291329 return .{ .data = .{ .attribute_index = self, .builder = builder, .mode = mode } };
13301330 }
13311331
......@@ -1609,7 +1609,7 @@ pub const Attributes = enum(u32) {
16091609 .flags = data.flags,
16101610 }, w);
16111611 }
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) {
16131613 return .{ .data = .{ .attributes = self, .builder = builder, .flags = flags } };
16141614 }
16151615};
......@@ -1803,7 +1803,7 @@ pub const Linkage = enum(u4) {
18031803 fn formatOptional(data: ?Linkage, w: *Writer) Writer.Error!void {
18041804 if (data) |linkage| try w.print(" {s}", .{@tagName(linkage)});
18051805 }
1806 pub fn fmtOptional(self: ?Linkage) std.fmt.Formatter(?Linkage, formatOptional) {
1806 pub fn fmtOptional(self: ?Linkage) std.fmt.Alt(?Linkage, formatOptional) {
18071807 return .{ .data = self };
18081808 }
18091809};
......@@ -2208,7 +2208,7 @@ pub const StrtabString = enum(u32) {
22082208 self: StrtabString,
22092209 builder: *const Builder,
22102210 quote_behavior: ?QuoteBehavior,
2211 ) std.fmt.Formatter(FormatData, format) {
2211 ) std.fmt.Alt(FormatData, format) {
22122212 return .{ .data = .{
22132213 .string = self,
22142214 .builder = builder,
......@@ -2387,7 +2387,7 @@ pub const Global = struct {
23872387 data.global.unwrap(data.builder).name(data.builder).fmt(data.builder, .quote_unless_valid_identifier),
23882388 });
23892389 }
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) {
23912391 return .{ .data = .{ .global = self, .builder = builder } };
23922392 }
23932393
......@@ -4852,7 +4852,7 @@ pub const Function = struct {
48524852 function: Function.Index,
48534853 builder: *Builder,
48544854 flags: FormatFlags,
4855 ) std.fmt.Formatter(FormatData, format) {
4855 ) std.fmt.Alt(FormatData, format) {
48564856 return .{ .data = .{
48574857 .instruction = self,
48584858 .function = function,
......@@ -7790,7 +7790,7 @@ pub const Constant = enum(u32) {
77907790 .global => |global| try w.print("{f}", .{global.fmt(data.builder)}),
77917791 }
77927792 }
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) {
77947794 return .{ .data = .{
77957795 .constant = self,
77967796 .builder = builder,
......@@ -7868,7 +7868,7 @@ pub const Value = enum(u32) {
78687868 .metadata => unreachable,
78697869 }
78707870 }
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) {
78727872 return .{ .data = .{ .value = self, .function = function, .builder = builder, .flags = flags } };
78737873 }
78747874};
......@@ -7902,7 +7902,7 @@ pub const MetadataString = enum(u32) {
79027902 fn format(data: FormatData, w: *Writer) Writer.Error!void {
79037903 try printEscapedString(data.metadata_string.slice(data.builder), .always_quote, w);
79047904 }
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) {
79067906 return .{ .data = .{ .metadata_string = self, .builder = builder } };
79077907 }
79087908};
......@@ -8411,7 +8411,7 @@ pub const Metadata = enum(u32) {
84118411 inline fn fmt(formatter: *Formatter, prefix: []const u8, node: anytype, special: ?FormatFlags) switch (@TypeOf(node)) {
84128412 Metadata => Allocator.Error,
84138413 else => error{},
8414 }!std.fmt.Formatter(FormatData, format) {
8414 }!std.fmt.Alt(FormatData, format) {
84158415 const Node = @TypeOf(node);
84168416 const MaybeNode = switch (@typeInfo(Node)) {
84178417 .optional => Node,
......@@ -8456,7 +8456,7 @@ pub const Metadata = enum(u32) {
84568456 prefix: []const u8,
84578457 value: Value,
84588458 function: Function.Index,
8459 ) Allocator.Error!std.fmt.Formatter(FormatData, format) {
8459 ) Allocator.Error!std.fmt.Alt(FormatData, format) {
84608460 return .{ .data = .{
84618461 .formatter = formatter,
84628462 .prefix = prefix,
......@@ -8539,7 +8539,7 @@ pub const Metadata = enum(u32) {
85398539 fmt_str = fmt_str ++ "(";
85408540 inline for (fields[2..], names) |*field, name| {
85418541 fmt_str = fmt_str ++ "{[" ++ name ++ "]f}";
8542 const T = std.fmt.Formatter(FormatData, format);
8542 const T = std.fmt.Alt(FormatData, format);
85438543 field.* = .{
85448544 .name = name,
85458545 .type = T,
lib/std/zig/string_literal.zig+1-1
......@@ -87,7 +87,7 @@ pub const Error = union(enum) {
8787 }
8888 }
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) {
9191 return .{ .data = .{
9292 .err = self,
9393 .raw_string = raw_string,
src/Compilation.zig+1-1
......@@ -6465,7 +6465,7 @@ fn updateWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, win32
64656465 };
64666466 }
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) {
64696469 return .{ .data = bytes };
64706470 }
64716471 }.fmtRcEscape;
src/InternPool.zig+2-2
......@@ -1904,11 +1904,11 @@ pub const NullTerminatedString = enum(u32) {
19041904 }
19051905 }
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) {
19081908 return .{ .data = .{ .string = string, .ip = ip, .id = false } };
19091909 }
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) {
19121912 return .{ .data = .{ .string = string, .ip = ip, .id = true } };
19131913 }
19141914
src/Type.zig+2-2
......@@ -127,7 +127,7 @@ pub fn format(ty: Type, writer: *std.Io.Writer) !void {
127127 @compileError("do not format types directly; use either ty.fmtDebug() or ty.fmt()");
128128}
129129
130pub const Formatter = std.fmt.Formatter(Format, Format.default);
130pub const Formatter = std.fmt.Alt(Format, Format.default);
131131
132132pub fn fmt(ty: Type, pt: Zcu.PerThread) Formatter {
133133 return .{ .data = .{
......@@ -145,7 +145,7 @@ const Format = struct {
145145 }
146146};
147147
148pub fn fmtDebug(ty: Type) std.fmt.Formatter(Type, dump) {
148pub fn fmtDebug(ty: Type) std.fmt.Alt(Type, dump) {
149149 return .{ .data = ty };
150150}
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 {
2727 try w.print("(interned: {})", .{start_val.toIntern()});
2828}
2929
30pub fn fmtDebug(val: Value) std.fmt.Formatter(Value, dump) {
30pub fn fmtDebug(val: Value) std.fmt.Alt(Value, dump) {
3131 return .{ .data = val };
3232}
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) {
3535 return .{ .data = .{
3636 .val = val,
3737 .pt = pt,
......@@ -40,7 +40,7 @@ pub fn fmtValue(val: Value, pt: Zcu.PerThread) std.fmt.Formatter(print_value.For
4040 } };
4141}
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) {
4444 return .{ .data = .{
4545 .val = val,
4646 .pt = pt,
......@@ -49,7 +49,7 @@ pub fn fmtValueSema(val: Value, pt: Zcu.PerThread, sema: *Sema) std.fmt.Formatte
4949 } };
5050}
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) {
5353 return .{ .data = ctx };
5454}
5555
src/Zcu.zig+2-2
......@@ -4306,10 +4306,10 @@ pub fn navFileScope(zcu: *Zcu, nav: InternPool.Nav.Index) *File {
43064306 return zcu.fileByIndex(zcu.navFileScopeIndex(nav));
43074307}
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) {
43104310 return .{ .data = .{ .unit = unit, .zcu = zcu } };
43114311}
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) {
43134313 return .{ .data = .{ .dependee = d, .zcu = zcu } };
43144314}
43154315
src/arch/riscv64/CodeGen.zig+4-4
......@@ -972,7 +972,7 @@ fn formatWipMir(data: FormatWipMirData, writer: *std.Io.Writer) std.Io.Writer.Er
972972 first = false;
973973 }
974974}
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) {
976976 return .{ .data = .{ .func = func, .inst = inst } };
977977}
978978
......@@ -983,7 +983,7 @@ const FormatNavData = struct {
983983fn formatNav(data: FormatNavData, writer: *std.Io.Writer) std.Io.Writer.Error!void {
984984 try writer.print("{f}", .{data.ip.getNav(data.nav_index).fqn.fmt(data.ip)});
985985}
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) {
987987 return .{ .data = .{
988988 .ip = ip,
989989 .nav_index = nav_index,
......@@ -1001,7 +1001,7 @@ fn formatAir(data: FormatAirData, writer: *std.Io.Writer) std.Io.Writer.Error!vo
10011001 _ = writer;
10021002 @panic("unimplemented");
10031003}
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) {
10051005 return .{ .data = .{ .func = func, .inst = inst } };
10061006}
10071007
......@@ -1012,7 +1012,7 @@ fn formatTracking(data: FormatTrackingData, writer: *std.Io.Writer) std.Io.Write
10121012 var it = data.func.inst_tracking.iterator();
10131013 while (it.next()) |entry| try writer.print("\n%{d} = {f}", .{ entry.key_ptr.*, entry.value_ptr.* });
10141014}
1015fn fmtTracking(func: *Func) std.fmt.Formatter(FormatTrackingData, formatTracking) {
1015fn fmtTracking(func: *Func) std.fmt.Alt(FormatTrackingData, formatTracking) {
10161016 return .{ .data = .{ .func = func } };
10171017}
10181018
src/arch/x86_64/CodeGen.zig+4-4
......@@ -1091,7 +1091,7 @@ const FormatNavData = struct {
10911091fn formatNav(data: FormatNavData, w: *Writer) Writer.Error!void {
10921092 try w.print("{f}", .{data.ip.getNav(data.nav_index).fqn.fmt(data.ip)});
10931093}
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) {
10951095 return .{ .data = .{
10961096 .ip = ip,
10971097 .nav_index = nav_index,
......@@ -1105,7 +1105,7 @@ const FormatAirData = struct {
11051105fn formatAir(data: FormatAirData, w: *Writer) Writer.Error!void {
11061106 data.self.air.writeInst(w, data.inst, data.self.pt, data.self.liveness);
11071107}
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) {
11091109 return .{ .data = .{ .self = self, .inst = inst } };
11101110}
11111111
......@@ -1197,7 +1197,7 @@ fn formatWipMir(data: FormatWipMirData, w: *Writer) Writer.Error!void {
11971197 }
11981198 }
11991199}
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) {
12011201 return .{ .data = .{ .self = self, .inst = inst } };
12021202}
12031203
......@@ -1208,7 +1208,7 @@ fn formatTracking(data: FormatTrackingData, w: *Writer) Writer.Error!void {
12081208 var it = data.self.inst_tracking.iterator();
12091209 while (it.next()) |entry| try w.print("\n{f} = {f}", .{ entry.key_ptr.*, entry.value_ptr.* });
12101210}
1211fn fmtTracking(self: *CodeGen) std.fmt.Formatter(FormatTrackingData, formatTracking) {
1211fn fmtTracking(self: *CodeGen) std.fmt.Alt(FormatTrackingData, formatTracking) {
12121212 return .{ .data = .{ .self = self } };
12131213}
12141214
src/arch/x86_64/encoder.zig+1-1
......@@ -301,7 +301,7 @@ pub const Instruction = struct {
301301 }
302302 };
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) {
305305 return .{ .data = .{ .op = op, .enc_op = enc_op } };
306306 }
307307 };
src/codegen/c.zig+10-10
......@@ -371,11 +371,11 @@ fn formatIdentOptions(ident: []const u8, w: *Writer, solo: bool) Writer.Error!vo
371371 }
372372}
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) {
375375 return .{ .data = ident };
376376}
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) {
379379 return .{ .data = ident };
380380}
381381
......@@ -394,7 +394,7 @@ pub fn fmtCTypePoolString(
394394 ctype_pool_string: CType.Pool.String,
395395 ctype_pool: *const CType.Pool,
396396 solo: bool,
397) std.fmt.Formatter(CTypePoolStringFormatData, formatCTypePoolString) {
397) std.fmt.Alt(CTypePoolStringFormatData, formatCTypePoolString) {
398398 return .{ .data = .{
399399 .ctype_pool_string = ctype_pool_string,
400400 .ctype_pool = ctype_pool,
......@@ -610,11 +610,11 @@ pub const Function = struct {
610610 return f.object.dg.renderIntCast(w, dest_ty, .{ .c_value = .{ .f = f, .value = src, .v = v } }, src_ty, location);
611611 }
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) {
614614 return f.object.dg.fmtIntLiteralDec(val, .Other);
615615 }
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) {
618618 return f.object.dg.fmtIntLiteralHex(val, .Other);
619619 }
620620
......@@ -1919,7 +1919,7 @@ pub const DeclGen = struct {
19191919 kind: CType.Kind,
19201920 name: union(enum) {
19211921 nav: InternPool.Nav.Index,
1922 fmt_ctype_pool_string: std.fmt.Formatter(CTypePoolStringFormatData, formatCTypePoolString),
1922 fmt_ctype_pool_string: std.fmt.Alt(CTypePoolStringFormatData, formatCTypePoolString),
19231923 @"export": struct {
19241924 main_name: InternPool.NullTerminatedString,
19251925 extern_name: InternPool.NullTerminatedString,
......@@ -2439,7 +2439,7 @@ pub const DeclGen = struct {
24392439 loc: ValueRenderLocation,
24402440 base: u8,
24412441 case: std.fmt.Case,
2442 ) !std.fmt.Formatter(FormatIntLiteralContext, formatIntLiteral) {
2442 ) !std.fmt.Alt(FormatIntLiteralContext, formatIntLiteral) {
24432443 const zcu = dg.pt.zcu;
24442444 const kind = loc.toCTypeKind();
24452445 const ty = val.typeOf(zcu);
......@@ -2461,7 +2461,7 @@ pub const DeclGen = struct {
24612461 dg: *DeclGen,
24622462 val: Value,
24632463 loc: ValueRenderLocation,
2464 ) !std.fmt.Formatter(FormatIntLiteralContext, formatIntLiteral) {
2464 ) !std.fmt.Alt(FormatIntLiteralContext, formatIntLiteral) {
24652465 return fmtIntLiteral(dg, val, loc, 10, .lower);
24662466 }
24672467
......@@ -2469,7 +2469,7 @@ pub const DeclGen = struct {
24692469 dg: *DeclGen,
24702470 val: Value,
24712471 loc: ValueRenderLocation,
2472 ) !std.fmt.Formatter(FormatIntLiteralContext, formatIntLiteral) {
2472 ) !std.fmt.Alt(FormatIntLiteralContext, formatIntLiteral) {
24732473 return fmtIntLiteral(dg, val, loc, 16, .lower);
24742474 }
24752475};
......@@ -8295,7 +8295,7 @@ fn formatStringLiteral(data: FormatStringContext, w: *Writer) Writer.Error!void
82958295 try literal.end();
82968296}
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) {
82998299 return .{ .data = .{ .str = str, .sentinel = sentinel } };
83008300}
83018301
src/codegen/c/Type.zig+1-1
......@@ -989,7 +989,7 @@ pub const Pool = struct {
989989 else
990990 try writer.print("f{d}", .{@intFromEnum(data.string.index)});
991991 }
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) {
993993 return .{ .data = .{ .string = str, .pool = pool } };
994994 }
995995
src/link/Coff.zig+1-1
......@@ -3053,7 +3053,7 @@ const ImportTable = struct {
30533053 }
30543054 };
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) {
30573057 return .{ .data = .{ .itab = itab, .ctx = ctx } };
30583058 }
30593059
src/link/Elf.zig+4-4
......@@ -3862,7 +3862,7 @@ const FormatShdr = struct {
38623862 shdr: elf.Elf64_Shdr,
38633863};
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) {
38663866 return .{ .data = .{
38673867 .shdr = shdr,
38683868 .elf_file = self,
......@@ -3879,7 +3879,7 @@ fn formatShdr(ctx: FormatShdr, writer: *std.Io.Writer) std.Io.Writer.Error!void
38793879 });
38803880}
38813881
3882pub fn fmtShdrFlags(sh_flags: u64) std.fmt.Formatter(u64, formatShdrFlags) {
3882pub fn fmtShdrFlags(sh_flags: u64) std.fmt.Alt(u64, formatShdrFlags) {
38833883 return .{ .data = sh_flags };
38843884}
38853885
......@@ -3933,7 +3933,7 @@ const FormatPhdr = struct {
39333933 phdr: elf.Elf64_Phdr,
39343934};
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) {
39373937 return .{ .data = .{
39383938 .phdr = phdr,
39393939 .elf_file = self,
......@@ -3967,7 +3967,7 @@ fn formatPhdr(ctx: FormatPhdr, writer: *std.Io.Writer) std.Io.Writer.Error!void
39673967 });
39683968}
39693969
3970pub fn dumpState(self: *Elf) std.fmt.Formatter(*Elf, fmtDumpState) {
3970pub fn dumpState(self: *Elf) std.fmt.Alt(*Elf, fmtDumpState) {
39713971 return .{ .data = self };
39723972}
39733973
src/link/Elf/Archive.zig+1-1
......@@ -215,7 +215,7 @@ pub const ArSymtab = struct {
215215 }
216216 };
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) {
219219 return .{ .data = .{
220220 .ar = ar,
221221 .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 {
894894 atom.file(elf_file).?.setAtomExtra(atom.extra_index, extras);
895895}
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) {
898898 return .{ .data = .{
899899 .atom = atom,
900900 .elf_file = elf_file,
src/link/Elf/AtomList.zig+1-1
......@@ -187,7 +187,7 @@ const Format = struct {
187187 }
188188};
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) {
191191 return .{ .data = .{ .atom_list = atom_list, .elf_file = elf_file } };
192192}
193193
src/link/Elf/LinkerDefined.zig+1-1
......@@ -437,7 +437,7 @@ pub fn setSymbolExtra(self: *LinkerDefined, index: u32, extra: Symbol.Extra) voi
437437 }
438438}
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) {
441441 return .{ .data = .{
442442 .self = self,
443443 .elf_file = elf_file,
src/link/Elf/Merge.zig+2-2
......@@ -157,7 +157,7 @@ pub const Section = struct {
157157 }
158158 };
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) {
161161 return .{ .data = .{
162162 .msec = msec,
163163 .elf_file = elf_file,
......@@ -211,7 +211,7 @@ pub const Subsection = struct {
211211 return msec.bytes.items[msub.string_index..][0..msub.size];
212212 }
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) {
215215 return .{ .data = .{
216216 .msub = msub,
217217 .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 {
14311431 return &self.groups.items[index];
14321432}
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) {
14351435 return .{ .data = .{
14361436 .object = self,
14371437 .elf_file = elf_file,
......@@ -1504,35 +1504,35 @@ const Format = struct {
15041504 }
15051505};
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) {
15081508 return .{ .data = .{
15091509 .object = self,
15101510 .elf_file = elf_file,
15111511 } };
15121512}
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) {
15151515 return .{ .data = .{
15161516 .object = self,
15171517 .elf_file = elf_file,
15181518 } };
15191519}
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) {
15221522 return .{ .data = .{
15231523 .object = self,
15241524 .elf_file = elf_file,
15251525 } };
15261526}
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) {
15291529 return .{ .data = .{
15301530 .object = self,
15311531 .elf_file = elf_file,
15321532 } };
15331533}
15341534
1535pub fn fmtPath(self: Object) std.fmt.Formatter(Object, formatPath) {
1535pub fn fmtPath(self: Object) std.fmt.Alt(Object, formatPath) {
15361536 return .{ .data = self };
15371537}
15381538
src/link/Elf/SharedObject.zig+1-1
......@@ -509,7 +509,7 @@ pub fn setSymbolExtra(self: *SharedObject, index: u32, extra: Symbol.Extra) void
509509 }
510510}
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) {
513513 return .{ .data = .{
514514 .shared = self,
515515 .elf_file = elf_file,
src/link/Elf/Symbol.zig+2-2
......@@ -368,14 +368,14 @@ const Format = struct {
368368 }
369369};
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) {
372372 return .{ .data = .{
373373 .symbol = symbol,
374374 .elf_file = elf_file,
375375 } };
376376}
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) {
379379 return .{ .data = .{
380380 .symbol = symbol,
381381 .elf_file = elf_file,
src/link/Elf/Thunk.zig+1-1
......@@ -65,7 +65,7 @@ fn trampolineSize(cpu_arch: std.Target.Cpu.Arch) usize {
6565 };
6666}
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) {
6969 return .{ .data = .{
7070 .thunk = thunk,
7171 .elf_file = elf_file,
src/link/Elf/ZigObject.zig+2-2
......@@ -2225,14 +2225,14 @@ const Format = struct {
22252225 }
22262226};
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) {
22292229 return .{ .data = .{
22302230 .self = self,
22312231 .elf_file = elf_file,
22322232 } };
22332233}
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) {
22362236 return .{ .data = .{
22372237 .self = self,
22382238 .elf_file = elf_file,
src/link/Elf/eh_frame.zig+2-2
......@@ -47,7 +47,7 @@ pub const Fde = struct {
4747 return object.relocs.items[fde.rel_index..][0..fde.rel_num];
4848 }
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) {
5151 return .{ .data = .{
5252 .fde = fde,
5353 .elf_file = elf_file,
......@@ -130,7 +130,7 @@ pub const Cie = struct {
130130 return true;
131131 }
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) {
134134 return .{ .data = .{
135135 .cie = cie,
136136 .elf_file = elf_file,
src/link/Elf/file.zig+1-1
......@@ -10,7 +10,7 @@ pub const File = union(enum) {
1010 };
1111 }
1212
13 pub fn fmtPath(file: File) std.fmt.Formatter(File, formatPath) {
13 pub fn fmtPath(file: File) std.fmt.Alt(File, formatPath) {
1414 return .{ .data = file };
1515 }
1616
src/link/Elf/relocation.zig+1-1
......@@ -153,7 +153,7 @@ const FormatRelocTypeCtx = struct {
153153 cpu_arch: std.Target.Cpu.Arch,
154154};
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) {
157157 return .{ .data = .{
158158 .r_type = r_type,
159159 .cpu_arch = cpu_arch,
src/link/Elf/synthetic_sections.zig+2-2
......@@ -622,7 +622,7 @@ pub const GotSection = struct {
622622 }
623623 };
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) {
626626 return .{ .data = .{ .got = got, .elf_file = elf_file } };
627627 }
628628};
......@@ -758,7 +758,7 @@ pub const PltSection = struct {
758758 }
759759 };
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) {
762762 return .{ .data = .{ .plt = plt, .elf_file = elf_file } };
763763 }
764764
src/link/MachO.zig+5-5
......@@ -3906,7 +3906,7 @@ pub fn ptraceDetach(self: *MachO, pid: std.posix.pid_t) !void {
39063906 self.hot_state.mach_task = null;
39073907}
39083908
3909pub fn dumpState(self: *MachO) std.fmt.Formatter(*MachO, fmtDumpState) {
3909pub fn dumpState(self: *MachO) std.fmt.Alt(*MachO, fmtDumpState) {
39103910 return .{ .data = self };
39113911}
39123912
......@@ -3964,7 +3964,7 @@ fn fmtDumpState(self: *MachO, w: *Writer) Writer.Error!void {
39643964 try w.print("segments\n{f}\n", .{self.fmtSegments()});
39653965}
39663966
3967fn fmtSections(self: *MachO) std.fmt.Formatter(*MachO, formatSections) {
3967fn fmtSections(self: *MachO) std.fmt.Alt(*MachO, formatSections) {
39683968 return .{ .data = self };
39693969}
39703970
......@@ -3981,7 +3981,7 @@ fn formatSections(self: *MachO, w: *Writer) Writer.Error!void {
39813981 }
39823982}
39833983
3984fn fmtSegments(self: *MachO) std.fmt.Formatter(*MachO, formatSegments) {
3984fn fmtSegments(self: *MachO) std.fmt.Alt(*MachO, formatSegments) {
39853985 return .{ .data = self };
39863986}
39873987
......@@ -3994,7 +3994,7 @@ fn formatSegments(self: *MachO, w: *Writer) Writer.Error!void {
39943994 }
39953995}
39963996
3997pub fn fmtSectType(tt: u8) std.fmt.Formatter(u8, formatSectType) {
3997pub fn fmtSectType(tt: u8) std.fmt.Alt(u8, formatSectType) {
39983998 return .{ .data = tt };
39993999}
40004000
......@@ -4257,7 +4257,7 @@ pub const Platform = struct {
42574257 return false;
42584258 }
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) {
42614261 return .{ .data = .{ .platform = plat, .cpu_arch = cpu_arch } };
42624262 }
42634263
src/link/MachO/Archive.zig+1-1
......@@ -225,7 +225,7 @@ pub const ArSymtab = struct {
225225 }
226226 };
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) {
229229 return .{ .data = .{ .ar = ar, .macho_file = macho_file } };
230230 }
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
10731073 assert(i == buffer.len);
10741074}
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) {
10771077 return .{ .data = .{
10781078 .atom = atom,
10791079 .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 {
667667 }
668668}
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) {
671671 return .{ .data = .{
672672 .dylib = self,
673673 .macho_file = macho_file,
src/link/MachO/InternalObject.zig+2-2
......@@ -864,14 +864,14 @@ const Format = struct {
864864 }
865865};
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) {
868868 return .{ .data = .{
869869 .self = self,
870870 .macho_file = macho_file,
871871 } };
872872}
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) {
875875 return .{ .data = .{
876876 .self = self,
877877 .macho_file = macho_file,
src/link/MachO/Object.zig+7-7
......@@ -2578,42 +2578,42 @@ const Format = struct {
25782578 }
25792579};
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) {
25822582 return .{ .data = .{
25832583 .object = self,
25842584 .macho_file = macho_file,
25852585 } };
25862586}
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) {
25892589 return .{ .data = .{
25902590 .object = self,
25912591 .macho_file = macho_file,
25922592 } };
25932593}
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) {
25962596 return .{ .data = .{
25972597 .object = self,
25982598 .macho_file = macho_file,
25992599 } };
26002600}
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) {
26032603 return .{ .data = .{
26042604 .object = self,
26052605 .macho_file = macho_file,
26062606 } };
26072607}
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) {
26102610 return .{ .data = .{
26112611 .object = self,
26122612 .macho_file = macho_file,
26132613 } };
26142614}
26152615
2616pub fn fmtPath(self: Object) std.fmt.Formatter(Object, formatPath) {
2616pub fn fmtPath(self: Object) std.fmt.Alt(Object, formatPath) {
26172617 return .{ .data = self };
26182618}
26192619
......@@ -2694,7 +2694,7 @@ const StabFile = struct {
26942694 }
26952695 };
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) {
26982698 return .{ .data = .{ .stab = stab, .object = object } };
26992699 }
27002700 };
src/link/MachO/Relocation.zig+1-1
......@@ -70,7 +70,7 @@ pub fn lessThan(ctx: void, lhs: Relocation, rhs: Relocation) bool {
7070 return lhs.offset < rhs.offset;
7171}
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) {
7474 return .{ .data = .{ .relocation = rel, .arch = cpu_arch } };
7575}
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
286286 }
287287}
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) {
290290 return .{ .data = .{
291291 .symbol = symbol,
292292 .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 {
6363 }
6464}
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) {
6767 return .{ .data = .{
6868 .thunk = thunk,
6969 .macho_file = macho_file,
src/link/MachO/UnwindInfo.zig+2-2
......@@ -509,7 +509,7 @@ pub const Record = struct {
509509 return lsda.getAddress(macho_file) + rec.lsda_offset;
510510 }
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) {
513513 return .{ .data = .{
514514 .rec = rec,
515515 .macho_file = macho_file,
......@@ -603,7 +603,7 @@ const Page = struct {
603603 }
604604 };
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) {
607607 return .{ .data = .{
608608 .page = page,
609609 .info = info,
src/link/MachO/ZigObject.zig+2-2
......@@ -1680,7 +1680,7 @@ pub fn asFile(self: *ZigObject) File {
16801680 return .{ .zig_object = self };
16811681}
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) {
16841684 return .{ .data = .{
16851685 .self = self,
16861686 .macho_file = macho_file,
......@@ -1717,7 +1717,7 @@ const Format = struct {
17171717 }
17181718};
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) {
17211721 return .{ .data = .{
17221722 .self = self,
17231723 .macho_file = macho_file,
src/link/MachO/eh_frame.zig+2-2
......@@ -79,7 +79,7 @@ pub const Cie = struct {
7979 return true;
8080 }
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) {
8383 return .{ .data = .{
8484 .cie = cie,
8585 .macho_file = macho_file,
......@@ -208,7 +208,7 @@ pub const Fde = struct {
208208 return fde.getObject(macho_file).getAtom(fde.lsda);
209209 }
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) {
212212 return .{ .data = .{
213213 .fde = fde,
214214 .macho_file = macho_file,
src/link/MachO/file.zig+1-1
......@@ -10,7 +10,7 @@ pub const File = union(enum) {
1010 };
1111 }
1212
13 pub fn fmtPath(file: File) std.fmt.Formatter(File, formatPath) {
13 pub fn fmtPath(file: File) std.fmt.Alt(File, formatPath) {
1414 return .{ .data = file };
1515 }
1616
src/link/MachO/synthetic.zig+4-4
......@@ -55,7 +55,7 @@ pub const GotSection = struct {
5555 }
5656 };
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) {
5959 return .{ .data = .{ .got = got, .macho_file = macho_file } };
6060 }
6161};
......@@ -120,7 +120,7 @@ pub const StubsSection = struct {
120120 }
121121 }
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) {
124124 return .{ .data = .{ .stubs = stubs, .macho_file = macho_file } };
125125 }
126126
......@@ -337,7 +337,7 @@ pub const TlvPtrSection = struct {
337337 }
338338 }
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) {
341341 return .{ .data = .{ .tlv = tlv, .macho_file = macho_file } };
342342 }
343343
......@@ -452,7 +452,7 @@ pub const ObjcStubsSection = struct {
452452 }
453453 }
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) {
456456 return .{ .data = .{ .objc = objc, .macho_file = macho_file } };
457457 }
458458