authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-08-13 21:21:34-07:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2021-08-14 11:07:01+03:00
logfcf2ce0ffee549ac882879364cd7e743ac10be20
tree76d1e680006a1802d43c07c38fe5b4c26a9e6e59
parentc2635f9b024081717f01d02ea35aaa670c9e2eb7

std.fmt: add name of type in unsupport format string compile error


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

lib/std/fmt.zig+2-2
......@@ -544,7 +544,7 @@ pub fn formatType(
544544 return formatText(value, actual_fmt, options, writer);
545545 }
546546 }
547 @compileError("Unknown format string: '" ++ actual_fmt ++ "'");
547 @compileError("Unknown format string: '" ++ actual_fmt ++ "' for type '" ++ @typeName(T) ++ "'");
548548 },
549549 .Enum, .Union, .Struct => {
550550 return formatType(value.*, actual_fmt, options, writer, max_depth);
......@@ -562,7 +562,7 @@ pub fn formatType(
562562 return formatText(mem.span(value), actual_fmt, options, writer);
563563 }
564564 }
565 @compileError("Unknown format string: '" ++ actual_fmt ++ "'");
565 @compileError("Unknown format string: '" ++ actual_fmt ++ "' for type '" ++ @typeName(T) ++ "'");
566566 },
567567 .Slice => {
568568 if (actual_fmt.len == 0)