mirror of
https://github.com/ziglang/zig.git
synced 2024-12-03 10:28:48 +00:00
Improve error messages in std.fmt (#7898)
This commit is contained in:
parent
f9b85c6e50
commit
290efc0747
@ -654,7 +654,7 @@ pub fn formatIntValue(
|
||||
radix = 8;
|
||||
uppercase = false;
|
||||
} else {
|
||||
@compileError("Unknown format string: '" ++ fmt ++ "'");
|
||||
@compileError("Unsupported format string '" ++ fmt ++ "' for type '" ++ @typeName(@TypeOf(value)) ++ "'");
|
||||
}
|
||||
|
||||
return formatInt(int_value, radix, uppercase, options, writer);
|
||||
@ -681,7 +681,7 @@ fn formatFloatValue(
|
||||
else => |e| return e,
|
||||
};
|
||||
} else {
|
||||
@compileError("Unknown format string: '" ++ fmt ++ "'");
|
||||
@compileError("Unsupported format string '" ++ fmt ++ "' for type '" ++ @typeName(@TypeOf(value)) ++ "'");
|
||||
}
|
||||
|
||||
return formatBuf(buf_stream.getWritten(), options, writer);
|
||||
@ -715,7 +715,7 @@ pub fn formatText(
|
||||
} else if (comptime std.mem.eql(u8, fmt, "Z")) {
|
||||
@compileError("specifier 'Z' has been deprecated, wrap your argument in std.zig.fmtEscapes instead");
|
||||
} else {
|
||||
@compileError("Unknown format string: '" ++ fmt ++ "'");
|
||||
@compileError("Unsupported format string '" ++ fmt ++ "' for type '" ++ @typeName(@TypeOf(value)) ++ "'");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user