Uh oh!
There was an error while loading. Please reload this page.
Specify that packed types must derive, not implement, Copy - #51143
Conversation
rust-highfive
commented
May 28, 2018
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
cramertj
commented
May 29, 2018
Are all of the autogenerated derive impls already smart enough to |
Mark-Simulacrum
commented
May 29, 2018
I'm not sure; the error message though somewhat indicates that they should be... it looks like there's some code in libsyntax_ext which does something to take care of it, but I don't follow it well enough to be sure. It seems somewhat unrelated to this change though. |
cramertj
commented
May 29, 2018
I just checked the behavior with @bors r+ |
bors
commented
May 29, 2018
📌 Commit c604df6 has been approved by |
cramertj
commented
May 29, 2018
Ah, wait no-- it only omits the reference if the @bors r- |
Mark-Simulacrum
commented
May 30, 2018
There's actually not much point then -- the way derive is structured, if the type derives Copy, the packed derive will be "safe" and as such not generate this warning. I've updated the PR to change the warning message to indicate that the type must derive Copy, not just implement it; and reverted the other changes. The long-term solution here is probably to drop the requirement that we "see" a Copy derive and generate code as-if the struct is Copy when we see that it's packed. Then we'd somehow ensure that structs who aren't Copy are errored early enough (before borrowck?) that the errors about moving out of a borrowed field don't get emitted. This is far harder though, and I don't have confidence in the correct approach, so I'm not going to work on that in this PR. |
cramertj
commented
May 30, 2018
Sounds good to me. Thanks for the updates! r=me with travis passing. |
Mark-Simulacrum
commented
May 30, 2018
@bors r=cramertj |
bors
commented
May 30, 2018
📌 Commit 033d75d has been approved by |
bors
commented
May 31, 2018
🔒 Merge conflict |
Mark-Simulacrum
commented
Jun 2, 2018
@bors r=cramertj |
bors
commented
Jun 2, 2018
📌 Commit 5c37473 has been approved by |
bors
commented
Jun 2, 2018
⌛ Testing commit 5c37473 with merge 0bdd29c7e43d60ce5e4e37ee7ce99770a057de65... |
bors
commented
Jun 2, 2018
💔 Test failed - status-travis |
rust-highfive
commented
Jun 2, 2018
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
1 similar comment
rust-highfive
commented
Jun 2, 2018
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Mark-Simulacrum
commented
Jun 2, 2018
@bors retry - timeout |
…ertj Specify that packed types must derive, not implement, Copy
Rollup of 6 pull requests Successful merges: - #51143 (Specify that packed types must derive, not implement, Copy) - #51226 (Make Layout's align a NonZeroUsize) - #51297 (Fix run button style) - #51306 (impl Default for &mut str) - #51312 (Clarify the difference between get_mut and into_mut for OccupiedEntry) - #51313 (use type name in E0599 enum variant suggestion) Failed merges:
bors
commented
Jun 3, 2018
bors
commented
Jun 3, 2018
💥 Test timed out |
RalfJung
commented
Jun 13, 2018
Per @retep998's comment at #46043 (comment), this breaks WinAPI. |
retep998
commented
Jun 13, 2018
It doesn't break |
No description provided.