Skip to content

Commit a3fb08e

Browse files
committed
std.process.Child: use unreachable instead of @panic
This is how assertions work in zig.
1 parent ea22fa9 commit a3fb08e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/std/child_process.zig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,9 @@ pub const ChildProcess = struct {
298298
// we could make this work with multiple allocators but YAGNI
299299
if (stdout.allocator.ptr != stderr.allocator.ptr or
300300
stdout.allocator.vtable != stderr.allocator.vtable)
301-
@panic("ChildProcess.collectOutput only supports 1 allocator");
301+
{
302+
unreachable; // ChildProcess.collectOutput only supports 1 allocator
303+
}
302304

303305
var poller = std.io.poll(stdout.allocator, enum { stdout, stderr }, .{
304306
.stdout = child.stdout.?,

0 commit comments

Comments
 (0)