Skip to content

Commit b91a7e5

Browse files
committed
rustc_mir: don't run the deaggregator on arrays for now.
1 parent 8a09787 commit b91a7e5

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/librustc_mir/transform/deaggregator.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ impl MirPass for Deaggregator {
4141

4242
let can_deaggregate = |statement: &Statement| {
4343
if let StatementKind::Assign(_, ref rhs) = statement.kind {
44-
if let Rvalue::Aggregate(..) = *rhs {
44+
if let Rvalue::Aggregate(ref kind, _) = *rhs {
45+
// FIXME(#48193) Deaggregate arrays when it's cheaper to do so.
46+
if let AggregateKind::Array(_) = **kind {
47+
return false;
48+
}
4549
return true;
4650
}
4751
}

src/test/mir-opt/deaggregator_test_multiple.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ fn main() {
5252
// ((_4 as A).0: i32) = move _5;
5353
// discriminant(_4) = 0;
5454
// ...
55-
// _0[0 of 1] = move _2;
56-
// _0[1 of 2] = move _4;
55+
// _0 = [move _2, move _4];
5756
// ...
5857
// return;
5958
// }

0 commit comments

Comments
 (0)