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(...@@ -544,7 +544,7 @@ pub fn formatType(
544 return formatText(value, actual_fmt, options, writer);544 return formatText(value, actual_fmt, options, writer);
545 }545 }
546 }546 }
547 @compileError("Unknown format string: '" ++ actual_fmt ++ "'");547 @compileError("Unknown format string: '" ++ actual_fmt ++ "' for type '" ++ @typeName(T) ++ "'");
548 },548 },
549 .Enum, .Union, .Struct => {549 .Enum, .Union, .Struct => {
550 return formatType(value.*, actual_fmt, options, writer, max_depth);550 return formatType(value.*, actual_fmt, options, writer, max_depth);
...@@ -562,7 +562,7 @@ pub fn formatType(...@@ -562,7 +562,7 @@ pub fn formatType(
562 return formatText(mem.span(value), actual_fmt, options, writer);562 return formatText(mem.span(value), actual_fmt, options, writer);
563 }563 }
564 }564 }
565 @compileError("Unknown format string: '" ++ actual_fmt ++ "'");565 @compileError("Unknown format string: '" ++ actual_fmt ++ "' for type '" ++ @typeName(T) ++ "'");
566 },566 },
567 .Slice => {567 .Slice => {
568 if (actual_fmt.len == 0)568 if (actual_fmt.len == 0)