Skip to content

Fixes std.meta.Tuple and std.meta.ArgsTuple for zero-sized types #6499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 18, 2020

Conversation

ikskuh
Copy link
Contributor

@ikskuh ikskuh commented Oct 2, 2020

Using std.meta.Tuple(&[_]type { void }) failed, as void has no alignment. This sets the correct 0 alignment of 0-sized types

@FireFox317
Copy link
Contributor

One thing to consider here is that we might want to change the implementation of @alignOf to return 0 for 0-sized types. Then there is no need to special case the 0-sized types (which is I think the philosophy of Zig?).

@daurnimator
Copy link
Contributor

One thing to consider here is that we might want to change the implementation of @alignOf to return 0 for 0-sized types

See #4016

@ikskuh
Copy link
Contributor Author

ikskuh commented Oct 15, 2020

I think we should merge the PR and fix it later when #4016 is decided. My project is now broken for two weeks 🙈

@andrewrk andrewrk merged commit b014bc7 into ziglang:master Oct 18, 2020
@ikskuh ikskuh deleted the tuple_alignment_fix branch October 18, 2020 12:25
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.

4 participants