diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-06-05 12:01:53 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-06-07 10:27:00 +1000 |
| commit | 392045b7e70cc68290851451994d4ea135ec3f0a (patch) | |
| tree | 38fb30c4216b8f11f20d047e8ae838a73b270e58 | |
| parent | 9fd6d979152db51271b12ad66ab7e8352e2bbd4f (diff) | |
| download | rust-392045b7e70cc68290851451994d4ea135ec3f0a.tar.gz rust-392045b7e70cc68290851451994d4ea135ec3f0a.zip | |
Make the two loops in `internalize_symbols` have the same form.
Because the next commit will merge them.
| -rw-r--r-- | compiler/rustc_monomorphize/src/partitioning.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/rustc_monomorphize/src/partitioning.rs b/compiler/rustc_monomorphize/src/partitioning.rs index 2909042a931..fb8c21c59f2 100644 --- a/compiler/rustc_monomorphize/src/partitioning.rs +++ b/compiler/rustc_monomorphize/src/partitioning.rs @@ -491,11 +491,14 @@ fn internalize_symbols<'tcx>( // can internalize all candidates, since there is nowhere else they // could be used from. for cgu in codegen_units { - for candidate in &internalization_candidates { - cgu.items_mut().insert(*candidate, (Linkage::Internal, Visibility::Default)); + for (item, linkage_and_visibility) in cgu.items_mut() { + if !internalization_candidates.contains(item) { + // This item is no candidate for internalizing, so skip it. + continue; + } + *linkage_and_visibility = (Linkage::Internal, Visibility::Default); } } - return; } |
