authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-01-02 19:03:14-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-01-02 19:03:14-07:00
log974c008a0ee0e0d7933e37d5ea930f712d494f6a
treec12b14dceebe7f6055fe07cfed2780d2b5c7bf60
parent5b981b1be7b387a3f51d60b8642064e6642b956c

convert more {} to {d} and {s}


23 files changed, 97 insertions(+), 97 deletions(-)

lib/std/SemanticVersion.zig+1-1
......@@ -163,7 +163,7 @@ pub fn format(
163163 out_stream: anytype,
164164) !void {
165165 if (fmt.len != 0) @compileError("Unknown format string: '" ++ fmt ++ "'");
166 try std.fmt.format(out_stream, "{}.{}.{}", .{ self.major, self.minor, self.patch });
166 try std.fmt.format(out_stream, "{d}.{d}.{d}", .{ self.major, self.minor, self.patch });
167167 if (self.pre) |pre| try std.fmt.format(out_stream, "-{s}", .{pre});
168168 if (self.build) |build| try std.fmt.format(out_stream, "+{s}", .{build});
169169}
lib/std/c/ast.zig+4-4
......@@ -115,10 +115,10 @@ pub const Error = union(enum) {
115115 pub fn render(self: *const ExpectedToken, tree: *Tree, stream: anytype) !void {
116116 const found_token = tree.tokens.at(self.token);
117117 if (found_token.id == .Invalid) {
118 return stream.print("expected '{}', found invalid bytes", .{self.expected_id.symbol()});
118 return stream.print("expected '{s}', found invalid bytes", .{self.expected_id.symbol()});
119119 } else {
120120 const token_name = found_token.id.symbol();
121 return stream.print("expected '{}', found '{}'", .{ self.expected_id.symbol(), token_name });
121 return stream.print("expected '{s}', found '{s}'", .{ self.expected_id.symbol(), token_name });
122122 }
123123 }
124124 };
......@@ -131,7 +131,7 @@ pub const Error = union(enum) {
131131 try stream.write("invalid type specifier '");
132132 try type_spec.spec.print(tree, stream);
133133 const token_name = tree.tokens.at(self.token).id.symbol();
134 return stream.print("{}'", .{token_name});
134 return stream.print("{s}'", .{token_name});
135135 }
136136 };
137137
......@@ -140,7 +140,7 @@ pub const Error = union(enum) {
140140 name: TokenIndex,
141141
142142 pub fn render(self: *const ExpectedToken, tree: *Tree, stream: anytype) !void {
143 return stream.print("must use '{}' tag to refer to type '{}'", .{ tree.slice(kw), tree.slice(name) });
143 return stream.print("must use '{s}' tag to refer to type '{s}'", .{ tree.slice(kw), tree.slice(name) });
144144 }
145145 };
146146
lib/std/fs/wasi.zig+1-1
......@@ -38,7 +38,7 @@ pub const PreopenType = union(PreopenTypeTag) {
3838 pub fn format(self: Self, comptime fmt: []const u8, options: std.fmt.FormatOptions, out_stream: anytype) !void {
3939 try out_stream.print("PreopenType{{ ", .{});
4040 switch (self) {
41 PreopenType.Dir => |path| try out_stream.print(".Dir = '{}'", .{path}),
41 PreopenType.Dir => |path| try out_stream.print(".Dir = '{z}'", .{path}),
4242 }
4343 return out_stream.print(" }}", .{});
4444 }
lib/std/os.zig+2-2
......@@ -4256,7 +4256,7 @@ pub fn getFdPath(fd: fd_t, out_buffer: *[MAX_PATH_BYTES]u8) RealPathError![]u8 {
42564256 },
42574257 .linux => {
42584258 var procfs_buf: ["/proc/self/fd/-2147483648".len:0]u8 = undefined;
4259 const proc_path = std.fmt.bufPrint(procfs_buf[0..], "/proc/self/fd/{}\x00", .{fd}) catch unreachable;
4259 const proc_path = std.fmt.bufPrint(procfs_buf[0..], "/proc/self/fd/{d}\x00", .{fd}) catch unreachable;
42604260
42614261 const target = readlinkZ(std.meta.assumeSentinel(proc_path.ptr, 0), out_buffer) catch |err| {
42624262 switch (err) {
......@@ -4487,7 +4487,7 @@ pub const UnexpectedError = error{
44874487/// and you get an unexpected error.
44884488pub fn unexpectedErrno(err: usize) UnexpectedError {
44894489 if (unexpected_error_tracing) {
4490 std.debug.warn("unexpected errno: {}\n", .{err});
4490 std.debug.warn("unexpected errno: {d}\n", .{err});
44914491 std.debug.dumpCurrentStackTrace(null);
44924492 }
44934493 return error.Unexpected;
lib/std/special/c.zig+1-1
......@@ -172,7 +172,7 @@ test "strncmp" {
172172pub fn panic(msg: []const u8, error_return_trace: ?*builtin.StackTrace) noreturn {
173173 if (builtin.is_test) {
174174 @setCold(true);
175 std.debug.panic("{}", .{msg});
175 std.debug.panic("{s}", .{msg});
176176 }
177177 if (builtin.os.tag != .freestanding and builtin.os.tag != .other) {
178178 std.os.abort();
lib/std/special/compiler_rt.zig+1-1
......@@ -324,7 +324,7 @@ pub usingnamespace @import("compiler_rt/atomics.zig");
324324pub fn panic(msg: []const u8, error_return_trace: ?*builtin.StackTrace) noreturn {
325325 @setCold(true);
326326 if (is_test) {
327 std.debug.panic("{}", .{msg});
327 std.debug.panic("{s}", .{msg});
328328 } else {
329329 unreachable;
330330 }
lib/std/testing.zig+1-1
......@@ -258,7 +258,7 @@ pub fn expectEqualSlices(comptime T: type, expected: []const T, actual: []const
258258 // If the child type is u8 and no weird bytes, we could print it as strings
259259 // Even for the length difference, it would be useful to see the values of the slices probably.
260260 if (expected.len != actual.len) {
261 std.debug.panic("slice lengths differ. expected {}, found {}", .{ expected.len, actual.len });
261 std.debug.panic("slice lengths differ. expected {d}, found {d}", .{ expected.len, actual.len });
262262 }
263263 var i: usize = 0;
264264 while (i < expected.len) : (i += 1) {
lib/std/zig/parser_test.zig+2-2
......@@ -3742,7 +3742,7 @@ fn testParse(source: []const u8, allocator: *mem.Allocator, anything_changed: *b
37423742 for (tree.errors) |*parse_error| {
37433743 const token = tree.token_locs[parse_error.loc()];
37443744 const loc = tree.tokenLocation(0, parse_error.loc());
3745 try stderr.print("(memory buffer):{}:{}: error: ", .{ loc.line + 1, loc.column + 1 });
3745 try stderr.print("(memory buffer):{d}:{d}: error: ", .{ loc.line + 1, loc.column + 1 });
37463746 try tree.renderError(parse_error, stderr);
37473747 try stderr.print("\n{s}\n", .{source[loc.line_start..loc.line_end]});
37483748 {
......@@ -3800,7 +3800,7 @@ fn testTransform(source: []const u8, expected_source: []const u8) !void {
38003800 error.OutOfMemory => {
38013801 if (failing_allocator.allocated_bytes != failing_allocator.freed_bytes) {
38023802 warn(
3803 "\nfail_index: {}/{}\nallocated bytes: {}\nfreed bytes: {}\nallocations: {}\ndeallocations: {}\n",
3803 "\nfail_index: {d}/{d}\nallocated bytes: {d}\nfreed bytes: {d}\nallocations: {d}\ndeallocations: {d}\n",
38043804 .{
38053805 fail_index,
38063806 needed_alloc_count,
lib/std/zig/system/macos.zig+2-2
......@@ -450,7 +450,7 @@ test "version_from_build" {
450450 for (known) |pair| {
451451 var buf: [32]u8 = undefined;
452452 const ver = try version_from_build(pair[0]);
453 const sver = try std.fmt.bufPrint(buf[0..], "{}.{}.{}", .{ ver.major, ver.minor, ver.patch });
453 const sver = try std.fmt.bufPrint(buf[0..], "{d}.{d}.{d}", .{ ver.major, ver.minor, ver.patch });
454454 std.testing.expect(std.mem.eql(u8, sver, pair[1]));
455455 }
456456}
......@@ -468,7 +468,7 @@ pub fn getSDKPath(allocator: *mem.Allocator) ![]u8 {
468468 allocator.free(result.stdout);
469469 }
470470 if (result.stderr.len != 0) {
471 std.log.err("unexpected 'xcrun --show-sdk-path' stderr: {}", .{result.stderr});
471 std.log.err("unexpected 'xcrun --show-sdk-path' stderr: {s}", .{result.stderr});
472472 }
473473 if (result.term.Exited != 0) {
474474 return error.ProcessTerminated;
src/Compilation.zig+6-6
......@@ -1512,7 +1512,7 @@ pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemor
15121512 module.failed_decls.putAssumeCapacityNoClobber(decl, try ErrorMsg.create(
15131513 module.gpa,
15141514 decl.src(),
1515 "unable to generate C header: {}",
1515 "unable to generate C header: {s}",
15161516 .{@errorName(err)},
15171517 ));
15181518 decl.analysis = .codegen_failure_retryable;
......@@ -1593,7 +1593,7 @@ pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemor
15931593 .libtsan => {
15941594 libtsan.buildTsan(self) catch |err| {
15951595 // TODO Expose this as a normal compile error rather than crashing here.
1596 fatal("unable to build TSAN library: {}", .{@errorName(err)});
1596 fatal("unable to build TSAN library: {s}", .{@errorName(err)});
15971597 };
15981598 },
15991599 .compiler_rt_lib => {
......@@ -1983,7 +1983,7 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_comp_progress_node: *
19831983 // TODO parse clang stderr and turn it into an error message
19841984 // and then call failCObjWithOwnedErrorMsg
19851985 log.err("clang failed with stderr: {s}", .{stderr});
1986 return comp.failCObj(c_object, "clang exited with code {}", .{code});
1986 return comp.failCObj(c_object, "clang exited with code {d}", .{code});
19871987 }
19881988 },
19891989 else => {
......@@ -3013,7 +3013,7 @@ fn updateStage1Module(comp: *Compilation, main_progress_node: *std.Progress.Node
30133013 id_symlink_basename,
30143014 &prev_digest_buf,
30153015 ) catch |err| blk: {
3016 log.debug("stage1 {} new_digest={} error: {s}", .{ mod.root_pkg.root_src_path, digest, @errorName(err) });
3016 log.debug("stage1 {s} new_digest={} error: {s}", .{ mod.root_pkg.root_src_path, digest, @errorName(err) });
30173017 // Handle this as a cache miss.
30183018 break :blk prev_digest_buf[0..0];
30193019 };
......@@ -3021,7 +3021,7 @@ fn updateStage1Module(comp: *Compilation, main_progress_node: *std.Progress.Node
30213021 if (!mem.eql(u8, prev_digest[0..digest.len], &digest))
30223022 break :hit;
30233023
3024 log.debug("stage1 {} digest={} match - skipping invocation", .{ mod.root_pkg.root_src_path, digest });
3024 log.debug("stage1 {s} digest={} match - skipping invocation", .{ mod.root_pkg.root_src_path, digest });
30253025 var flags_bytes: [1]u8 = undefined;
30263026 _ = std.fmt.hexToBytes(&flags_bytes, prev_digest[digest.len..]) catch {
30273027 log.warn("bad cache stage1 digest: '{s}'", .{prev_digest});
......@@ -3044,7 +3044,7 @@ fn updateStage1Module(comp: *Compilation, main_progress_node: *std.Progress.Node
30443044 mod.stage1_flags = @bitCast(@TypeOf(mod.stage1_flags), flags_bytes[0]);
30453045 return;
30463046 }
3047 log.debug("stage1 {} prev_digest={} new_digest={}", .{ mod.root_pkg.root_src_path, prev_digest, digest });
3047 log.debug("stage1 {s} prev_digest={} new_digest={}", .{ mod.root_pkg.root_src_path, prev_digest, digest });
30483048 man.unhit(prev_hash_state, input_file_count);
30493049 }
30503050
src/DepTokenizer.zig+3-3
......@@ -373,7 +373,7 @@ pub const Token = union(enum) {
373373 } else {
374374 try printCharValues(writer, index_and_bytes.bytes);
375375 }
376 try writer.print("' at position {}", .{index_and_bytes.index});
376 try writer.print("' at position {d}", .{index_and_bytes.index});
377377 },
378378 .invalid_target,
379379 .bad_target_escape,
......@@ -383,7 +383,7 @@ pub const Token = union(enum) {
383383 => |index_and_char| {
384384 try writer.writeAll("illegal char ");
385385 try printUnderstandableChar(writer, index_and_char.char);
386 try writer.print(" at position {}: {s}", .{ index_and_char.index, self.errStr() });
386 try writer.print(" at position {d}: {s}", .{ index_and_char.index, self.errStr() });
387387 },
388388 }
389389 }
......@@ -943,7 +943,7 @@ fn printSection(out: anytype, label: []const u8, bytes: []const u8) !void {
943943
944944fn printLabel(out: anytype, label: []const u8, bytes: []const u8) !void {
945945 var buf: [80]u8 = undefined;
946 var text = try std.fmt.bufPrint(buf[0..], "{s} {} bytes ", .{ label, bytes.len });
946 var text = try std.fmt.bufPrint(buf[0..], "{s} {d} bytes ", .{ label, bytes.len });
947947 try out.writeAll(text);
948948 var i: usize = text.len;
949949 const end = 79;
src/Module.zig+11-11
......@@ -248,7 +248,7 @@ pub const Decl = struct {
248248
249249 pub fn dump(self: *Decl) void {
250250 const loc = std.zig.findLineColumn(self.scope.source.bytes, self.src);
251 std.debug.print("{}:{}:{} name={} status={}", .{
251 std.debug.print("{s}:{d}:{d} name={s} status={s}", .{
252252 self.scope.sub_file_path,
253253 loc.line + 1,
254254 loc.column + 1,
......@@ -308,7 +308,7 @@ pub const Fn = struct {
308308
309309 /// For debugging purposes.
310310 pub fn dump(self: *Fn, mod: Module) void {
311 std.debug.print("Module.Function(name={}) ", .{self.owner_decl.name});
311 std.debug.print("Module.Function(name={s}) ", .{self.owner_decl.name});
312312 switch (self.analysis) {
313313 .queued => {
314314 std.debug.print("queued\n", .{});
......@@ -632,7 +632,7 @@ pub const Scope = struct {
632632
633633 pub fn dumpSrc(self: *File, src: usize) void {
634634 const loc = std.zig.findLineColumn(self.source.bytes, src);
635 std.debug.print("{}:{}:{}\n", .{ self.sub_file_path, loc.line + 1, loc.column + 1 });
635 std.debug.print("{s}:{d}:{d}\n", .{ self.sub_file_path, loc.line + 1, loc.column + 1 });
636636 }
637637
638638 pub fn getSource(self: *File, module: *Module) ![:0]const u8 {
......@@ -730,7 +730,7 @@ pub const Scope = struct {
730730
731731 pub fn dumpSrc(self: *ZIRModule, src: usize) void {
732732 const loc = std.zig.findLineColumn(self.source.bytes, src);
733 std.debug.print("{}:{}:{}\n", .{ self.sub_file_path, loc.line + 1, loc.column + 1 });
733 std.debug.print("{s}:{d}:{d}\n", .{ self.sub_file_path, loc.line + 1, loc.column + 1 });
734734 }
735735
736736 pub fn getSource(self: *ZIRModule, module: *Module) ![:0]const u8 {
......@@ -1641,7 +1641,7 @@ pub fn analyzeContainer(self: *Module, container_scope: *Scope.Container) !void
16411641 }
16421642 } else if (src_decl.castTag(.Comptime)) |comptime_node| {
16431643 const name_index = self.getNextAnonNameIndex();
1644 const name = try std.fmt.allocPrint(self.gpa, "__comptime_{}", .{name_index});
1644 const name = try std.fmt.allocPrint(self.gpa, "__comptime_{d}", .{name_index});
16451645 defer self.gpa.free(name);
16461646
16471647 const name_hash = container_scope.fullyQualifiedNameHash(name);
......@@ -2277,7 +2277,7 @@ pub fn createAnonymousDecl(
22772277) !*Decl {
22782278 const name_index = self.getNextAnonNameIndex();
22792279 const scope_decl = scope.decl().?;
2280 const name = try std.fmt.allocPrint(self.gpa, "{s}__anon_{}", .{ scope_decl.name, name_index });
2280 const name = try std.fmt.allocPrint(self.gpa, "{s}__anon_{d}", .{ scope_decl.name, name_index });
22812281 defer self.gpa.free(name);
22822282 const name_hash = scope.namespace().fullyQualifiedNameHash(name);
22832283 const src_hash: std.zig.SrcHash = undefined;
......@@ -2555,7 +2555,7 @@ pub fn cmpNumeric(
25552555
25562556 if (lhs_ty_tag == .Vector and rhs_ty_tag == .Vector) {
25572557 if (lhs.ty.arrayLen() != rhs.ty.arrayLen()) {
2558 return self.fail(scope, src, "vector length mismatch: {} and {}", .{
2558 return self.fail(scope, src, "vector length mismatch: {d} and {d}", .{
25592559 lhs.ty.arrayLen(),
25602560 rhs.ty.arrayLen(),
25612561 });
......@@ -2700,7 +2700,7 @@ pub fn cmpNumeric(
27002700 const dest_type = if (dest_float_type) |ft| ft else blk: {
27012701 const max_bits = std.math.max(lhs_bits, rhs_bits);
27022702 const casted_bits = std.math.cast(u16, max_bits) catch |err| switch (err) {
2703 error.Overflow => return self.fail(scope, src, "{} exceeds maximum integer bit count", .{max_bits}),
2703 error.Overflow => return self.fail(scope, src, "{d} exceeds maximum integer bit count", .{max_bits}),
27042704 };
27052705 break :blk try self.makeIntType(scope, dest_int_is_signed, casted_bits);
27062706 };
......@@ -3319,7 +3319,7 @@ pub fn dumpInst(self: *Module, scope: *Scope, inst: *Inst) void {
33193319 const source = zir_module.getSource(self) catch @panic("dumpInst failed to get source");
33203320 const loc = std.zig.findLineColumn(source, inst.src);
33213321 if (inst.tag == .constant) {
3322 std.debug.print("constant ty={} val={} src={}:{}:{}\n", .{
3322 std.debug.print("constant ty={} val={} src={s}:{d}:{d}\n", .{
33233323 inst.ty,
33243324 inst.castTag(.constant).?.val,
33253325 zir_module.subFilePath(),
......@@ -3327,7 +3327,7 @@ pub fn dumpInst(self: *Module, scope: *Scope, inst: *Inst) void {
33273327 loc.column + 1,
33283328 });
33293329 } else if (inst.deaths == 0) {
3330 std.debug.print("{} ty={} src={}:{}:{}\n", .{
3330 std.debug.print("{s} ty={} src={s}:{d}:{d}\n", .{
33313331 @tagName(inst.tag),
33323332 inst.ty,
33333333 zir_module.subFilePath(),
......@@ -3335,7 +3335,7 @@ pub fn dumpInst(self: *Module, scope: *Scope, inst: *Inst) void {
33353335 loc.column + 1,
33363336 });
33373337 } else {
3338 std.debug.print("{} ty={} deaths={b} src={}:{}:{}\n", .{
3338 std.debug.print("{s} ty={} deaths={b} src={s}:{d}:{d}\n", .{
33393339 @tagName(inst.tag),
33403340 inst.ty,
33413341 inst.deaths,
src/astgen.zig+3-3
......@@ -385,7 +385,7 @@ fn breakExpr(mod: *Module, parent_scope: *Scope, node: *ast.Node.ControlFlowExpr
385385 .local_ptr => scope = scope.cast(Scope.LocalPtr).?.parent,
386386 else => if (node.getLabel()) |break_label| {
387387 const label_name = try identifierTokenString(mod, parent_scope, break_label);
388 return mod.failTok(parent_scope, break_label, "label not found: '{}'", .{label_name});
388 return mod.failTok(parent_scope, break_label, "label not found: '{s}'", .{label_name});
389389 } else {
390390 return mod.failTok(parent_scope, src, "break expression outside loop", .{});
391391 },
......@@ -427,7 +427,7 @@ fn continueExpr(mod: *Module, parent_scope: *Scope, node: *ast.Node.ControlFlowE
427427 .local_ptr => scope = scope.cast(Scope.LocalPtr).?.parent,
428428 else => if (node.getLabel()) |break_label| {
429429 const label_name = try identifierTokenString(mod, parent_scope, break_label);
430 return mod.failTok(parent_scope, break_label, "label not found: '{}'", .{label_name});
430 return mod.failTok(parent_scope, break_label, "label not found: '{s}'", .{label_name});
431431 } else {
432432 return mod.failTok(parent_scope, src, "continue expression outside loop", .{});
433433 },
......@@ -2204,7 +2204,7 @@ fn ensureBuiltinParamCount(mod: *Module, scope: *Scope, call: *ast.Node.BuiltinC
22042204 return;
22052205
22062206 const s = if (count == 1) "" else "s";
2207 return mod.failTok(scope, call.builtin_token, "expected {} parameter{s}, found {}", .{ count, s, call.params_len });
2207 return mod.failTok(scope, call.builtin_token, "expected {d} parameter{s}, found {d}", .{ count, s, call.params_len });
22082208}
22092209
22102210fn simpleCast(
src/codegen/c.zig+3-3
......@@ -383,7 +383,7 @@ const Context = struct {
383383 }
384384
385385 fn name(self: *Context) ![]u8 {
386 const val = try std.fmt.allocPrint(&self.arena.allocator, "__temp_{}", .{self.unnamed_index});
386 const val = try std.fmt.allocPrint(&self.arena.allocator, "__temp_{d}", .{self.unnamed_index});
387387 self.unnamed_index += 1;
388388 return val;
389389 }
......@@ -420,7 +420,7 @@ fn genAlloc(ctx: *Context, file: *C, alloc: *Inst.NoOp) !?[]u8 {
420420}
421421
422422fn genArg(ctx: *Context) !?[]u8 {
423 const name = try std.fmt.allocPrint(&ctx.arena.allocator, "arg{}", .{ctx.argdex});
423 const name = try std.fmt.allocPrint(&ctx.arena.allocator, "arg{d}", .{ctx.argdex});
424424 ctx.argdex += 1;
425425 return name;
426426}
......@@ -528,7 +528,7 @@ fn genCall(ctx: *Context, file: *C, inst: *Inst.Call) !?[]u8 {
528528 try renderValue(ctx, writer, arg.ty, val);
529529 } else {
530530 const val = try ctx.resolveInst(arg);
531 try writer.print("{}", .{val});
531 try writer.print("{s}", .{val});
532532 }
533533 }
534534 }
src/glibc.zig+14-14
......@@ -111,12 +111,12 @@ pub fn loadMetaData(gpa: *Allocator, zig_lib_dir: std.fs.Dir) LoadMetaDataError!
111111 while (it.next()) |line| : (line_i += 1) {
112112 const prefix = "GLIBC_";
113113 if (!mem.startsWith(u8, line, prefix)) {
114 std.log.err("vers.txt:{}: expected 'GLIBC_' prefix", .{line_i});
114 std.log.err("vers.txt:{d}: expected 'GLIBC_' prefix", .{line_i});
115115 return error.ZigInstallationCorrupt;
116116 }
117117 const adjusted_line = line[prefix.len..];
118118 const ver = std.builtin.Version.parse(adjusted_line) catch |err| {
119 std.log.err("vers.txt:{}: unable to parse glibc version '{s}': {s}", .{ line_i, line, @errorName(err) });
119 std.log.err("vers.txt:{d}: unable to parse glibc version '{s}': {s}", .{ line_i, line, @errorName(err) });
120120 return error.ZigInstallationCorrupt;
121121 };
122122 try all_versions.append(arena, ver);
......@@ -128,15 +128,15 @@ pub fn loadMetaData(gpa: *Allocator, zig_lib_dir: std.fs.Dir) LoadMetaDataError!
128128 while (file_it.next()) |line| : (line_i += 1) {
129129 var line_it = mem.tokenize(line, " ");
130130 const fn_name = line_it.next() orelse {
131 std.log.err("fns.txt:{}: expected function name", .{line_i});
131 std.log.err("fns.txt:{d}: expected function name", .{line_i});
132132 return error.ZigInstallationCorrupt;
133133 };
134134 const lib_name = line_it.next() orelse {
135 std.log.err("fns.txt:{}: expected library name", .{line_i});
135 std.log.err("fns.txt:{d}: expected library name", .{line_i});
136136 return error.ZigInstallationCorrupt;
137137 };
138138 const lib = findLib(lib_name) orelse {
139 std.log.err("fns.txt:{}: unknown library name: {s}", .{ line_i, lib_name });
139 std.log.err("fns.txt:{d}: unknown library name: {s}", .{ line_i, lib_name });
140140 return error.ZigInstallationCorrupt;
141141 };
142142 try all_functions.append(arena, .{
......@@ -158,27 +158,27 @@ pub fn loadMetaData(gpa: *Allocator, zig_lib_dir: std.fs.Dir) LoadMetaDataError!
158158 while (line_it.next()) |target_string| {
159159 var component_it = mem.tokenize(target_string, "-");
160160 const arch_name = component_it.next() orelse {
161 std.log.err("abi.txt:{}: expected arch name", .{line_i});
161 std.log.err("abi.txt:{d}: expected arch name", .{line_i});
162162 return error.ZigInstallationCorrupt;
163163 };
164164 const os_name = component_it.next() orelse {
165 std.log.err("abi.txt:{}: expected OS name", .{line_i});
165 std.log.err("abi.txt:{d}: expected OS name", .{line_i});
166166 return error.ZigInstallationCorrupt;
167167 };
168168 const abi_name = component_it.next() orelse {
169 std.log.err("abi.txt:{}: expected ABI name", .{line_i});
169 std.log.err("abi.txt:{d}: expected ABI name", .{line_i});
170170 return error.ZigInstallationCorrupt;
171171 };
172172 const arch_tag = std.meta.stringToEnum(std.Target.Cpu.Arch, arch_name) orelse {
173 std.log.err("abi.txt:{}: unrecognized arch: '{s}'", .{ line_i, arch_name });
173 std.log.err("abi.txt:{d}: unrecognized arch: '{s}'", .{ line_i, arch_name });
174174 return error.ZigInstallationCorrupt;
175175 };
176176 if (!mem.eql(u8, os_name, "linux")) {
177 std.log.err("abi.txt:{}: expected OS 'linux', found '{s}'", .{ line_i, os_name });
177 std.log.err("abi.txt:{d}: expected OS 'linux', found '{s}'", .{ line_i, os_name });
178178 return error.ZigInstallationCorrupt;
179179 }
180180 const abi_tag = std.meta.stringToEnum(std.Target.Abi, abi_name) orelse {
181 std.log.err("abi.txt:{}: unrecognized ABI: '{s}'", .{ line_i, abi_name });
181 std.log.err("abi.txt:{d}: unrecognized ABI: '{s}'", .{ line_i, abi_name });
182182 return error.ZigInstallationCorrupt;
183183 };
184184
......@@ -193,7 +193,7 @@ pub fn loadMetaData(gpa: *Allocator, zig_lib_dir: std.fs.Dir) LoadMetaDataError!
193193 };
194194 for (ver_list_base) |*ver_list| {
195195 const line = file_it.next() orelse {
196 std.log.err("abi.txt:{}: missing version number line", .{line_i});
196 std.log.err("abi.txt:{d}: missing version number line", .{line_i});
197197 return error.ZigInstallationCorrupt;
198198 };
199199 line_i += 1;
......@@ -206,12 +206,12 @@ pub fn loadMetaData(gpa: *Allocator, zig_lib_dir: std.fs.Dir) LoadMetaDataError!
206206 while (line_it.next()) |version_index_string| {
207207 if (ver_list.len >= ver_list.versions.len) {
208208 // If this happens with legit data, increase the array len in the type.
209 std.log.err("abi.txt:{}: too many versions", .{line_i});
209 std.log.err("abi.txt:{d}: too many versions", .{line_i});
210210 return error.ZigInstallationCorrupt;
211211 }
212212 const version_index = std.fmt.parseInt(u8, version_index_string, 10) catch |err| {
213213 // If this happens with legit data, increase the size of the integer type in the struct.
214 std.log.err("abi.txt:{}: unable to parse version: {s}", .{ line_i, @errorName(err) });
214 std.log.err("abi.txt:{d}: unable to parse version: {s}", .{ line_i, @errorName(err) });
215215 return error.ZigInstallationCorrupt;
216216 };
217217
src/link.zig+1-1
......@@ -523,7 +523,7 @@ pub const File = struct {
523523 id_symlink_basename,
524524 &prev_digest_buf,
525525 ) catch |err| b: {
526 log.debug("archive new_digest={} readFile error: {}", .{ digest, @errorName(err) });
526 log.debug("archive new_digest={} readFile error: {s}", .{ digest, @errorName(err) });
527527 break :b prev_digest_buf[0..0];
528528 };
529529 if (mem.eql(u8, prev_digest, &digest)) {
src/link/Elf.zig+3-3
......@@ -2082,10 +2082,10 @@ pub fn allocateDeclIndexes(self: *Elf, decl: *Module.Decl) !void {
20822082 try self.offset_table.ensureCapacity(self.base.allocator, self.offset_table.items.len + 1);
20832083
20842084 if (self.local_symbol_free_list.popOrNull()) |i| {
2085 log.debug("reusing symbol index {} for {s}\n", .{ i, decl.name });
2085 log.debug("reusing symbol index {d} for {s}\n", .{ i, decl.name });
20862086 decl.link.elf.local_sym_index = i;
20872087 } else {
2088 log.debug("allocating symbol index {} for {s}\n", .{ self.local_symbols.items.len, decl.name });
2088 log.debug("allocating symbol index {d} for {s}\n", .{ self.local_symbols.items.len, decl.name });
20892089 decl.link.elf.local_sym_index = @intCast(u32, self.local_symbols.items.len);
20902090 _ = self.local_symbols.addOneAssumeCapacity();
20912091 }
......@@ -2432,7 +2432,7 @@ pub fn updateDecl(self: *Elf, module: *Module, decl: *Module.Decl) !void {
24322432 if (needed_size > self.allocatedSize(debug_line_sect.sh_offset)) {
24332433 const new_offset = self.findFreeSpace(needed_size, 1);
24342434 const existing_size = last_src_fn.off;
2435 log.debug("moving .debug_line section: {} bytes from 0x{x} to 0x{x}\n", .{
2435 log.debug("moving .debug_line section: {d} bytes from 0x{x} to 0x{x}\n", .{
24362436 existing_size,
24372437 debug_line_sect.sh_offset,
24382438 new_offset,
src/liveness.zig+2-1
......@@ -1,6 +1,7 @@
11const std = @import("std");
22const ir = @import("ir.zig");
33const trace = @import("tracy.zig").trace;
4const log = std.log.scoped(.liveness);
45
56/// Perform Liveness Analysis over the `Body`. Each `Inst` will have its `deaths` field populated.
67pub fn analyze(
......@@ -248,5 +249,5 @@ fn analyzeInst(
248249 @panic("Handle liveness analysis for instructions with many parameters");
249250 }
250251
251 std.log.scoped(.liveness).debug("analyze {}: 0b{b}\n", .{ base.tag, base.deaths });
252 log.debug("analyze {}: 0b{b}\n", .{ base.tag, base.deaths });
252253}
src/main.zig+7-7
......@@ -626,7 +626,7 @@ fn buildOutputType(
626626 fs.path.dirname(pkg_path),
627627 fs.path.basename(pkg_path),
628628 ) catch |err| {
629 fatal("Failed to add package at path {}: {}", .{ pkg_path, @errorName(err) });
629 fatal("Failed to add package at path {s}: {s}", .{ pkg_path, @errorName(err) });
630630 };
631631 new_cur_pkg.parent = cur_pkg;
632632 try cur_pkg.add(gpa, pkg_name, new_cur_pkg);
......@@ -696,13 +696,13 @@ fn buildOutputType(
696696 if (i + 1 >= args.len) fatal("expected parameter after {s}", .{arg});
697697 i += 1;
698698 stack_size_override = std.fmt.parseUnsigned(u64, args[i], 0) catch |err| {
699 fatal("unable to parse '{}': {}", .{ arg, @errorName(err) });
699 fatal("unable to parse '{s}': {s}", .{ arg, @errorName(err) });
700700 };
701701 } else if (mem.eql(u8, arg, "--image-base")) {
702702 if (i + 1 >= args.len) fatal("expected parameter after {s}", .{arg});
703703 i += 1;
704704 image_base_override = std.fmt.parseUnsigned(u64, args[i], 0) catch |err| {
705 fatal("unable to parse '{}': {}", .{ arg, @errorName(err) });
705 fatal("unable to parse '{s}': {s}", .{ arg, @errorName(err) });
706706 };
707707 } else if (mem.eql(u8, arg, "--name")) {
708708 if (i + 1 >= args.len) fatal("expected parameter after {s}", .{arg});
......@@ -1914,7 +1914,7 @@ fn buildOutputType(
19141914 if (!watch) return cleanExit();
19151915 } else {
19161916 const cmd = try argvCmd(arena, argv.items);
1917 fatal("the following test command failed with exit code {}:\n{s}", .{ code, cmd });
1917 fatal("the following test command failed with exit code {d}:\n{s}", .{ code, cmd });
19181918 }
19191919 },
19201920 else => {
......@@ -2069,7 +2069,7 @@ fn cmdTranslateC(comp: *Compilation, arena: *Allocator, enable_cache: bool) !voi
20692069 error.ASTUnitFailure => fatal("clang API returned errors but due to a clang bug, it is not exposing the errors for zig to see. For more details: https://github.com/ziglang/zig/issues/4455", .{}),
20702070 error.SemanticAnalyzeFail => {
20712071 for (clang_errors) |clang_err| {
2072 std.debug.print("{s}:{}:{}: {s}\n", .{
2072 std.debug.print("{s}:{d}:{d}: {s}\n", .{
20732073 if (clang_err.filename_ptr) |p| p[0..clang_err.filename_len] else "(no file)",
20742074 clang_err.line + 1,
20752075 clang_err.column + 1,
......@@ -2493,7 +2493,7 @@ pub fn cmdBuild(gpa: *Allocator, arena: *Allocator, args: []const []const u8) !v
24932493 .Exited => |code| {
24942494 if (code == 0) return cleanExit();
24952495 const cmd = try argvCmd(arena, child_argv);
2496 fatal("the following build command failed with exit code {}:\n{s}", .{ code, cmd });
2496 fatal("the following build command failed with exit code {d}:\n{s}", .{ code, cmd });
24972497 },
24982498 else => {
24992499 const cmd = try argvCmd(arena, child_argv);
......@@ -2812,7 +2812,7 @@ fn printErrMsgToFile(
28122812 const text = text_buf.items;
28132813
28142814 const stream = file.outStream();
2815 try stream.print("{s}:{}:{}: error: {s}\n", .{ path, start_loc.line + 1, start_loc.column + 1, text });
2815 try stream.print("{s}:{d}:{d}: error: {s}\n", .{ path, start_loc.line + 1, start_loc.column + 1, text });
28162816
28172817 if (!color_on) return;
28182818
src/translate_c.zig+9-9
......@@ -136,7 +136,7 @@ const Scope = struct {
136136 var proposed_name = name_copy;
137137 while (scope.contains(proposed_name)) {
138138 scope.mangle_count += 1;
139 proposed_name = try std.fmt.allocPrint(c.arena, "{s}_{}", .{ name, scope.mangle_count });
139 proposed_name = try std.fmt.allocPrint(c.arena, "{s}_{d}", .{ name, scope.mangle_count });
140140 }
141141 try scope.variables.append(.{ .name = name_copy, .alias = proposed_name });
142142 return proposed_name;
......@@ -440,7 +440,7 @@ pub fn translate(
440440 mem.copy(*ast.Node, root_node.decls(), context.root_decls.items);
441441
442442 if (false) {
443 std.debug.warn("debug source:\n{}\n==EOF==\ntokens:\n", .{source_buffer.items});
443 std.debug.warn("debug source:\n{s}\n==EOF==\ntokens:\n", .{source_buffer.items});
444444 for (context.token_ids.items) |token| {
445445 std.debug.warn("{}\n", .{token});
446446 }
......@@ -945,7 +945,7 @@ fn transRecordDecl(c: *Context, record_decl: *const clang.RecordDecl) Error!?*as
945945 // Record declarations such as `struct {...} x` have no name but they're not
946946 // anonymous hence here isAnonymousStructOrUnion is not needed
947947 if (bare_name.len == 0) {
948 bare_name = try std.fmt.allocPrint(c.arena, "unnamed_{}", .{c.getMangle()});
948 bare_name = try std.fmt.allocPrint(c.arena, "unnamed_{d}", .{c.getMangle()});
949949 is_unnamed = true;
950950 }
951951
......@@ -1019,7 +1019,7 @@ fn transRecordDecl(c: *Context, record_decl: *const clang.RecordDecl) Error!?*as
10191019 var raw_name = try c.str(@ptrCast(*const clang.NamedDecl, field_decl).getName_bytes_begin());
10201020 if (field_decl.isAnonymousStructOrUnion() or raw_name.len == 0) {
10211021 // Context.getMangle() is not used here because doing so causes unpredictable field names for anonymous fields.
1022 raw_name = try std.fmt.allocPrint(c.arena, "unnamed_{}", .{unnamed_field_count});
1022 raw_name = try std.fmt.allocPrint(c.arena, "unnamed_{d}", .{unnamed_field_count});
10231023 unnamed_field_count += 1;
10241024 is_anon = true;
10251025 }
......@@ -1110,7 +1110,7 @@ fn transEnumDecl(c: *Context, enum_decl: *const clang.EnumDecl) Error!?*ast.Node
11101110 var bare_name = try c.str(@ptrCast(*const clang.NamedDecl, enum_decl).getName_bytes_begin());
11111111 var is_unnamed = false;
11121112 if (bare_name.len == 0) {
1113 bare_name = try std.fmt.allocPrint(c.arena, "unnamed_{}", .{c.getMangle()});
1113 bare_name = try std.fmt.allocPrint(c.arena, "unnamed_{d}", .{c.getMangle()});
11141114 is_unnamed = true;
11151115 }
11161116
......@@ -3956,7 +3956,7 @@ fn qualTypeToLog2IntRef(rp: RestorePoint, qt: clang.QualType, source_loc: clang.
39563956 const node = try rp.c.arena.create(ast.Node.OneToken);
39573957 node.* = .{
39583958 .base = .{ .tag = .IntegerLiteral },
3959 .token = try appendTokenFmt(rp.c, .Identifier, "u{}", .{cast_bit_width}),
3959 .token = try appendTokenFmt(rp.c, .Identifier, "u{d}", .{cast_bit_width}),
39603960 };
39613961 return &node.base;
39623962 }
......@@ -4484,7 +4484,7 @@ fn transCreateNodeMacroFn(c: *Context, name: []const u8, ref: *ast.Node, proto_a
44844484 _ = try appendToken(c, .Comma, ",");
44854485 }
44864486 const param_name_tok = param.name_token orelse
4487 try appendTokenFmt(c, .Identifier, "arg_{}", .{c.getMangle()});
4487 try appendTokenFmt(c, .Identifier, "arg_{d}", .{c.getMangle()});
44884488
44894489 _ = try appendToken(c, .Colon, ":");
44904490
......@@ -5916,11 +5916,11 @@ fn parseCPrimaryExprInner(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!*
59165916 // struct Foo will be declared as struct_Foo by transRecordDecl
59175917 const next_id = m.next().?;
59185918 if (next_id != .Identifier) {
5919 try m.fail(c, "unable to translate C expr: expected Identifier instead got: {}", .{@tagName(next_id)});
5919 try m.fail(c, "unable to translate C expr: expected Identifier instead got: {s}", .{@tagName(next_id)});
59205920 return error.ParseError;
59215921 }
59225922
5923 const ident_token = try appendTokenFmt(c, .Identifier, "{}_{}", .{ slice, m.slice() });
5923 const ident_token = try appendTokenFmt(c, .Identifier, "{s}_{s}", .{ slice, m.slice() });
59245924 const identifier = try c.arena.create(ast.Node.OneToken);
59255925 identifier.* = .{
59265926 .base = .{ .tag = .Identifier },
src/type.zig+4-4
......@@ -558,21 +558,21 @@ pub const Type = extern union {
558558 },
559559 .array_u8 => {
560560 const len = ty.castTag(.array_u8).?.data;
561 return out_stream.print("[{}]u8", .{len});
561 return out_stream.print("[{d}]u8", .{len});
562562 },
563563 .array_u8_sentinel_0 => {
564564 const len = ty.castTag(.array_u8_sentinel_0).?.data;
565 return out_stream.print("[{}:0]u8", .{len});
565 return out_stream.print("[{d}:0]u8", .{len});
566566 },
567567 .array => {
568568 const payload = ty.castTag(.array).?.data;
569 try out_stream.print("[{}]", .{payload.len});
569 try out_stream.print("[{d}]", .{payload.len});
570570 ty = payload.elem_type;
571571 continue;
572572 },
573573 .array_sentinel => {
574574 const payload = ty.castTag(.array_sentinel).?.data;
575 try out_stream.print("[{}:{}]", .{ payload.len, payload.sentinel });
575 try out_stream.print("[{d}:{}]", .{ payload.len, payload.sentinel });
576576 ty = payload.elem_type;
577577 continue;
578578 },
src/zir.zig+9-10
......@@ -1257,12 +1257,12 @@ const Writer = struct {
12571257 self.next_instr_index += 1;
12581258 try self.inst_table.putNoClobber(inst, .{ .inst = inst, .index = my_i, .name = undefined });
12591259 try stream.writeByteNTimes(' ', self.indent);
1260 try stream.print("%{} ", .{my_i});
1260 try stream.print("%{d} ", .{my_i});
12611261 if (inst.cast(Inst.Block)) |block| {
1262 const name = try std.fmt.allocPrint(&self.arena.allocator, "label_{}", .{my_i});
1262 const name = try std.fmt.allocPrint(&self.arena.allocator, "label_{d}", .{my_i});
12631263 try self.block_table.put(block, name);
12641264 } else if (inst.cast(Inst.Loop)) |loop| {
1265 const name = try std.fmt.allocPrint(&self.arena.allocator, "loop_{}", .{my_i});
1265 const name = try std.fmt.allocPrint(&self.arena.allocator, "loop_{d}", .{my_i});
12661266 try self.loop_table.put(loop, name);
12671267 }
12681268 self.indent += 2;
......@@ -1332,7 +1332,7 @@ const Writer = struct {
13321332 fn writeInstParamToStream(self: *Writer, stream: anytype, inst: *Inst) !void {
13331333 if (self.inst_table.get(inst)) |info| {
13341334 if (info.index) |i| {
1335 try stream.print("%{}", .{info.index});
1335 try stream.print("%{d}", .{info.index});
13361336 } else {
13371337 try stream.print("@{s}", .{info.name});
13381338 }
......@@ -1660,7 +1660,6 @@ const Parser = struct {
16601660 .contents_hash = std.zig.hashSrc(self.source[contents_start..self.i]),
16611661 .inst = &inst_specific.base,
16621662 };
1663 //std.debug.warn("parsed {} = '{}'\n", .{ inst_specific.base.name, inst_specific.base.contents });
16641663
16651664 return decl;
16661665 }
......@@ -1805,7 +1804,7 @@ const Parser = struct {
18051804 }
18061805
18071806 fn generateName(self: *Parser) ![]u8 {
1808 const result = try std.fmt.allocPrint(&self.arena.allocator, "unnamed${}", .{self.unnamed_index});
1807 const result = try std.fmt.allocPrint(&self.arena.allocator, "unnamed${d}", .{self.unnamed_index});
18091808 self.unnamed_index += 1;
18101809 return result;
18111810 }
......@@ -2865,7 +2864,7 @@ const EmitZIR = struct {
28652864
28662865 fn autoName(self: *EmitZIR) ![]u8 {
28672866 while (true) {
2868 const proposed_name = try std.fmt.allocPrint(&self.arena.allocator, "unnamed${}", .{self.next_auto_name});
2867 const proposed_name = try std.fmt.allocPrint(&self.arena.allocator, "unnamed${d}", .{self.next_auto_name});
28692868 self.next_auto_name += 1;
28702869 const gop = try self.names.getOrPut(proposed_name);
28712870 if (!gop.found_existing) {
......@@ -2954,15 +2953,15 @@ pub fn dumpZir(allocator: *Allocator, kind: []const u8, decl_name: [*:0]const u8
29542953 write.next_instr_index += 1;
29552954
29562955 if (inst.cast(Inst.Block)) |block| {
2957 const name = try std.fmt.allocPrint(&write.arena.allocator, "label_{}", .{my_i});
2956 const name = try std.fmt.allocPrint(&write.arena.allocator, "label_{d}", .{my_i});
29582957 try write.block_table.put(block, name);
29592958 } else if (inst.cast(Inst.Loop)) |loop| {
2960 const name = try std.fmt.allocPrint(&write.arena.allocator, "loop_{}", .{my_i});
2959 const name = try std.fmt.allocPrint(&write.arena.allocator, "loop_{d}", .{my_i});
29612960 try write.loop_table.put(loop, name);
29622961 }
29632962
29642963 try write.inst_table.putNoClobber(inst, .{ .inst = inst, .index = my_i, .name = "inst" });
2965 try stderr.print(" %{} ", .{my_i});
2964 try stderr.print(" %{d} ", .{my_i});
29662965 try write.writeInstToStream(stderr, inst);
29672966 try stderr.writeByte('\n');
29682967 }
src/zir_sema.zig+7-7
......@@ -535,7 +535,7 @@ fn analyzeInstParamType(mod: *Module, scope: *Scope, inst: *zir.Inst.ParamType)
535535 // TODO support C-style var args
536536 const param_count = fn_ty.fnParamLen();
537537 if (arg_index >= param_count) {
538 return mod.fail(scope, inst.base.src, "arg index {} out of bounds; '{}' has {} argument(s)", .{
538 return mod.fail(scope, inst.base.src, "arg index {d} out of bounds; '{}' has {d} argument(s)", .{
539539 arg_index,
540540 fn_ty,
541541 param_count,
......@@ -580,7 +580,7 @@ fn analyzeInstArg(mod: *Module, scope: *Scope, inst: *zir.Inst.Arg) InnerError!*
580580 const param_index = b.instructions.items.len;
581581 const param_count = fn_ty.fnParamLen();
582582 if (param_index >= param_count) {
583 return mod.fail(scope, inst.base.src, "parameter index {} outside list of length {}", .{
583 return mod.fail(scope, inst.base.src, "parameter index {d} outside list of length {d}", .{
584584 param_index,
585585 param_count,
586586 });
......@@ -790,7 +790,7 @@ fn analyzeInstCall(mod: *Module, scope: *Scope, inst: *zir.Inst.Call) InnerError
790790 return mod.fail(
791791 scope,
792792 inst.positionals.func.src,
793 "expected at least {} argument(s), found {}",
793 "expected at least {d} argument(s), found {d}",
794794 .{ fn_params_len, call_params_len },
795795 );
796796 }
......@@ -800,7 +800,7 @@ fn analyzeInstCall(mod: *Module, scope: *Scope, inst: *zir.Inst.Call) InnerError
800800 return mod.fail(
801801 scope,
802802 inst.positionals.func.src,
803 "expected {} argument(s), found {}",
803 "expected {d} argument(s), found {d}",
804804 .{ fn_params_len, call_params_len },
805805 );
806806 }
......@@ -1545,7 +1545,7 @@ fn analyzeInstBitwise(mod: *Module, scope: *Scope, inst: *zir.Inst.BinOp) InnerE
15451545
15461546 if (lhs.ty.zigTypeTag() == .Vector and rhs.ty.zigTypeTag() == .Vector) {
15471547 if (lhs.ty.arrayLen() != rhs.ty.arrayLen()) {
1548 return mod.fail(scope, inst.base.src, "vector length mismatch: {} and {}", .{
1548 return mod.fail(scope, inst.base.src, "vector length mismatch: {d} and {d}", .{
15491549 lhs.ty.arrayLen(),
15501550 rhs.ty.arrayLen(),
15511551 });
......@@ -1620,7 +1620,7 @@ fn analyzeInstArithmetic(mod: *Module, scope: *Scope, inst: *zir.Inst.BinOp) Inn
16201620
16211621 if (lhs.ty.zigTypeTag() == .Vector and rhs.ty.zigTypeTag() == .Vector) {
16221622 if (lhs.ty.arrayLen() != rhs.ty.arrayLen()) {
1623 return mod.fail(scope, inst.base.src, "vector length mismatch: {} and {}", .{
1623 return mod.fail(scope, inst.base.src, "vector length mismatch: {d} and {d}", .{
16241624 lhs.ty.arrayLen(),
16251625 rhs.ty.arrayLen(),
16261626 });
......@@ -1791,7 +1791,7 @@ fn analyzeInstCmp(
17911791 return mod.cmpNumeric(scope, inst.base.src, lhs, rhs, op);
17921792 } else if (lhs_ty_tag == .Type and rhs_ty_tag == .Type) {
17931793 if (!is_equality_cmp) {
1794 return mod.fail(scope, inst.base.src, "{} operator not allowed for types", .{@tagName(op)});
1794 return mod.fail(scope, inst.base.src, "{s} operator not allowed for types", .{@tagName(op)});
17951795 }
17961796 return mod.constBool(scope, inst.base.src, lhs.value().?.eql(rhs.value().?) == (op == .eq));
17971797 }