@@ -194,7 +194,7 @@ use rustc_hir as hir;
194194use rustc_hir:: def_id:: { DefId , DefIdMap , LOCAL_CRATE } ;
195195use rustc_hir:: itemlikevisit:: ItemLikeVisitor ;
196196use rustc_index:: bit_set:: GrowableBitSet ;
197-
197+ use smallvec :: SmallVec ;
198198use std:: iter;
199199
200200#[ derive( PartialEq ) ]
@@ -227,9 +227,7 @@ impl<'tcx> InliningMap<'tcx> {
227227 }
228228 }
229229
230- fn record_accesses < I > ( & mut self , source : MonoItem < ' tcx > , new_targets : I )
231- where
232- I : Iterator < Item = ( MonoItem < ' tcx > , bool ) > + ExactSizeIterator ,
230+ fn record_accesses ( & mut self , source : MonoItem < ' tcx > , new_targets : & [ ( MonoItem < ' tcx > , bool ) ] )
233231 {
234232 assert ! ( !self . index. contains_key( & source) ) ;
235233
@@ -240,9 +238,9 @@ impl<'tcx> InliningMap<'tcx> {
240238 self . targets . reserve ( new_items_count) ;
241239 self . inlines . ensure ( new_items_count_total) ;
242240
243- for ( i, ( target, inline) ) in new_targets. enumerate ( ) {
244- self . targets . push ( target) ;
245- if inline {
241+ for ( i, ( target, inline) ) in new_targets. iter ( ) . enumerate ( ) {
242+ self . targets . push ( * target) ;
243+ if * inline {
246244 self . inlines . insert ( i + start_index) ;
247245 }
248246 }
@@ -403,10 +401,12 @@ fn record_accesses<'tcx>(
403401 mono_item. instantiation_mode ( tcx) == InstantiationMode :: LocalCopy
404402 } ;
405403
406- let accesses =
407- callees. into_iter ( ) . map ( |mono_item| ( * mono_item, is_inlining_candidate ( mono_item) ) ) ;
404+ let accesses: SmallVec < [ _ ; 128 ] > = callees
405+ . into_iter ( )
406+ . map ( |mono_item| ( * mono_item, is_inlining_candidate ( mono_item) ) )
407+ . collect ( ) ;
408408
409- inlining_map. lock_mut ( ) . record_accesses ( caller, accesses) ;
409+ inlining_map. lock_mut ( ) . record_accesses ( caller, & accesses) ;
410410}
411411
412412fn check_recursion_limit < ' tcx > (
0 commit comments