Commit 434a6a4f63

Andrew Kelley <andrew@ziglang.org>
2024-02-02 22:41:35
std.process.Child: use unreachable instead of `@panic`
This is how assertions work in zig.
1 parent a68defb
Changed files (1)
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.?,