1
Fork 0

Change collect_and_partition_mono_items tuple return type to a struct

This commit is contained in:
Oli Scherer 2025-01-27 08:11:02 +00:00
parent 633a3fe36d
commit b24f674520
9 changed files with 33 additions and 21 deletions

View file

@ -46,8 +46,12 @@ pub fn assert_module_sources(tcx: TyCtxt<'_>, set_reuse: &dyn Fn(&mut CguReuseTr
return;
}
let available_cgus =
tcx.collect_and_partition_mono_items(()).1.iter().map(|cgu| cgu.name()).collect();
let available_cgus = tcx
.collect_and_partition_mono_items(())
.codegen_units
.iter()
.map(|cgu| cgu.name())
.collect();
let mut ams = AssertModuleSource {
tcx,

View file

@ -293,7 +293,7 @@ fn exported_symbols_provider_local(
// external linkage is enough for monomorphization to be linked to.
let need_visibility = tcx.sess.target.dynamic_linking && !tcx.sess.target.only_cdylib;
let (_, cgus) = tcx.collect_and_partition_mono_items(());
let cgus = tcx.collect_and_partition_mono_items(()).codegen_units;
// The symbols created in this loop are sorted below it
#[allow(rustc::potential_query_instability)]

View file

@ -619,7 +619,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
// Run the monomorphization collector and partition the collected items into
// codegen units.
let codegen_units = tcx.collect_and_partition_mono_items(()).1;
let codegen_units = tcx.collect_and_partition_mono_items(()).codegen_units;
// 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
@ -1051,7 +1051,7 @@ pub(crate) fn provide(providers: &mut Providers) {
config::OptLevel::SizeMin => config::OptLevel::Default,
};
let (defids, _) = tcx.collect_and_partition_mono_items(cratenum);
let defids = tcx.collect_and_partition_mono_items(cratenum).all_mono_items;
let any_for_speed = defids.items().any(|id| {
let CodegenFnAttrs { optimize, .. } = tcx.codegen_fn_attrs(*id);