From 819bf7120acf78a2ad2c1feafdd944ec29fffd12 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 9 Jun 2023 09:43:06 +1000 Subject: [PATCH] Don't merge CGUs in incremental builds. --- compiler/rustc_monomorphize/src/partitioning.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_monomorphize/src/partitioning.rs b/compiler/rustc_monomorphize/src/partitioning.rs index 79fcd62bc6206..f6f7a63fd3537 100644 --- a/compiler/rustc_monomorphize/src/partitioning.rs +++ b/compiler/rustc_monomorphize/src/partitioning.rs @@ -161,10 +161,11 @@ where debug_dump(tcx, "INITIAL PARTITIONING", &codegen_units); + // njn: update comment // Merge until we have at most `max_cgu_count` codegen units. // `merge_codegen_units` is responsible for updating the CGU size // estimates. - { + if cx.tcx.sess.opts.incremental.is_none() { let _prof_timer = tcx.prof.generic_activity("cgu_partitioning_merge_cgus"); merge_codegen_units(cx, &mut codegen_units); debug_dump(tcx, "POST MERGING", &codegen_units);