49c36bf16f
A way to remove otherwise unused locals from MIR There is a certain amount of desire for a pass which cleans up the provably unused variables (no assignments or reads). There has been an implementation of such pass by @scottcarr, and another (two!) implementations by me in my own dataflow efforts. PR like https://github.com/rust-lang/rust/pull/35916 proves that this pass is useful even on its own, which is why I cherry-picked it out from my dataflow effort. @nikomatsakis previously expressed concerns over this pass not seeming to be very cheap to run and therefore unsuitable for regular cleanup duties. Turns out, regular cleanup of local declarations is not at all necessary, at least now, because majority of passes simply do not (or should not) care about them. That’s why it is viable to only run this pass once (perhaps a few more times in the future?) per function, right before translation. r? @eddyb or @nikomatsakis |
||
---|---|---|
.. | ||
control_flow_graph | ||
graph | ||
obligation_forest | ||
snapshot_map | ||
unify | ||
veccell | ||
accumulate_vec.rs | ||
array_vec.rs | ||
bitslice.rs | ||
bitvec.rs | ||
blake2b.rs | ||
Cargo.toml | ||
flock.rs | ||
fmt_wrap.rs | ||
fnv.rs | ||
indexed_set.rs | ||
indexed_vec.rs | ||
ivar.rs | ||
lib.rs | ||
snapshot_vec.rs | ||
transitive_relation.rs | ||
tuple_slice.rs |