authorgravatar for erik.arvstedt@gmail.comErik Arvstedt <erik.arvstedt@gmail.com> 2022-05-04 20:01:48+02:00
committergravatar for erik.arvstedt@gmail.comErik Arvstedt <erik.arvstedt@gmail.com> 2022-05-04 20:01:48+02:00
log8b8e57c670132d615f2b5bbf69acf1658c083b12
tree2160c485fc16b5536306358d7b710fc3d405772f
parent3ed9ef3e6bed3fef6d6cad07920d08b28e20ec3e

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).

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

lib/std/meta.zig+4
...@@ -10,6 +10,10 @@ pub const TrailerFlags = @import("meta/trailer_flags.zig").TrailerFlags;...@@ -10,6 +10,10 @@ pub const TrailerFlags = @import("meta/trailer_flags.zig").TrailerFlags;
1010
11const Type = std.builtin.Type;11const Type = std.builtin.Type;
1212
13test "std.meta.TrailerFlags" {
14 _ = TrailerFlags;
15}
16
13pub fn tagName(v: anytype) []const u8 {17pub fn tagName(v: anytype) []const u8 {
14 const T = @TypeOf(v);18 const T = @TypeOf(v);
15 switch (@typeInfo(T)) {19 switch (@typeInfo(T)) {
lib/std/meta/trailer_flags.zig+1-4
...@@ -24,10 +24,7 @@ pub fn TrailerFlags(comptime Fields: type) type {...@@ -24,10 +24,7 @@ pub fn TrailerFlags(comptime Fields: type) type {
24 fields[i] = Type.StructField{24 fields[i] = Type.StructField{
25 .name = struct_field.name,25 .name = struct_field.name,
26 .field_type = ?struct_field.field_type,26 .field_type = ?struct_field.field_type,
27 .default_value = @as(27 .default_value = &@as(?struct_field.field_type, null),
28 ??struct_field.field_type,
29 @as(?struct_field.field_type, null),
30 ),
31 .is_comptime = false,28 .is_comptime = false,
32 .alignment = @alignOf(?struct_field.field_type),29 .alignment = @alignOf(?struct_field.field_type),
33 };30 };