-
Notifications
You must be signed in to change notification settings - Fork 723
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
codegen: Generate u128 / i128 when available. #1391
Conversation
This is very mechanical and boring, but needed.
I implemented the whole thing, but there's an autogenerated test failure that fails because of rust-lang/rust#54341. So i128 / u128 doesn't have the right alignment on Rust :( |
Still I think it's an improvement over what we have... So if I were to land this I'd disable the autogenerated tests for that test. r? @fitzgen |
To work-around some cases of rust-lang/rust#54341. Other cases where u128 and u64 are mixed in fields might not behave correctly, but the field offset assertions would catch them. Fixes rust-lang#1370
Yeah, so I fixed it kind of, by always forcing repr(align) for such alignments. That makes all tests pass. |
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.
LGTM!
Would be valuable to have test coverage for the blob bits by making a test with a struct that contains a __int128
that is marked as opaque.
The blob bits unfortunately aren't an improvement over what we have because of that rust alignment issue, so I don't think we can land tests for them unless we have a way of expecting test failures, which I don't think I have the cycles for. Thanks for the review! @bors-servo r=fitzgen |
📌 Commit c09c74e has been approved by |
☀️ Test successful - status-travis |
This is the first step to fix #1370 / #1338 / etc.
Fix for that will build up on this.