compiler,tests,tools: remove uses of capturing errdefer

In preparation for its removal, as accepted in
https://github.com/ziglang/zig/issues/23734.
This commit is contained in:
Matthew Lugg
2026-04-28 13:06:32 +01:00
parent 7b44e8986f
commit e67c344fc0
5 changed files with 15 additions and 113 deletions
+5 -3
View File
@@ -11222,14 +11222,16 @@ fn initValueAdvanced(
};
return @enumFromInt(isel.values.items.len);
}
pub fn dumpValues(isel: *Select, which: enum { only_referenced, all }) void {
const WhichValues = enum { only_referenced, all };
pub fn dumpValues(isel: *Select, which: WhichValues) void {
dumpValuesInner(isel, which) catch |err| @panic(@errorName(err));
}
fn dumpValuesInner(isel: *Select, which: WhichValues) !void {
const zcu = isel.pt.zcu;
const gpa = zcu.gpa;
const ip = &zcu.intern_pool;
const nav = ip.getNav(isel.nav_index);
errdefer |err| @panic(@errorName(err));
const locked_stderr = std.debug.lockStderr(&.{});
defer std.debug.unlockStderr();
const stderr = &locked_stderr.file_writer.interface;