-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Don't assume primitive type alignments #118
Conversation
3a580a9
to
4483f9f
Compare
Hey @djkoloski , mind reviewing this one? (Looks like I can't add you as a reviewer, at least not yet - I might be able to once you've commented on this thread) |
Yep, feel free to add me as a reviewer. 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be neat if we could put this helper type in a mod
, but I like how simple the test glob is in trybuild.rs
. Maybe if more commonly used helper types are added, we could add some extra logic to handle that.
Do you think it'd be worth using |
Eh, |
4483f9f
to
077a639
Compare
Good call; done! I was able to use the |
Previously, we used the `u16` and `u64` types in a number of tests, relying on them having the alignments 2 and 8 respectively. While those types have those alignments on many platforms, those are not guaranteed to be their alignments on all platforms. In this commit, we replace most of these uses with types of the same size but guaranteed alignment. In a few places, we have to leave the uses as-is, but this isn't a big deal since our tests run in CI on platforms where the alignments are actually the values we're relying upon. Closes #116
077a639
to
f424f1f
Compare
Previously, we used the `u16` and `u64` types in a number of tests, relying on them having the alignments 2 and 8 respectively. While those types have those alignments on many platforms, those are not guaranteed to be their alignments on all platforms. In this commit, we replace most of these uses with types of the same size but guaranteed alignment. In a few places, we have to leave the uses as-is, but this isn't a big deal since our tests run in CI on platforms where the alignments are actually the values we're relying upon. Closes #116
Previously, we used the
u16
andu64
types in a number of tests,relying on them having the alignments 2 and 8 respectively. While those
types have those alignments on many platforms, those are not guaranteed
to be their alignments on all platforms. In this commit, we replace
most of these uses with types of the same size but guaranteed alignment.
In a few places, we have to leave the uses as-is, but this isn't a big
deal since our tests run in CI on platforms where the alignments are
actually the values we're relying upon.
Closes #116