authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-11-26 17:06:52+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-01-02 17:12:57-07:00
logd2f6fa1608f31cbd7137f81b5dd6df2977766eae
treefc4636cb8846a60995c353bbace342fc08544862
parent1ca2deca33e5ee489e12bd71a34ec3e4a2e1255f

Fix more stray uses of {} for formatting strings


5 files changed, 14 insertions(+), 13 deletions(-)

src/Module.zig+7-7
......@@ -918,7 +918,7 @@ pub fn ensureDeclAnalyzed(self: *Module, decl: *Decl) InnerError!void {
918918 .complete => return,
919919
920920 .outdated => blk: {
921 log.debug("re-analyzing {}\n", .{decl.name});
921 log.debug("re-analyzing {s}\n", .{decl.name});
922922
923923 // The exports this Decl performs will be re-discovered, so we remove them here
924924 // prior to re-analysis.
......@@ -1663,7 +1663,7 @@ pub fn analyzeContainer(self: *Module, container_scope: *Scope.Container) !void
16631663 // Handle explicitly deleted decls from the source code. Not to be confused
16641664 // with when we delete decls because they are no longer referenced.
16651665 for (deleted_decls.items()) |entry| {
1666 log.debug("noticed '{}' deleted from source\n", .{entry.key.name});
1666 log.debug("noticed '{s}' deleted from source\n", .{entry.key.name});
16671667 try self.deleteDecl(entry.key);
16681668 }
16691669}
......@@ -1716,7 +1716,7 @@ pub fn analyzeRootZIRModule(self: *Module, root_scope: *Scope.ZIRModule) !void {
17161716 // Handle explicitly deleted decls from the source code. Not to be confused
17171717 // with when we delete decls because they are no longer referenced.
17181718 for (deleted_decls.items()) |entry| {
1719 log.debug("noticed '{}' deleted from source\n", .{entry.key.name});
1719 log.debug("noticed '{s}' deleted from source\n", .{entry.key.name});
17201720 try self.deleteDecl(entry.key);
17211721 }
17221722}
......@@ -1728,7 +1728,7 @@ pub fn deleteDecl(self: *Module, decl: *Decl) !void {
17281728 // not be present in the set, and this does nothing.
17291729 decl.scope.removeDecl(decl);
17301730
1731 log.debug("deleting decl '{}'\n", .{decl.name});
1731 log.debug("deleting decl '{s}'\n", .{decl.name});
17321732 const name_hash = decl.fullyQualifiedNameHash();
17331733 self.decl_table.removeAssertDiscard(name_hash);
17341734 // Remove itself from its dependencies, because we are about to destroy the decl pointer.
......@@ -1819,17 +1819,17 @@ pub fn analyzeFnBody(self: *Module, decl: *Decl, func: *Fn) !void {
18191819 const fn_zir = func.analysis.queued;
18201820 defer fn_zir.arena.promote(self.gpa).deinit();
18211821 func.analysis = .{ .in_progress = {} };
1822 log.debug("set {} to in_progress\n", .{decl.name});
1822 log.debug("set {s} to in_progress\n", .{decl.name});
18231823
18241824 try zir_sema.analyzeBody(self, &inner_block.base, fn_zir.body);
18251825
18261826 const instructions = try arena.allocator.dupe(*Inst, inner_block.instructions.items);
18271827 func.analysis = .{ .success = .{ .instructions = instructions } };
1828 log.debug("set {} to success\n", .{decl.name});
1828 log.debug("set {s} to success\n", .{decl.name});
18291829}
18301830
18311831fn markOutdatedDecl(self: *Module, decl: *Decl) !void {
1832 log.debug("mark {} outdated\n", .{decl.name});
1832 log.debug("mark {s} outdated\n", .{decl.name});
18331833 try self.comp.work_queue.writeItem(.{ .analyze_decl = decl });
18341834 if (self.failed_decls.remove(decl)) |entry| {
18351835 entry.value.destroy(self.gpa);
src/link/Elf.zig+2-2
......@@ -2300,7 +2300,7 @@ pub fn updateDecl(self: *Elf, module: *Module, decl: *Module.Decl) !void {
23002300 !mem.isAlignedGeneric(u64, local_sym.st_value, required_alignment);
23012301 if (need_realloc) {
23022302 const vaddr = try self.growTextBlock(&decl.link.elf, code.len, required_alignment);
2303 log.debug("growing {} from 0x{x} to 0x{x}\n", .{ decl.name, local_sym.st_value, vaddr });
2303 log.debug("growing {s} from 0x{x} to 0x{x}\n", .{ decl.name, local_sym.st_value, vaddr });
23042304 if (vaddr != local_sym.st_value) {
23052305 local_sym.st_value = vaddr;
23062306
......@@ -2322,7 +2322,7 @@ pub fn updateDecl(self: *Elf, module: *Module, decl: *Module.Decl) !void {
23222322 const decl_name = mem.spanZ(decl.name);
23232323 const name_str_index = try self.makeString(decl_name);
23242324 const vaddr = try self.allocateTextBlock(&decl.link.elf, code.len, required_alignment);
2325 log.debug("allocated text block for {} at 0x{x}\n", .{ decl_name, vaddr });
2325 log.debug("allocated text block for {s} at 0x{x}\n", .{ decl_name, vaddr });
23262326 errdefer self.freeTextBlock(&decl.link.elf);
23272327
23282328 local_sym.* = .{
src/test.zig+1-1
......@@ -660,7 +660,7 @@ pub const TestContext = struct {
660660 }
661661 }
662662 if (comp.bin_file.cast(link.File.C)) |c_file| {
663 std.debug.print("Generated C: \n===============\n{}\n\n===========\n\n", .{
663 std.debug.print("Generated C: \n===============\n{s}\n\n===========\n\n", .{
664664 c_file.main.items,
665665 });
666666 }
test/compare_output.zig+2-2
......@@ -453,7 +453,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
453453 \\ _ = args_it.skip();
454454 \\ while (args_it.next(allocator)) |arg_or_err| : (index += 1) {
455455 \\ const arg = try arg_or_err;
456 \\ try stdout.print("{}: {}\n", .{index, arg});
456 \\ try stdout.print("{}: {s}\n", .{index, arg});
457457 \\ }
458458 \\}
459459 ,
......@@ -492,7 +492,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
492492 \\ _ = args_it.skip();
493493 \\ while (args_it.next(allocator)) |arg_or_err| : (index += 1) {
494494 \\ const arg = try arg_or_err;
495 \\ try stdout.print("{}: {}\n", .{index, arg});
495 \\ try stdout.print("{}: {s}\n", .{index, arg});
496496 \\ }
497497 \\}
498498 ,
test/stage1/behavior/async_fn.zig+2-1
......@@ -2,6 +2,7 @@ const std = @import("std");
22const builtin = @import("builtin");
33const expect = std.testing.expect;
44const expectEqual = std.testing.expectEqual;
5const expectEqualStrings = std.testing.expectEqualStrings;
56const expectError = std.testing.expectError;
67
78var global_x: i32 = 1;
......@@ -541,7 +542,7 @@ test "pass string literal to async function" {
541542 fn hello(msg: []const u8) void {
542543 frame = @frame();
543544 suspend;
544 expectEqual(@as([]const u8, "hello"), msg);
545 expectEqualStrings("hello", msg);
545546 ok = true;
546547 }
547548 };