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

rustc_trans: don't round up the DST prefix size to its alignment. #36027

Merged
merged 1 commit into from
Aug 28, 2016

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Aug 27, 2016

Fixes #35815 by using ty::layout and min_size to compute the size of the DST prefix.
ty::layout::Struct::min_size is not rounded up to alignment, which could be smaller for the DST field.

@rust-highfive
Copy link
Collaborator

r? @arielb1

(rust_highfive has picked a reviewer for you, use r? to override)

@eddyb
Copy link
Member Author

eddyb commented Aug 27, 2016

@bors r=nagisa

@bors
Copy link
Contributor

bors commented Aug 27, 2016

📌 Commit 3e313d9 has been approved by nagisa

@bors
Copy link
Contributor

bors commented Aug 28, 2016

⌛ Testing commit 3e313d9 with merge aa05a15...

bors added a commit that referenced this pull request Aug 28, 2016
rustc_trans: don't round up the DST prefix size to its alignment.

Fixes #35815 by using `ty::layout` and `min_size` to compute the size of the DST prefix.
`ty::layout::Struct::min_size` is not rounded up to alignment, which could be smaller for the DST field.
@bors bors merged commit 3e313d9 into rust-lang:master Aug 28, 2016
@eddyb eddyb deleted the unsized-prefix branch August 28, 2016 07:40
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.

mem::size_of_val returns wrong value for DSTs with certain field layouts
4 participants