Skip to content

Conversation

@andrewrk
Copy link
Member

@andrewrk andrewrk commented Jul 13, 2022

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

cc @kristoff-it - this affects ZIR encoding for autodocs

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
@andrewrk andrewrk merged commit 4a28c1d into master Jul 13, 2022
@andrewrk andrewrk deleted the struct-field-exprs branch July 13, 2022 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

struct with field default initialized to size of the struct gives false positive 'depends on itself' error

1 participant