aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2020-11-26 09:48:12 +0100
committerAndrew Kelley <andrew@ziglang.org>2021-01-02 17:12:57 -0700
commitdd973fb365dbbe11ce5beac8b4889bfab3fddc4d (patch)
treee82adf746186ec50e1aa11c5bd9f4a677e93046d /lib/std/debug.zig
parent5a06fdfa5525920810005e73eaa1b6e79a6472ca (diff)
downloadzig-dd973fb365dbbe11ce5beac8b4889bfab3fddc4d.tar.gz
zig-dd973fb365dbbe11ce5beac8b4889bfab3fddc4d.zip
std: Use {s} instead of {} when printing strings
Diffstat (limited to 'lib/std/debug.zig')
-rw-r--r--lib/std/debug.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index 57a0e20d2e..073f68da5d 100644
--- a/lib/std/debug.zig
+++ b/lib/std/debug.zig
@@ -108,11 +108,11 @@ pub fn dumpCurrentStackTrace(start_addr: ?usize) void {
return;
}
const debug_info = getSelfDebugInfo() catch |err| {
- stderr.print("Unable to dump stack trace: Unable to open debug info: {}\n", .{@errorName(err)}) catch return;
+ stderr.print("Unable to dump stack trace: Unable to open debug info: {s}\n", .{@errorName(err)}) catch return;
return;
};
writeCurrentStackTrace(stderr, debug_info, detectTTYConfig(), start_addr) catch |err| {
- stderr.print("Unable to dump stack trace: {}\n", .{@errorName(err)}) catch return;
+ stderr.print("Unable to dump stack trace: {s}\n", .{@errorName(err)}) catch return;
return;
};
}
@@ -129,7 +129,7 @@ pub fn dumpStackTraceFromBase(bp: usize, ip: usize) void {
return;
}
const debug_info = getSelfDebugInfo() catch |err| {
- stderr.print("Unable to dump stack trace: Unable to open debug info: {}\n", .{@errorName(err)}) catch return;
+ stderr.print("Unable to dump stack trace: Unable to open debug info: {s}\n", .{@errorName(err)}) catch return;
return;
};
const tty_config = detectTTYConfig();
@@ -199,11 +199,11 @@ pub fn dumpStackTrace(stack_trace: builtin.StackTrace) void {
return;
}
const debug_info = getSelfDebugInfo() catch |err| {
- stderr.print("Unable to dump stack trace: Unable to open debug info: {}\n", .{@errorName(err)}) catch return;
+ stderr.print("Unable to dump stack trace: Unable to open debug info: {s}\n", .{@errorName(err)}) catch return;
return;
};
writeStackTrace(stack_trace, stderr, getDebugInfoAllocator(), debug_info, detectTTYConfig()) catch |err| {
- stderr.print("Unable to dump stack trace: {}\n", .{@errorName(err)}) catch return;
+ stderr.print("Unable to dump stack trace: {s}\n", .{@errorName(err)}) catch return;
return;
};
}
@@ -611,7 +611,7 @@ fn printLineInfo(
tty_config.setColor(out_stream, .White);
if (line_info) |*li| {
- try out_stream.print("{}:{}:{}", .{ li.file_name, li.line, li.column });
+ try out_stream.print("{s}:{d}:{d}", .{ li.file_name, li.line, li.column });
} else {
try out_stream.writeAll("???:?:?");
}
@@ -619,7 +619,7 @@ fn printLineInfo(
tty_config.setColor(out_stream, .Reset);
try out_stream.writeAll(": ");
tty_config.setColor(out_stream, .Dim);
- try out_stream.print("0x{x} in {} ({})", .{ address, symbol_name, compile_unit_name });
+ try out_stream.print("0x{x} in {s} ({s})", .{ address, symbol_name, compile_unit_name });
tty_config.setColor(out_stream, .Reset);
try out_stream.writeAll("\n");