@@ -128,7 +128,7 @@ impl<'tcx> Partition<'tcx> for Partitioner {
128128 & mut self ,
129129 cx : & PartitioningCx < ' _ , ' tcx > ,
130130 mono_items : & mut I ,
131- ) -> ( Vec < CodegenUnit < ' tcx > > , FxHashSet < MonoItem < ' tcx > > , FxHashSet < MonoItem < ' tcx > > )
131+ ) -> PlacedRootMonoItems < ' tcx >
132132 where
133133 I : Iterator < Item = MonoItem < ' tcx > > ,
134134 {
@@ -188,12 +188,18 @@ struct PartitioningCx<'a, 'tcx> {
188188 inlining_map : & ' a InliningMap < ' tcx > ,
189189}
190190
191+ pub struct PlacedRootMonoItems < ' tcx > {
192+ codegen_units : Vec < CodegenUnit < ' tcx > > ,
193+ roots : FxHashSet < MonoItem < ' tcx > > ,
194+ internalization_candidates : FxHashSet < MonoItem < ' tcx > > ,
195+ }
196+
191197trait Partition < ' tcx > {
192198 fn place_root_mono_items < I > (
193199 & mut self ,
194200 cx : & PartitioningCx < ' _ , ' tcx > ,
195201 mono_items : & mut I ,
196- ) -> ( Vec < CodegenUnit < ' tcx > > , FxHashSet < MonoItem < ' tcx > > , FxHashSet < MonoItem < ' tcx > > )
202+ ) -> PlacedRootMonoItems < ' tcx >
197203 where
198204 I : Iterator < Item = MonoItem < ' tcx > > ;
199205
@@ -247,7 +253,7 @@ where
247253 // In the first step, we place all regular monomorphizations into their
248254 // respective 'home' codegen unit. Regular monomorphizations are all
249255 // functions and statics defined in the local crate.
250- let ( mut codegen_units, roots, internalization_candidates) = {
256+ let PlacedRootMonoItems { mut codegen_units, roots, internalization_candidates } = {
251257 let _prof_timer = tcx. prof . generic_activity ( "cgu_partitioning_place_roots" ) ;
252258 partitioner. place_root_mono_items ( cx, mono_items)
253259 } ;
0 commit comments