authorgravatar for kcbanner@gmail.comCasey Banner <kcbanner@gmail.com> 2025-10-09 13:33:55-04:00
committergravatar for kcbanner@gmail.comCasey Banner <kcbanner@gmail.com> 2025-10-09 13:34:25-04:00
log2ce10e0838ea0ea6ba8a4a35e39936411a53e787
tree6a7583c952510dd4ebe4b194130e5d5d15f15f2f
parent8b6cdc3d8224cf1e97a970f78281db2fcd14b7a2

- aroDiagnosticsToErrorBundle: fixup not clearing notes after flushing the current error

- Compilation: renameTmpIntoCache doesn't need to be pub after the `translateC` change

2 files changed, 3 insertions(+), 2 deletions(-)

lib/compiler/util.zig+2-1
......@@ -26,11 +26,12 @@ pub fn aroDiagnosticsToErrorBundle(
2626 for (d.output.to_list.messages.items) |msg| {
2727 switch (msg.kind) {
2828 .off, .warning => {
29 // Emit any pending error and clear everything so that notes don't bleed into unassociated errors
2930 if (cur_err) |err| {
3031 try bundle.addRootErrorMessageWithNotes(err, cur_notes.items);
31 // Clear the current error so that notes don't bleed into unassociated errors
3232 cur_err = null;
3333 }
34 cur_notes.clearRetainingCapacity();
3435 continue;
3536 },
3637 .note => if (cur_err == null) continue,
src/Compilation.zig+1-1
......@@ -3398,7 +3398,7 @@ fn flush(
33983398/// Linker backends which do not have this requirement can fall back to the simple
33993399/// implementation at the bottom of this function.
34003400/// This function is only called when CacheMode is `whole`.
3401pub fn renameTmpIntoCache(
3401fn renameTmpIntoCache(
34023402 cache_directory: Cache.Directory,
34033403 tmp_dir_sub_path: []const u8,
34043404 o_sub_path: []const u8,