]> git.lizzy.rs Git - rust.git/commit
mir: Reinstate while loop in deaggregator pass
authorUlrik Sverdrup <bluss@users.noreply.github.com>
Fri, 9 Dec 2016 15:28:54 +0000 (16:28 +0100)
committerUlrik Sverdrup <bluss@users.noreply.github.com>
Fri, 9 Dec 2016 17:16:38 +0000 (18:16 +0100)
commitfbc3f11fc18a626ba9b9f6bc52de4fc5ef75154b
treedc4bed62f9b5e72c0d973211cb66b574ffe60377
parentdedd9850841f20880b6318ce9cbe60e2b205b6a9
mir: Reinstate while loop in deaggregator pass

A previous commit must have removed the `while let` loop here by
mistake; for each basic block, it should find and deaggregate multiple
statements in their index order, and the `curr` index tracks the
progress through the block.

This fixes both the case of deaggregating statements in separate
basic blocks (preserving `curr` could prevent that) as well
as multiple times in the same block (missing loop prevented that).
src/librustc_mir/transform/deaggregator.rs
src/test/mir-opt/deaggregator_test_enum_2.rs [new file with mode: 0644]
src/test/mir-opt/deaggregator_test_multiple.rs [new file with mode: 0644]