std.process.Child: use unreachable instead of @panic

This is how assertions work in zig.
This commit is contained in:
Andrew Kelley 2024-02-02 14:41:35 -07:00
parent a68defbc65
commit 434a6a4f63

View File

@ -298,7 +298,9 @@ pub const ChildProcess = struct {
// we could make this work with multiple allocators but YAGNI
if (stdout.allocator.ptr != stderr.allocator.ptr or
stdout.allocator.vtable != stderr.allocator.vtable)
@panic("ChildProcess.collectOutput only supports 1 allocator");
{
unreachable; // ChildProcess.collectOutput only supports 1 allocator
}
var poller = std.io.poll(stdout.allocator, enum { stdout, stderr }, .{
.stdout = child.stdout.?,