mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
- aroDiagnosticsToErrorBundle: fixup not clearing notes after flushing the current error
- Compilation: renameTmpIntoCache doesn't need to be pub after the `translateC` change
This commit is contained in:
parent
8b6cdc3d82
commit
2ce10e0838
@ -26,11 +26,12 @@ pub fn aroDiagnosticsToErrorBundle(
|
|||||||
for (d.output.to_list.messages.items) |msg| {
|
for (d.output.to_list.messages.items) |msg| {
|
||||||
switch (msg.kind) {
|
switch (msg.kind) {
|
||||||
.off, .warning => {
|
.off, .warning => {
|
||||||
|
// Emit any pending error and clear everything so that notes don't bleed into unassociated errors
|
||||||
if (cur_err) |err| {
|
if (cur_err) |err| {
|
||||||
try bundle.addRootErrorMessageWithNotes(err, cur_notes.items);
|
try bundle.addRootErrorMessageWithNotes(err, cur_notes.items);
|
||||||
// Clear the current error so that notes don't bleed into unassociated errors
|
|
||||||
cur_err = null;
|
cur_err = null;
|
||||||
}
|
}
|
||||||
|
cur_notes.clearRetainingCapacity();
|
||||||
continue;
|
continue;
|
||||||
},
|
},
|
||||||
.note => if (cur_err == null) continue,
|
.note => if (cur_err == null) continue,
|
||||||
|
|||||||
@ -3398,7 +3398,7 @@ fn flush(
|
|||||||
/// Linker backends which do not have this requirement can fall back to the simple
|
/// Linker backends which do not have this requirement can fall back to the simple
|
||||||
/// implementation at the bottom of this function.
|
/// implementation at the bottom of this function.
|
||||||
/// This function is only called when CacheMode is `whole`.
|
/// This function is only called when CacheMode is `whole`.
|
||||||
pub fn renameTmpIntoCache(
|
fn renameTmpIntoCache(
|
||||||
cache_directory: Cache.Directory,
|
cache_directory: Cache.Directory,
|
||||||
tmp_dir_sub_path: []const u8,
|
tmp_dir_sub_path: []const u8,
|
||||||
o_sub_path: []const u8,
|
o_sub_path: []const u8,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user