-
Notifications
You must be signed in to change notification settings - Fork 13k
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
move of packed fields might or might not occur when they actually are sufficiently aligned #63374
Conversation
… sufficiently aligned
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
Is there a reason we don't do something similar for |
Not that I know if. Honestly I was surprised we do any magic at all even for 1-aligned types, but it makes sense of course. |
@bors r+ I guess? |
📌 Commit e82b053 has been approved by |
Whatever that means?^^ |
Just removed that weird lead-in to the new sentence. @bors r=cramertj |
📌 Commit fa58c27 has been approved by |
Just that I think this is a good clarifying remark to have, but the actual behavior is somewhat strange. |
move of packed fields might or might not occur when they actually are sufficiently aligned See taiki-e/pin-project#34, where it was pointed out that we actually don't move fields of 1-aligned types when dropping a packed struct -- but e.g. in a `packed(2)` struct, we don't do something similar for 2-aligned types. The code for that is [here](/~https://github.com/rust-lang/rust/blob/db7c773a6be2f050d1d1504763819ea3916f5428/src/librustc_mir/util/alignment.rs#L7).
move of packed fields might or might not occur when they actually are sufficiently aligned See taiki-e/pin-project#34, where it was pointed out that we actually don't move fields of 1-aligned types when dropping a packed struct -- but e.g. in a `packed(2)` struct, we don't do something similar for 2-aligned types. The code for that is [here](/~https://github.com/rust-lang/rust/blob/db7c773a6be2f050d1d1504763819ea3916f5428/src/librustc_mir/util/alignment.rs#L7).
Rollup of 6 pull requests Successful merges: - #63162 (Miri tests: use xargo to build separate libstd) - #63289 (Don't recommend `extern crate` syntax) - #63373 (gitignore: add comment explaining policy) - #63374 (move of packed fields might or might not occur when they actually are sufficiently aligned) - #63381 (reduce visibility) - #63387 (Test interaction between `async { ... }` and `?`, `return`, and `break`) Failed merges: r? @ghost
See taiki-e/pin-project#34, where it was pointed out that we actually don't move fields of 1-aligned types when dropping a packed struct -- but e.g. in a
packed(2)
struct, we don't do something similar for 2-aligned types. The code for that is here.