Skip to content

Commit

Permalink
rustc_mir: don't run the deaggregator on arrays for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Feb 20, 2018
1 parent 6195ad8 commit d773d95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/librustc_mir/transform/deaggregator.rs
Expand Up @@ -41,7 +41,11 @@ impl MirPass for Deaggregator {

let can_deaggregate = |statement: &Statement| {
if let StatementKind::Assign(_, ref rhs) = statement.kind {
if let Rvalue::Aggregate(..) = *rhs {
if let Rvalue::Aggregate(ref kind, _) = *rhs {
// FIXME(#48193) Deaggregate arrays when it's cheaper to do so.
if let AggregateKind::Array(_) = **kind {
return false;
}
return true;
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/test/mir-opt/deaggregator_test_multiple.rs
Expand Up @@ -52,8 +52,7 @@ fn main() {
// ((_4 as A).0: i32) = move _5;
// discriminant(_4) = 0;
// ...
// _0[0 of 1] = move _2;
// _0[1 of 2] = move _4;
// _0 = [move _2, move _4];
// ...
// return;
// }
Expand Down

0 comments on commit d773d95

Please sign in to comment.