diff options
| author | Tadeo Kondrak <me@tadeo.ca> | 2020-09-26 08:48:26 -0600 |
|---|---|---|
| committer | Tadeo Kondrak <me@tadeo.ca> | 2020-10-01 15:01:25 -0600 |
| commit | d81648ce8ce93780c7eb8c93f05b6f99f160474c (patch) | |
| tree | 603e96d9b31f985c553bf5ac0ba7699117b8b7b0 /lib/std | |
| parent | 77df5dae7f69f0d46c8e229df12f43f33487073f (diff) | |
| download | zig-d81648ce8ce93780c7eb8c93f05b6f99f160474c.tar.gz zig-d81648ce8ce93780c7eb8c93f05b6f99f160474c.zip | |
Add alignment field to TypeInfo.UnionField and TypeInfo.StructField
Closes https://github.com/ziglang/zig/issues/6122
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/builtin.zig | 2 | ||||
| -rw-r--r-- | lib/std/meta/trailer_flags.zig | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/std/builtin.zig b/lib/std/builtin.zig index cca47fbc01..857ecc391f 100644 --- a/lib/std/builtin.zig +++ b/lib/std/builtin.zig @@ -262,6 +262,7 @@ pub const TypeInfo = union(enum) { field_type: type, default_value: anytype, is_comptime: bool, + alignment: u29, }; /// This data structure is used by the Zig language code generation and @@ -318,6 +319,7 @@ pub const TypeInfo = union(enum) { pub const UnionField = struct { name: []const u8, field_type: type, + alignment: u29, }; /// This data structure is used by the Zig language code generation and diff --git a/lib/std/meta/trailer_flags.zig b/lib/std/meta/trailer_flags.zig index c8c1323686..6cd8dc9357 100644 --- a/lib/std/meta/trailer_flags.zig +++ b/lib/std/meta/trailer_flags.zig @@ -47,6 +47,7 @@ pub fn TrailerFlags(comptime Fields: type) type { @as(?struct_field.field_type, null), ), .is_comptime = false, + .alignment = @alignOf(?struct_field.field_type), }; } break :blk @Type(.{ |
