mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
std.fmt: add name of type in unsupport format string compile error
This commit is contained in:
parent
c2635f9b02
commit
fcf2ce0ffe
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user