From ceefc859b5b7beee917a00a8b32a28f940568ab3 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 19 Mar 2024 20:50:13 +0100 Subject: [PATCH] experiment: run mono-item collection in check build --- compiler/rustc_codegen_ssa/src/base.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/base.rs b/compiler/rustc_codegen_ssa/src/base.rs index c316d19e04119..a0363cc3dfeb4 100644 --- a/compiler/rustc_codegen_ssa/src/base.rs +++ b/compiler/rustc_codegen_ssa/src/base.rs @@ -573,6 +573,10 @@ pub fn codegen_crate( metadata: EncodedMetadata, need_metadata_module: bool, ) -> OngoingCodegen { + // Run the monomorphization collector and partition the collected items into + // codegen units. + let codegen_units = tcx.collect_and_partition_mono_items(()).1; + // Skip crate items and just output metadata in -Z no-codegen mode. if tcx.sess.opts.unstable_opts.no_codegen || !tcx.sess.opts.output_types.should_codegen() { let ongoing_codegen = start_async_codegen(backend, tcx, target_cpu, metadata, None); @@ -586,10 +590,6 @@ pub fn codegen_crate( let cgu_name_builder = &mut CodegenUnitNameBuilder::new(tcx); - // Run the monomorphization collector and partition the collected items into - // codegen units. - let codegen_units = tcx.collect_and_partition_mono_items(()).1; - // Force all codegen_unit queries so they are already either red or green // when compile_codegen_unit accesses them. We are not able to re-execute // the codegen_unit query from just the DepNode, so an unknown color would