-
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
Better errors when a Copy impl on a Struct is not self-consistent #94249
Conversation
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
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.
Apologies for the slow review, I think this is a sensible change and looks good. I've left a small comment, if it seems feasible to fix without a lot more work then we can do that before landing this, otherwise it can be a follow-up.
38691eb
to
ef85798
Compare
@rustbot ready I left a FIXME, but otherwise just rebased this code. |
ef85798
to
c8cbd3d
Compare
@bors r+ |
📌 Commit c8cbd3d has been approved by |
⌛ Testing commit c8cbd3d with merge 5114b946e9d2e10226feb30bec8c2f2e24fe3113... |
💔 Test failed - checks-actions |
The job Click to see the possible cause of the failure (guessed by this bot)
|
can someone bors-retry this? spurious error it seems. |
@bors retry |
…askrgr Rollup of 5 pull requests Successful merges: - rust-lang#94249 (Better errors when a Copy impl on a Struct is not self-consistent) - rust-lang#95069 (Fix auto traits in rustdoc) - rust-lang#95221 (interpret/memory: simplify check_and_deref_ptr) - rust-lang#95225 (remove `[async output]` from `impl Future` pretty-printing) - rust-lang#95238 (Stop emitting E0026 for struct enums with underscores) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
As discovered in a Zulip thread with @nnethercote and @Mark-Simulacrum, it's not immediately obvious why a field on an ADT doesn't implement
Copy
. This PR attempts to give slightly more detailed information by spinning up a fulfillment context to try to dig down and discover transitive fulfillment errors that causeis_copy_modulo_regions
to fail on a ADT field.The error message still kinda sucks, but should only show up in the case that an existing error message was totally missing... so I think it's a good compromise for now?