authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-02-18 15:34:13-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-02-18 15:34:13-05:00
logd056c7732b87633ace03dd15668a88eac76b62a5
treec0397d9b09c6dd66bd828c4162b8439bc03ec304
parentdd58278dbe8ac89a9e685a966b5f05f80f463798
signaturelock-open Commit is signed but in an unrecognized format.

fix std.meta.refAllDecls


1 files changed, 4 insertions(+), 2 deletions(-)

lib/std/meta.zig+4-2
...@@ -437,7 +437,7 @@ pub fn eql(a: var, b: @TypeOf(a)) bool {...@@ -437,7 +437,7 @@ pub fn eql(a: var, b: @TypeOf(a)) bool {
437 },437 },
438 .Pointer => |info| {438 .Pointer => |info| {
439 return switch (info.size) {439 return switch (info.size) {
440 .One, .Many, .C, => a == b,440 .One, .Many, .C => a == b,
441 .Slice => a.ptr == b.ptr and a.len == b.len,441 .Slice => a.ptr == b.ptr and a.len == b.len,
442 };442 };
443 },443 },
...@@ -559,7 +559,9 @@ pub fn fieldIndex(comptime T: type, comptime name: []const u8) ?comptime_int {...@@ -559,7 +559,9 @@ pub fn fieldIndex(comptime T: type, comptime name: []const u8) ?comptime_int {
559/// Given a type, reference all the declarations inside, so that the semantic analyzer sees them.559/// Given a type, reference all the declarations inside, so that the semantic analyzer sees them.
560pub fn refAllDecls(comptime T: type) void {560pub fn refAllDecls(comptime T: type) void {
561 if (!builtin.is_test) return;561 if (!builtin.is_test) return;
562 _ = declarations(T);562 inline for (declarations(T)) |decl| {
563 _ = decl;
564 }
563}565}
564566
565/// Returns a slice of pointers to public declarations of a namespace.567/// Returns a slice of pointers to public declarations of a namespace.