Closed
Description
UPDATE:
This is a meta-bug now for tracking the work on completing closures. Now that #6801 has landed, the remaining pieces of work are:
- Issue Cleanup region hierarchy code, especially around closures #3696: Define region hierarchy for closures
- Issue proc bounds and closure lifetimes are parsed incorrectly #10553: We should not be accepting
'a ||
as syntax - Issue support unboxed, uniquely typed closures #8622: Unboxed closures -- for the purposes of Closure reform #2202, just having a design and ensuring our treatment of closures is compatible with it is enough.
- Issue Calling a closure needs to be treated like a unique-immutable borrow #12224: Calling a closure is a kind of borrow.
- Issue Explain closures much better in the tutorial #13621: Explain closures much better in the tutorial
ORIGINAL FOLLOWS:
We need to revamp function types in light of regions. I think fn()
(the "any" function) will go away, and fn@()
and fn~()
will be coercable to fn&()
, just as with poiners/vectors/slices/etc. Also, fn&()
becomes fn&r()
(that is, r is a region), though the user won't typically need to write it. We can probably leave the representation as is, though we could also tweak fn&()
to not have a ref count since there will be an explicit borrowing that occurs.