# stage2: lower each struct field type, align, init separately · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/4a28c1d5c3627510cef97b88ee6b3988f65ac0dd)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 4a28c1d5c3627510cef97b88ee6b3988f65ac0dd

Requested commit: 4a28c1d5c3627510cef97b88ee6b3988f65ac0dd

Commit: 4a28c1d5c3627510cef97b88ee6b3988f65ac0dd

Tree: 17d331556c594b52a4f03c143bf2720dbc3afeca

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: lower each struct field type, align, init separately

Previously, struct types, alignment values, and initialization
expressions were all lowered into the same ZIR body, which caused false
positive "depends on itself" errors when the initialization expression
depended on the size of the struct.

This also uses ResultLoc.coerced_ty for struct field alignment and
initialization values. The resulting ZIR encoding ends up being roughly
the same, neither smaller nor larger than previously.

Closes #12029

```

## Parents

- [3708e26f4b8b9514f055ae2a0571d3290414bf8b](https://git.cafe/gitcafe/zig/commit/3708e26f4b8b9514f055ae2a0571d3290414bf8b?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/4a28c1d5c3627510cef97b88ee6b3988f65ac0dd?format=markdown)
