Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Aug 8, 2019

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.

@rust-highfive
Copy link
Contributor

r? @cramertj

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 8, 2019
@cramertj
Copy link
Member

cramertj commented Aug 8, 2019

Is there a reason we don't do something similar for align(2) types, or is this just documenting the current behavior, and subject to change in the future?

@RalfJung
Copy link
Member Author

RalfJung commented Aug 8, 2019

Is there a reason we don't do something similar for align(2) types

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.

@cramertj
Copy link
Member

cramertj commented Aug 8, 2019

@bors r+ I guess?

@bors
Copy link
Collaborator

bors commented Aug 8, 2019

📌 Commit e82b053 has been approved by cramertj

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 8, 2019
@RalfJung
Copy link
Member Author

RalfJung commented Aug 8, 2019

I guess?

Whatever that means?^^

@RalfJung
Copy link
Member Author

RalfJung commented Aug 8, 2019

Just removed that weird lead-in to the new sentence.

@bors r=cramertj

@bors
Copy link
Collaborator

bors commented Aug 8, 2019

📌 Commit fa58c27 has been approved by cramertj

@cramertj
Copy link
Member

cramertj commented Aug 8, 2019

Whatever that means?^^

Just that I think this is a good clarifying remark to have, but the actual behavior is somewhat strange.

Centril added a commit to Centril/rust that referenced this pull request Aug 8, 2019
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).
Centril added a commit to Centril/rust that referenced this pull request Aug 8, 2019
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).
bors added a commit that referenced this pull request Aug 8, 2019
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
@bors bors merged commit fa58c27 into rust-lang:master Aug 9, 2019
@RalfJung RalfJung deleted the pin-packed branch August 9, 2019 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants