From fcf2ce0ffee549ac882879364cd7e743ac10be20 Mon Sep 17 00:00:00 2001 From: Meghan Date: Fri, 13 Aug 2021 21:21:34 -0700 Subject: [PATCH] std.fmt: add name of type in unsupport format string compile error --- lib/std/fmt.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/fmt.zig b/lib/std/fmt.zig index 22bafd04f1..9ab111496c 100644 --- 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)