commit a4fe438d3940d0beff16c939e991fdff24eb6ba2 (tree)
parent 49c0cd6e8ef2efcd2c7edc8b41fc8c0a10c8b350
Author: Alexandros Naskos <alex_naskos@hotmail.com>
Date: Fri, 2 Oct 2020 00:39:19 +0300
std.fmt.comptimePrint: bufPrint cannot return an error
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/std/fmt.zig b/lib/std/fmt.zig
@@ -1183,7 +1183,7 @@ fn bufPrintIntToSlice(buf: []u8, value: anytype, base: u8, uppercase: bool, opti
pub fn comptimePrint(comptime fmt: []const u8, args: anytype) *const [count(fmt, args)]u8 {
comptime var buf: [count(fmt, args)]u8 = undefined;
- _ = bufPrint(&buf, fmt, args) catch |err| @compileError(err);
+ _ = bufPrint(&buf, fmt, args) catch unreachable;
return &buf;
}