aboutsummaryrefslogtreecommitdiff
path: root/lib/std/meta.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-02-18 15:34:13 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-02-18 15:34:13 -0500
commitd056c7732b87633ace03dd15668a88eac76b62a5 (patch)
treec0397d9b09c6dd66bd828c4162b8439bc03ec304 /lib/std/meta.zig
parentdd58278dbe8ac89a9e685a966b5f05f80f463798 (diff)
downloadzig-d056c7732b87633ace03dd15668a88eac76b62a5.tar.gz
zig-d056c7732b87633ace03dd15668a88eac76b62a5.zip
fix std.meta.refAllDecls
Diffstat (limited to 'lib/std/meta.zig')
-rw-r--r--lib/std/meta.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/std/meta.zig b/lib/std/meta.zig
index 9c83b8304d..300bca3d0e 100644
--- a/lib/std/meta.zig
+++ b/lib/std/meta.zig
@@ -437,7 +437,7 @@ pub fn eql(a: var, b: @TypeOf(a)) bool {
},
.Pointer => |info| {
return switch (info.size) {
- .One, .Many, .C, => a == b,
+ .One, .Many, .C => a == b,
.Slice => a.ptr == b.ptr and a.len == b.len,
};
},
@@ -559,7 +559,9 @@ pub fn fieldIndex(comptime T: type, comptime name: []const u8) ?comptime_int {
/// Given a type, reference all the declarations inside, so that the semantic analyzer sees them.
pub fn refAllDecls(comptime T: type) void {
if (!builtin.is_test) return;
- _ = declarations(T);
+ inline for (declarations(T)) |decl| {
+ _ = decl;
+ }
}
/// Returns a slice of pointers to public declarations of a namespace.