authorgravatar for r00ster91@proton.meWooster <r00ster91@proton.me> 2022-09-29 09:42:58+02:00
committergravatar for luuk@degram.devLuuk de Gram <luuk@degram.dev> 2022-09-29 21:40:25+02:00
logfda0b2c372c3e9ecc348a9cc4afc4e7afd966427
tree787c35e908fdd9397e741eff09f3e2d1a81c5a66
parent295451dfe5f22e0bea63e737554326889af1fb13

fix(std.testing.refAllDeclsRecursive): silently return if !builtin.is_test


1 files changed, 1 insertions(+), 0 deletions(-)

lib/std/testing.zig+1
...@@ -730,6 +730,7 @@ pub fn refAllDecls(comptime T: type) void {...@@ -730,6 +730,7 @@ pub fn refAllDecls(comptime T: type) void {
730/// Given a type, and Recursively reference all the declarations inside, so that the semantic analyzer sees them.730/// Given a type, and Recursively reference all the declarations inside, so that the semantic analyzer sees them.
731/// For deep types, you may use `@setEvalBranchQuota`731/// For deep types, you may use `@setEvalBranchQuota`
732pub fn refAllDeclsRecursive(comptime T: type) void {732pub fn refAllDeclsRecursive(comptime T: type) void {
733 if (!builtin.is_test) return;
733 inline for (comptime std.meta.declarations(T)) |decl| {734 inline for (comptime std.meta.declarations(T)) |decl| {
734 if (decl.is_pub) {735 if (decl.is_pub) {
735 if (@TypeOf(@field(T, decl.name)) == type) {736 if (@TypeOf(@field(T, decl.name)) == type) {