remove usages of .alignment = 0

This commit is contained in:
David Rubin
2025-02-24 04:02:06 -08:00
committed by David Rubin
parent 17330867eb
commit d6c74a95fd
9 changed files with 45 additions and 51 deletions

View File

@@ -708,7 +708,7 @@ pub const Arguments = blk: {
field.* = .{
.name = decl.name,
.type = @field(attributes, decl.name),
.alignment = 0,
.alignment = @alignOf(@field(attributes, decl.name)),
};
}

View File

@@ -939,7 +939,7 @@ fn CreateUniqueTuple(comptime N: comptime_int, comptime types: [N]type) type {
.type = T,
.default_value_ptr = null,
.is_comptime = false,
.alignment = 0,
.alignment = @alignOf(T),
};
}

View File

@@ -8533,18 +8533,19 @@ pub const Metadata = enum(u32) {
.type = []const u8,
.default_value_ptr = null,
.is_comptime = false,
.alignment = 0,
.alignment = @alignOf([]const u8),
};
}
fmt_str = fmt_str ++ "(";
inline for (fields[2..], names) |*field, name| {
fmt_str = fmt_str ++ "{[" ++ name ++ "]f}";
const T = std.fmt.Formatter(FormatData, format);
field.* = .{
.name = name,
.type = std.fmt.Formatter(FormatData, format),
.type = T,
.default_value_ptr = null,
.is_comptime = false,
.alignment = 0,
.alignment = @alignOf(T),
};
}
fmt_str = fmt_str ++ ")\n";