-
Notifications
You must be signed in to change notification settings - Fork 171
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
Bug: not 128bit aligned with repr-c
feature
#649
Comments
I would suggest the approach should be to update the docs to remove this guarantee. The main problem is that whilst you're correct that the current implementation is not aligned to 128 bits, your proposed implementation won't be either! You can see this in your playground link if you run it normally (i.e. not with miri) where the error if the alignments don't match displays that So we would have two options for fixing the alignment, but both break the principle of least surprise, imo:
|
A separate issue to removing the docs is still whether the maintainer wishes to change the alignment to match that of |
Yeah, i've tried to use |
I've noticed that while docs claim that
Decimal
is 128bit aligned it's not the case which could lead to UB (playground run with miri).Either docs should be edited of fix implemented.
I can work on the fix by introducing new ZST field
_align: [u128; 0]
intoDecimal
which would force proper alignment of the type to be equal tou128
.The text was updated successfully, but these errors were encountered: