File tree 2 files changed +16
-16
lines changed
compiler/rustc_monomorphize/src
2 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -231,8 +231,8 @@ impl<'tcx> UsageMap<'tcx> {
231
231
assert ! ( self . used_map. insert( user_item, used_items) . is_none( ) ) ;
232
232
}
233
233
234
- pub fn get_user_items ( & self , item : MonoItem < ' tcx > ) -> Option < & [ MonoItem < ' tcx > ] > {
235
- self . user_map . get ( & item) . map ( |items| items. as_slice ( ) )
234
+ pub fn get_user_items ( & self , item : MonoItem < ' tcx > ) -> & [ MonoItem < ' tcx > ] {
235
+ self . user_map . get ( & item) . map ( |items| items. as_slice ( ) ) . unwrap_or ( & [ ] )
236
236
}
237
237
238
238
/// Internally iterate over all inlined items used by `item`.
Original file line number Diff line number Diff line change @@ -495,20 +495,20 @@ fn internalize_symbols<'tcx>(
495
495
if !single_codegen_unit {
496
496
debug_assert_eq ! ( mono_item_placements[ item] , home_cgu) ;
497
497
498
- if let Some ( user_items ) = cx . usage_map . get_user_items ( * item ) {
499
- if user_items
500
- . iter ( )
501
- . filter_map ( |user_item| {
502
- // Some user mono items might not have been
503
- // instantiated. We can safely ignore those.
504
- mono_item_placements . get ( user_item )
505
- } )
506
- . any ( |placement| * placement != home_cgu )
507
- {
508
- // Found a user from another CGU, so skip to the next item
509
- // without marking this one as internal.
510
- continue ;
511
- }
498
+ if cx
499
+ . usage_map
500
+ . get_user_items ( * item )
501
+ . iter ( )
502
+ . filter_map ( |user_item| {
503
+ // Some user mono items might not have been
504
+ // instantiated. We can safely ignore those.
505
+ mono_item_placements . get ( user_item )
506
+ } )
507
+ . any ( |placement| * placement != home_cgu )
508
+ {
509
+ // Found a user from another CGU, so skip to the next item
510
+ // without marking this one as internal.
511
+ continue ;
512
512
}
513
513
}
514
514
You can’t perform that action at this time.
0 commit comments