From fda0b2c372c3e9ecc348a9cc4afc4e7afd966427 Mon Sep 17 00:00:00 2001 From: r00ster91 Date: Thu, 29 Sep 2022 09:42:58 +0200 Subject: fix(std.testing.refAllDeclsRecursive): silently return if !builtin.is_test --- lib/std/testing.zig | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/std/testing.zig') diff --git a/lib/std/testing.zig b/lib/std/testing.zig index 2346ee6b5d..97ae914433 100644 --- a/lib/std/testing.zig +++ b/lib/std/testing.zig @@ -730,6 +730,7 @@ pub fn refAllDecls(comptime T: type) void { /// Given a type, and Recursively reference all the declarations inside, so that the semantic analyzer sees them. /// For deep types, you may use `@setEvalBranchQuota` pub fn refAllDeclsRecursive(comptime T: type) void { + if (!builtin.is_test) return; inline for (comptime std.meta.declarations(T)) |decl| { if (decl.is_pub) { if (@TypeOf(@field(T, decl.name)) == type) { -- cgit v1.2.3