Skip to content

Conversation

@emilio
Copy link
Contributor

@emilio emilio commented Sep 19, 2018

This is the first step to fix #1370 / #1338 / etc.

Fix for that will build up on this.

@highfive
Copy link

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

@emilio
Copy link
Contributor Author

emilio commented Sep 19, 2018

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 :(

@emilio
Copy link
Contributor Author

emilio commented Sep 19, 2018

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
@emilio
Copy link
Contributor Author

emilio commented Sep 19, 2018

Yeah, so I fixed it kind of, by always forcing repr(align) for such alignments. That makes all tests pass.

Copy link
Member

@fitzgen fitzgen left a 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.

@emilio
Copy link
Contributor Author

emilio commented Sep 19, 2018

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

@bors-servo
Copy link

📌 Commit c09c74e has been approved by fitzgen

@bors-servo
Copy link

⌛ Testing commit c09c74e with merge 6fc0a31...

bors-servo pushed a commit that referenced this pull request Sep 19, 2018
codegen: Generate u128 / i128 when available.

This is the first step to fix #1370 / #1338 / etc.

Fix for that will build up on this.
@bors-servo
Copy link

☀️ Test successful - status-travis
Approved by: fitzgen
Pushing 6fc0a31 to master...

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.

Auto-generated test failure using <link.h> on Debian 9.

4 participants