Skip to content

Commit 392045b

Browse files
committed
Make the two loops in internalize_symbols have the same form.
Because the next commit will merge them.
1 parent 9fd6d97 commit 392045b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

compiler/rustc_monomorphize/src/partitioning.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,11 +491,14 @@ fn internalize_symbols<'tcx>(
491491
// can internalize all candidates, since there is nowhere else they
492492
// could be used from.
493493
for cgu in codegen_units {
494-
for candidate in &internalization_candidates {
495-
cgu.items_mut().insert(*candidate, (Linkage::Internal, Visibility::Default));
494+
for (item, linkage_and_visibility) in cgu.items_mut() {
495+
if !internalization_candidates.contains(item) {
496+
// This item is no candidate for internalizing, so skip it.
497+
continue;
498+
}
499+
*linkage_and_visibility = (Linkage::Internal, Visibility::Default);
496500
}
497501
}
498-
499502
return;
500503
}
501504

0 commit comments

Comments
 (0)