You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, if you uncomment the lines that actually attempt to invoke .foo(), this code will fail to compile with "multiple applicable methods in scope".
Given that the non-built-in trait correctly prevents compilation at definition-time rather than waiting for invocation, I think it would be correct for Copy to do the same.
The text was updated successfully, but these errors were encountered:
I believe this was due to the hack in coherence that was
specific to the (now removed) Copy trait (iirc the code was
not generalizing to other built-in traits). Closing as I can't
find any evidence of this code still existing. Reopen if you
disagree.
…ffate
Fixes for `branches_sharing_code`
fixesrust-lang#7198fixesrust-lang#7452fixesrust-lang#7555fixesrust-lang#7589
changelog: Don't suggest moving modifications to locals used in any of the condition expressions in `branches_sharing_code`
changelog: Don't suggest moving anything after a local with a significant drop in `branches_sharing_code`
In this code snippet, we impl a trait on all types that implement Bar. However, we impl the trait twice, and this correctly does not compile:
But, if instead of bounding our generics with Bar we bound them with the built-in Copy trait, this compiles successfully!
However, if you uncomment the lines that actually attempt to invoke .foo(), this code will fail to compile with "multiple applicable methods in scope".
Given that the non-built-in trait correctly prevents compilation at definition-time rather than waiting for invocation, I think it would be correct for
Copy
to do the same.The text was updated successfully, but these errors were encountered: