Skip to content

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
Contributor

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
Collaborator

bors commented Aug 27, 2016

📌 Commit 3e313d9 has been approved by nagisa

@bors
Copy link
Collaborator

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