| author | |
| committer | |
| log | 8b8e57c670132d615f2b5bbf69acf1658c083b12 |
| tree | 2160c485fc16b5536306358d7b710fc3d405772f |
| parent | 3ed9ef3e6bed3fef6d6cad07920d08b28e20ec3e |
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; |
| 10 | 10 | ||
| 11 | const Type = std.builtin.Type; | 11 | const Type = std.builtin.Type; |
| 12 | 12 | ||
| 13 | test "std.meta.TrailerFlags" { | ||
| 14 | _ = TrailerFlags; | ||
| 15 | } | ||
| 16 | |||
| 13 | pub fn tagName(v: anytype) []const u8 { | 17 | pub 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 | }; |