-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Detect unaligned fields via aggregate.align < field.align
, instead of a packed
flag.
#46436
Conversation
r? @arielb1 (rust_highfive has picked a reviewer for you, use r? to override) |
#46428 has been merged, removing S-blocked tag. |
@bors r+ |
📌 Commit 9dbf495 has been approved by |
⌛ Testing commit 9dbf4956e849ccd6f997ca12cf59d42493ca1f87 with merge 9e5f66604eb5713c2b809be6568a69e733f706ac... |
💔 Test failed - status-appveyor |
@bors retry "error: Could not compile |
⌛ Testing commit 9dbf4956e849ccd6f997ca12cf59d42493ca1f87 with merge 1d14c68b12283807fc669192af83d3d75f952a3f... |
💔 Test failed - status-appveyor |
|
⌛ Testing commit 9dbf4956e849ccd6f997ca12cf59d42493ca1f87 with merge cad9630522a85914c37d6526627c69d799073493... |
💔 Test failed - status-appveyor |
Could not compile |
Is it running out of memory by any chance? |
I don't know, the log doesn't track memory use 😞 |
Soooo who might have some insight on why rustdoc can't build on appveyor? @rust-lang/infra ? @rust-lang/docs ? |
Without more logs, it's gonna be complicated... |
☔ The latest upstream changes (presumably #46743) made this pull request unmergeable. Please resolve the merge conflicts. |
r? @oli-obk on the last |
src/librustc/mir/interpret/value.rs
Outdated
@@ -9,8 +9,7 @@ use rustc_const_math::ConstFloat; | |||
#[derive(Copy, Clone, Debug)] | |||
pub struct PtrAndAlign { | |||
pub ptr: Pointer, | |||
/// Remember whether this place is *supposed* to be aligned. | |||
pub aligned: bool, | |||
pub align: Align, |
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.
Awesome! I wanted to do this all along
src/librustc_mir/interpret/place.rs
Outdated
pub fn to_ptr(self) -> EvalResult<'tcx, MemoryPointer> { | ||
let (ptr, extra) = self.to_ptr_extra_aligned(); | ||
// At this point, we forget about the alignment information -- the place has been turned into a reference, |
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.
Why did you remove the comment?
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.
Threading through the alignments was the original idea. We scrapped it because we thought it would get too intrusive. With all the convenience methods on Align it seems good though
Just break miri. I want to refactor some of the ty arguments to layout arguments anyway, I'll just do that there |
@bors r=arielb1,oli-obk |
📌 Commit 799a83c has been approved by |
☀️ Test successful - status-appveyor, status-travis |
rustc: ensure optimized enums have a properly aligned size. Fixes #46769 by padding the optimized enums wrapping packed data as necessary. Note that this is not the only way to solve this - on nightly, #46436 makes it easier to fix without adding new padding because of the replacement of `packed` flags with a non-redundant scheme. But because it can't be backported, the optimal fix will be in a separate nightly-only PR (#46809).
Closes #46423. cc @oli-obk