-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
trans: pad const structs to aligned size #37281
Conversation
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
Thanks for digging into that issue and putting a patch together @TimNN! |
@bors r+ |
📌 Commit 1c78b08 has been approved by |
@@ -777,8 +777,10 @@ fn build_const_struct<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, | |||
offset += machine::llsize_of_alloc(ccx, val_ty(val)); | |||
} | |||
|
|||
if offset < st.min_size.bytes() { | |||
cfields.push(padding(ccx, st.min_size.bytes() - offset)); | |||
let min_size = st.min_size.abi_align(st.align).bytes(); |
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.
st.stride()
should work AFAICT (or it's "aligned_size", I forget).
@bors r- Don't want to keep the long form in. cc @camlorn who changed that code recently. |
@bors r+ |
📌 Commit 472515a has been approved by |
@bors r+ |
📌 Commit f135697 has been approved by |
Discussed in @rust-lang/compiler meeting, marking as beta-accepted. But it's got to merge first I guess. =) |
Relevant commit: f16068e#diff-3dc76d318c3b3ca3bab97ea19a5dd685L1287 - However, while the bug affects beta, this PR can't be backported to beta directly, because the file there is just after that original change, with |
⌛ Testing commit f135697 with merge 101a132... |
💔 Test failed - auto-win-gnu-64-opt |
|
@bors retry |
@bors retry |
Looks like another instance of #33361. Unfortunately no idea what that is. |
trans: pad const structs to aligned size Fixes #37222. I'm not sure if that is the *correct* way to fix this, but it *does* work.
😭 |
@bors retry |
@bors: retry force clean |
⌛ Testing commit f135697 with merge 4642e08... |
trans: pad const structs to aligned size Fixes #37222. I'm not sure if that is the *correct* way to fix this, but it *does* work.
Fixes #37222.
I'm not sure if that is the correct way to fix this, but it does work.