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
The liveness pass should be extended to treat stack closures just like a loop body. This is relatively straightforward. It would allow for a couple of nice things:
it'd be more efficient in some cases (I believe the last_use code I replaced actually did this right) because we could move values in if there were a loop like
let mut v = [];
uint::range(...) { |i|
use(v);
v = [some new vec];
}
it allows us to right fold for arbitrary iteration with only moves:
let mut b = b0;
for as.each { |a|
b <- op(a, b);
}
ret b;
In this case, the value in op(e, b) is actually moved out temporarily but always restored by the end of the loop. This would work today with a while loop but not with a closure-based loop.
The text was updated successfully, but these errors were encountered:
)
This fixes a regression introduced in rust-lang#2439 when write symtab json is enabled. We still need to take that into consideration and remove them if needed.
This change also simplifies the write symtab json regression to avoid the out of disk space issue we've been seeing since rust-lang#2439.
The liveness pass should be extended to treat stack closures just like a loop body. This is relatively straightforward. It would allow for a couple of nice things:
it'd be more efficient in some cases (I believe the last_use code I replaced actually did this right) because we could move values in if there were a loop like
let mut v = [];
uint::range(...) { |i|
use(v);
v = [some new vec];
}
it allows us to right fold for arbitrary iteration with only moves:
let mut b = b0;
for as.each { |a|
b <- op(a, b);
}
ret b;
In this case, the value in
op(e, b)
is actually moved out temporarily but always restored by the end of the loop. This would work today with a while loop but not with a closure-based loop.The text was updated successfully, but these errors were encountered: