diff options
| author | Erik Arvstedt <erik.arvstedt@gmail.com> | 2022-05-04 20:01:48 +0200 |
|---|---|---|
| committer | Erik Arvstedt <erik.arvstedt@gmail.com> | 2022-05-04 20:01:48 +0200 |
| commit | 8b8e57c670132d615f2b5bbf69acf1658c083b12 (patch) | |
| tree | 2160c485fc16b5536306358d7b710fc3d405772f /lib/std | |
| parent | 3ed9ef3e6bed3fef6d6cad07920d08b28e20ec3e (diff) | |
| download | zig-8b8e57c670132d615f2b5bbf69acf1658c083b12.tar.gz zig-8b8e57c670132d615f2b5bbf69acf1658c083b12.zip | |
std.meta.TrailerFlags: include in std tests
Previously, TrailerFlags was unreferenced in std,
so its tests were never run.
Also, fix the use of `default_value` whose type was changed in
f4a249325e8e3741a6294462ae37a79cb9089c56 (#10766).
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/meta.zig | 4 | ||||
| -rw-r--r-- | lib/std/meta/trailer_flags.zig | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/std/meta.zig b/lib/std/meta.zig index e6ce746f19..0de51bfa68 100644 --- a/lib/std/meta.zig +++ b/lib/std/meta.zig @@ -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)) { diff --git a/lib/std/meta/trailer_flags.zig b/lib/std/meta/trailer_flags.zig index a128564708..e4288692b1 100644 --- a/lib/std/meta/trailer_flags.zig +++ b/lib/std/meta/trailer_flags.zig @@ -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), }; |
