Needed to make send_mapproperly dual-mode.
The way I see it, ~fn()s should always already be Const. &fn() and @fn() could perhaps be non-const if they had &muts or @muts in their environment.
Can we check for this and support putting closures in arcs?
EDIT: Per @bstrie's request, here is a list of what how the kinds work. For each kind bound K, a closure or trait bounded like fn:K() or TraitName:K can capture any values as long as their types do not contain the following ("mq" means any mutability qualifier):
Copy anything with a destructor, e.g. pipes, ARCs, fn:()/Trait: without Copy
'static &'r mq T, where 'r != 'static, fn:()/Trait: without 'static
Const &mut T, @mut T, &const T, RWARC, Cell, RcMut, fn:()/Trait: without Const
Owned &mq T, @mq T, Rc, RcMut, fn:()/Trait: without Owned
Needed to make
send_mapproperly dual-mode.The way I see it,
~fn()s should always already be Const.&fn()and@fn()could perhaps be non-const if they had&muts or@muts in their environment.Can we check for this and support putting closures in arcs?
EDIT: Per @bstrie's request, here is a list of what how the kinds work. For each kind bound
K, a closure or trait bounded likefn:K()orTraitName:Kcan capture any values as long as their types do not contain the following ("mq" means any mutability qualifier):