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
Unboxed closures with all Clone members should implement Clone #23501
A-closuresArea: Closures (`|…| { … }`)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.P-lowLow priorityT-langRelevant to the language team
This is important for iterators -- with this we can clone most iterator pipelines. In fact, most don't even need captures at all and would be the cheapest to clone.
This would be good for situations in which one wants to box and store a closure in a small minority of cases. Would be good to be able to have something like Cow<'a, Fn(...)>.
A-closuresArea: Closures (`|…| { … }`)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.P-lowLow priorityT-langRelevant to the language team
Activity
bluss commentedon Apr 27, 2015
This is important for iterators -- with this we can clone most iterator pipelines. In fact, most don't even need captures at all and would be the cheapest to clone.
withoutboats commentedon Nov 14, 2015
This would be good for situations in which one wants to box and store a closure in a small minority of cases. Would be good to be able to have something like
Cow<'a, Fn(...)>.arielb1 commentedon Nov 14, 2015
Sounds like an nice idea. Unfortunately it would require
Cloneto be a lang-item, but it is already half a lang-item as a supertrait toCopy.seanmonstar commentedon Nov 14, 2015
The expanded closure struct couldn't have the equivalent of 'derive(Clone)'
added to it?
On Sat, Nov 14, 2015, 9:32 AM arielb1 [email protected] wrote:
arielb1 commentedon Nov 14, 2015
@seanmonstar
derive(Clone)runs before upvars are known.oli-obk commentedon Nov 24, 2017
I think this can be closed now that we have #44490