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
We can't enable lambda lifting because some of our tests have free variables in lambda functions.
To handle mutated free variables in lambdas, we do an additional prepass
that transforms turns modified free variables into use of a &mut free variable. A minimal
transformation is as follows:
|x| { c = x; e }
===>
{ let ac = &mut c; |x| { let c = move *ac; let res = { c = x; e }; *ac = move c; res } }
after which, the lambda has no mutated free variables and can be replaced by Closure(lifted, ac).
Now, what borrow analysis can do with that remains to be seen. We may want to do something
special if the lambda already uses &mut c for free variable c.
The text was updated successfully, but these errors were encountered:
馃殌 Feature Request
We can't enable lambda lifting because some of our tests have free variables in lambda functions.
To handle mutated free variables in lambdas, we do an additional prepass
that transforms turns modified free variables into use of a
&mut
free variable. A minimaltransformation is as follows:
after which, the lambda has no mutated free variables and can be replaced by Closure(lifted, ac).
Now, what borrow analysis can do with that remains to be seen. We may want to do something
special if the lambda already uses
&mut c
for free variablec
.The text was updated successfully, but these errors were encountered: