Skip to content

Commit 2ce10e0

Browse files
committed
- aroDiagnosticsToErrorBundle: fixup not clearing notes after flushing the current error
- Compilation: renameTmpIntoCache doesn't need to be pub after the `translateC` change
1 parent 8b6cdc3 commit 2ce10e0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/compiler/util.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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`.
3401-
pub fn renameTmpIntoCache(
3401+
fn renameTmpIntoCache(
34023402
cache_directory: Cache.Directory,
34033403
tmp_dir_sub_path: []const u8,
34043404
o_sub_path: []const u8,

0 commit comments

Comments
 (0)