commit fcf2ce0ffee549ac882879364cd7e743ac10be20 (tree)
parent c2635f9b024081717f01d02ea35aaa670c9e2eb7
Author: Meghan <hello@nektro.net>
Date: Fri, 13 Aug 2021 21:21:34 -0700
std.fmt: add name of type in unsupport format string compile error
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/std/fmt.zig b/lib/std/fmt.zig
@@ -544,7 +544,7 @@ pub fn formatType(
return formatText(value, actual_fmt, options, writer);
}
}
- @compileError("Unknown format string: '" ++ actual_fmt ++ "'");
+ @compileError("Unknown format string: '" ++ actual_fmt ++ "' for type '" ++ @typeName(T) ++ "'");
},
.Enum, .Union, .Struct => {
return formatType(value.*, actual_fmt, options, writer, max_depth);
@@ -562,7 +562,7 @@ pub fn formatType(
return formatText(mem.span(value), actual_fmt, options, writer);
}
}
- @compileError("Unknown format string: '" ++ actual_fmt ++ "'");
+ @compileError("Unknown format string: '" ++ actual_fmt ++ "' for type '" ++ @typeName(T) ++ "'");
},
.Slice => {
if (actual_fmt.len == 0)