Merge CGUs in a nicer way.

This commit is contained in:
Nicholas Nethercote 2023-06-15 18:58:23 +10:00
parent e414d25e94
commit 2af5f2276d

View File

@ -340,9 +340,7 @@ fn merge_codegen_units<'tcx>(
// Move the mono-items from `smallest` to `second_smallest`
second_smallest.modify_size_estimate(smallest.size_estimate());
for (k, v) in smallest.items_mut().drain() {
second_smallest.items_mut().insert(k, v);
}
second_smallest.items_mut().extend(smallest.items_mut().drain());
// Record that `second_smallest` now contains all the stuff that was
// in `smallest` before.