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
{{ message }}
Repository navigation
Tracking issue for RFC 2132: copy_closures/clone_closures #44490
What do we want to do around stabilization here? @cramertj was floating the idea of stabilizing only the clone impl for closures, not the copy one, at least until such time as we have a workable "unexpected copy" lint that would push you to invoke clone when copying closures (but that lint probably wants a bit of design).
Personally, I think I'd be ok stabilizing copy/clone closures in their entirety, but we probably want to see a bit more usage in the wild.
changed the title [-]Tracking issue for RFC 2132: Copy/Clone Closures[/-][+]Tracking issue for RFC 2132: copy_closures/clone_closures[/+]on Nov 17, 2017
I haven't used this directly yet, but I can definitely report that people have complained to me that we don't have this feature on stable yet because it's unnecessarily forced them to change their design. It solves one of those irritating "when you want it, you really want it" problems, imo. :)
Reacted by Jon Gjengset, Nathan Kleyn, Sean Bowe and Katharina Fey
What's the status on this? Is it ready to stabilize once docs are ready? I'm planning a rewrite of some closure-related docs in the reference, so if this is going in, I'll include that.
The reference is already updated. RBE probably doesn't need updating, the stdlib could maybe use mention on Copy and Clone traits, and I'm unsure about the book. @steveklabnik?
Activity
nikomatsakis commentedon Sep 13, 2017
I believe that @scalexm has implemented this RFC already. =)
arielb1 commentedon Sep 13, 2017
@nmatsakis
That was for tuples, not for closures.
nikomatsakis commentedon Sep 14, 2017
@arielb1 I was referring to #44551
Auto merge of #44551 - scalexm:copy-clone-closures, r=arielb1
scalexm commentedon Sep 25, 2017
(I think we can tick the first box)
nikomatsakis commentedon Oct 16, 2017
What do we want to do around stabilization here? @cramertj was floating the idea of stabilizing only the clone impl for closures, not the copy one, at least until such time as we have a workable "unexpected copy" lint that would push you to invoke
clonewhen copying closures (but that lint probably wants a bit of design).Personally, I think I'd be ok stabilizing copy/clone closures in their entirety, but we probably want to see a bit more usage in the wild.
Can anyone report on using this feature?
cramertj commentedon Oct 16, 2017
I've been messing with it in some personal stuff, and I've really enjoyed having the feature. I'd be in favor of stabilizing both
CopyandClone.[-]Tracking issue for RFC 2132: Copy/Clone Closures[/-][+]Tracking issue for RFC 2132: copy_closures/clone_closures[/+]tuxmark5 commentedon Nov 24, 2017
Any plans to extend this to support cloning generators as well?
solson commentedon Dec 9, 2017
I haven't used this directly yet, but I can definitely report that people have complained to me that we don't have this feature on stable yet because it's unnecessarily forced them to change their design. It solves one of those irritating "when you want it, you really want it" problems, imo. :)
alercah commentedon Feb 10, 2018
What's the status on this? Is it ready to stabilize once docs are ready? I'm planning a rewrite of some closure-related docs in the reference, so if this is going in, I'll include that.
5 remaining items
cramertj commentedon Feb 23, 2018
Yes, you're correct-- I should have said non-move closures which do not mutate or move captured variables are copy.
rfcbot commentedon Feb 23, 2018
🔔 This is now entering its final comment period, as per the review above. 🔔
rfcbot commentedon Mar 5, 2018
The final comment period is now complete.
nikomatsakis commentedon Mar 7, 2018
I marked as E-mentor -- looks like we're ready for a stabilization PR here, right? There are instructions on the forge.
alercah commentedon Mar 7, 2018
The reference is already updated. RBE probably doesn't need updating, the stdlib could maybe use mention on
CopyandClonetraits, and I'm unsure about the book. @steveklabnik?nikomatsakis commentedon Mar 8, 2018
@alercah sounds right
SimonSapin commentedon Mar 23, 2018
Stabilization PR (with mention in docs for
CloneandCopy): #49299Rollup merge of rust-lang#49299 - SimonSapin:ubiquity, r=nikomatsakis
Rollup merge of rust-lang#49299 - SimonSapin:ubiquity, r=nikomatsakis
SimonSapin commentedon Mar 24, 2018
#49299 is merged, I think this is it. Let me know if I forgot something relevant to this tracking issue.