Remerge pull request #15995 from mlugg/fix/union-field-ptr-align

Sema: copy pointer alignment to union field pointers

This is an unrevert of 43c98dc115.
This commit is contained in:
Jacob Young
2023-06-30 23:23:26 -04:00
5 changed files with 230 additions and 8 deletions

View File

@@ -992,6 +992,7 @@ pub const Struct = struct {
is_comptime: bool,
/// Returns the field alignment. If the struct is packed, returns 0.
/// Keep implementation in sync with `Sema.structFieldAlignment`.
pub fn alignment(
field: Field,
mod: *Module,