zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 434a6a4f633f3f9b29bd80f4089e8f403aab4f9b (tree)
parent a68defbc6559647d23862daa59d5c1f9a64e34e3
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Fri,  2 Feb 2024 14:41:35 -0700

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

This is how assertions work in zig.

Diffstat:
Mlib/std/child_process.zig | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/std/child_process.zig b/lib/std/child_process.zig @@ -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.?,