From 2ce10e0838ea0ea6ba8a4a35e39936411a53e787 Mon Sep 17 00:00:00 2001 From: kcbanner Date: Thu, 9 Oct 2025 13:33:55 -0400 Subject: [PATCH] - aroDiagnosticsToErrorBundle: fixup not clearing notes after flushing the current error - Compilation: renameTmpIntoCache doesn't need to be pub after the `translateC` change --- lib/compiler/util.zig | 3 ++- src/Compilation.zig | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/compiler/util.zig b/lib/compiler/util.zig index 63a078cead..05570abc3b 100644 --- a/lib/compiler/util.zig +++ b/lib/compiler/util.zig @@ -26,11 +26,12 @@ pub fn aroDiagnosticsToErrorBundle( for (d.output.to_list.messages.items) |msg| { switch (msg.kind) { .off, .warning => { + // Emit any pending error and clear everything so that notes don't bleed into unassociated errors if (cur_err) |err| { try bundle.addRootErrorMessageWithNotes(err, cur_notes.items); - // Clear the current error so that notes don't bleed into unassociated errors cur_err = null; } + cur_notes.clearRetainingCapacity(); continue; }, .note => if (cur_err == null) continue, diff --git a/src/Compilation.zig b/src/Compilation.zig index 3f22508238..b21b944a76 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -3398,7 +3398,7 @@ fn flush( /// Linker backends which do not have this requirement can fall back to the simple /// implementation at the bottom of this function. /// This function is only called when CacheMode is `whole`. -pub fn renameTmpIntoCache( +fn renameTmpIntoCache( cache_directory: Cache.Directory, tmp_dir_sub_path: []const u8, o_sub_path: []const u8,