Skip to content
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

std.builtin.TypeInfo.Pointer is missing information on bit-alignment #6846

Open
rohlem opened this issue Oct 28, 2020 · 0 comments
Open

std.builtin.TypeInfo.Pointer is missing information on bit-alignment #6846

rohlem opened this issue Oct 28, 2020 · 0 comments
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase.
Milestone

Comments

@rohlem
Copy link
Contributor

rohlem commented Oct 28, 2020

Currently, @typeInfo(* align(a:b:c) u32).Pointer.alignment is simply a comptime_int representing the first (byte) alignment value, the other two are ignored.
This limits generic reflection code in introspecting them. To even differentiate them from byte-aligned pointer types, you need to reconstruct the byte-aligned type and compare them.

I assume this extension (and inversely supporting generic creation via @Type) was already planned and just not a priority (as packed structs still have more pressing bugs), so this is just a tracking issue.

@Vexu Vexu added the enhancement Solving this issue will likely involve adding new logic or components to the codebase. label Oct 28, 2020
@Vexu Vexu added this to the 0.8.0 milestone Oct 28, 2020
@andrewrk andrewrk modified the milestones: 0.8.0, 0.9.0 Nov 6, 2020
@andrewrk andrewrk modified the milestones: 0.9.0, 0.10.0 May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase.
Projects
None yet
Development

No branches or pull requests

3 participants