nikomatsakis / babysteps

Babysteps blog
https://smallcultfollowing.com/babysteps/
31 stars 22 forks source link

Extra use case of `Claim`? #45

Open ifsheldon opened 2 months ago

ifsheldon commented 2 months ago

I've been following your proposal on Claim. An unexpected benefit from add Claim may be actually impacting how and what rustc decides to do to Copy values.

In my recent issue, a comment says the behavior that is conservative may be due to the aversion to copy large Copy values. The reason is fair enough but the behavior is a quirk nonetheless. So, then I thought, maybe when Claim is implemented, some large values are not Claim then the compiler can be safely ensured that it's not copying a large value, say [u8; 1024] so that it can just claim or copy a value for me in the case of my issue.