about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-06-02 11:07:38 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2023-06-05 08:17:31 +1000
commit0a1cd5baa4d0ad4994f4038988a76770a6e2150c (patch)
tree24cb9c9c9cd80b9b47ec2c609cde563ba5bdd118 /compiler
parentdc25fbe9844f4c8bddc316685d270a49d7b159b9 (diff)
downloadrust-0a1cd5baa4d0ad4994f4038988a76770a6e2150c.tar.gz
rust-0a1cd5baa4d0ad4994f4038988a76770a6e2150c.zip
Remove some unnecessary `&mut`s.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_monomorphize/src/partitioning.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/compiler/rustc_monomorphize/src/partitioning.rs b/compiler/rustc_monomorphize/src/partitioning.rs
index 79fcd62bc62..e99551410e0 100644
--- a/compiler/rustc_monomorphize/src/partitioning.rs
+++ b/compiler/rustc_monomorphize/src/partitioning.rs
@@ -136,7 +136,7 @@ struct PlacedRootMonoItems<'tcx> {
 // The output CGUs are sorted by name.
 fn partition<'tcx, I>(
     tcx: TyCtxt<'tcx>,
-    mono_items: &mut I,
+    mono_items: I,
     max_cgu_count: usize,
     usage_map: &UsageMap<'tcx>,
 ) -> Vec<CodegenUnit<'tcx>>
@@ -239,7 +239,7 @@ where
 
 fn place_root_mono_items<'tcx, I>(
     cx: &PartitioningCx<'_, 'tcx>,
-    mono_items: &mut I,
+    mono_items: I,
 ) -> PlacedRootMonoItems<'tcx>
 where
     I: Iterator<Item = MonoItem<'tcx>>,
@@ -951,12 +951,8 @@ fn collect_and_partition_mono_items(tcx: TyCtxt<'_>, (): ()) -> (&DefIdSet, &[Co
     let (codegen_units, _) = tcx.sess.time("partition_and_assert_distinct_symbols", || {
         sync::join(
             || {
-                let mut codegen_units = partition(
-                    tcx,
-                    &mut items.iter().copied(),
-                    tcx.sess.codegen_units(),
-                    &usage_map,
-                );
+                let mut codegen_units =
+                    partition(tcx, items.iter().copied(), tcx.sess.codegen_units(), &usage_map);
                 codegen_units[0].make_primary();
                 &*tcx.arena.alloc_from_iter(codegen_units)
             },