std: prevent testing.io from use outside tests

This commit is contained in:
Andrew Kelley 2025-12-25 15:36:35 -08:00
parent b0691df5ba
commit 28639bd6d7

View file

@ -31,7 +31,7 @@ pub var allocator_instance: std.heap.GeneralPurposeAllocator(.{
};
pub var io_instance: Io.Threaded = undefined;
pub const io = io_instance.io();
pub const io = if (builtin.is_test) io_instance.io() else @compileError("not testing");
/// TODO https://github.com/ziglang/zig/issues/5738
pub var log_level = std.log.Level.warn;