Skip to content

Commit

Permalink
std.meta.TrailerFlags: include in std tests
Browse files Browse the repository at this point in the history
Previously, TrailerFlags was unreferenced in std,
so its tests were never run.

Also, fix the use of `default_value` whose type was changed in
f4a2493 (#10766).
  • Loading branch information
erikarvstedt authored and andrewrk committed Jul 19, 2022
1 parent 7551fc3 commit 9be582d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 4 additions & 0 deletions lib/std/meta.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ pub const TrailerFlags = @import("meta/trailer_flags.zig").TrailerFlags;

const Type = std.builtin.Type;

test "std.meta.TrailerFlags" {
_ = TrailerFlags;
}

pub fn tagName(v: anytype) []const u8 {
const T = @TypeOf(v);
switch (@typeInfo(T)) {
Expand Down
5 changes: 1 addition & 4 deletions lib/std/meta/trailer_flags.zig
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ pub fn TrailerFlags(comptime Fields: type) type {
fields[i] = Type.StructField{
.name = struct_field.name,
.field_type = ?struct_field.field_type,
.default_value = @as(
??struct_field.field_type,
@as(?struct_field.field_type, null),
),
.default_value = &@as(?struct_field.field_type, null),
.is_comptime = false,
.alignment = @alignOf(?struct_field.field_type),
};
Expand Down

0 comments on commit 9be582d

Please sign in to comment.