-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-type-systemArea: Type systemArea: Type systemE-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.
Milestone
Description
Proposal: A closure is copyable iff everything in its environment is copyable. Furthermore, non-copyable ("one-shot") closures are allowed to capture and de-initialise outer variables.
This will allow building closures that run destructors for you. It will also fix #2828.
Closures' types can then be written with copy and send traits. fn x(f: fn()) { f(); f(); }
will no longer be legal; you have to write fn x(f: fn()<copy>)
or some-such.
Metadata
Metadata
Assignees
Labels
A-type-systemArea: Type systemArea: Type systemE-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.