authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-03-16 17:46:34+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-03-20 17:29:43+02:00
log0c169127338ef8af752d1a077e412b5135e300d5
treea7194992f4f90a60684173933c4567d139dee277
parent30427ff794514d51cb5066b9e50113da998e0fd0

std: improve error for formatting a function body type

Closes #14915

1 files changed, 1 insertions(+), 4 deletions(-)

lib/std/fmt.zig+1-4
......@@ -703,10 +703,7 @@ pub fn formatType(
703703 }
704704 try writer.writeAll(" }");
705705 },
706 .Fn => {
707 if (actual_fmt.len != 0) invalidFmtError(fmt, value);
708 return format(writer, "{s}@{x}", .{ @typeName(T), @ptrToInt(value) });
709 },
706 .Fn => @compileError("unable to format function body type, use '*const " ++ @typeName(T) ++ "' for a function pointer type"),
710707 .Type => {
711708 if (actual_fmt.len != 0) invalidFmtError(fmt, value);
712709 return formatBuf(@typeName(value), options, writer);