std.fmt.format: use {t} for tag name rather than {s}

prevents footgun when formatted type changes from string to enum
This commit is contained in:
Andrew Kelley
2025-07-03 18:50:16 -07:00
parent 30c2921eb8
commit 9c8aef55b4
12 changed files with 39 additions and 29 deletions

View File

@@ -1680,7 +1680,7 @@ pub const DeclGen = struct {
try w.writeAll("{(");
const ptr_ty = ty.slicePtrFieldType(zcu);
try dg.renderType(w, ptr_ty);
return w.print("){f}, {0fx}}}", .{
return w.print("){f}, {0f}}}", .{
try dg.fmtIntLiteralHex(.undef_usize, .Other),
});
},