Skip to content

Commit bc7c3dc

Browse files
committed
sort_by_cached_key -> sort_by
1 parent 65aa0a6 commit bc7c3dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_mir/monomorphize/partitioning.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ fn merge_codegen_units<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>,
585585
// smallest into each other) we're sure to start off with a deterministic
586586
// order (sorted by name). This'll mean that if two cgus have the same size
587587
// the stable sort below will keep everything nice and deterministic.
588-
codegen_units.sort_by_key(|cgu| cgu.name().clone());
588+
codegen_units.sort_by_key(|cgu| *cgu.name());
589589

590590
// Merge the two smallest codegen units until the target size is reached.
591591
while codegen_units.len() > target_cgu_count {
@@ -985,7 +985,7 @@ fn collect_and_partition_mono_items<'a, 'tcx>(
985985
output.push_str(" @@");
986986
let mut empty = Vec::new();
987987
let cgus = item_to_cgus.get_mut(i).unwrap_or(&mut empty);
988-
cgus.as_mut_slice().sort_by_cached_key(|&(ref name, _)| name.clone());
988+
cgus.sort_by_key(|(name, _)| *name);
989989
cgus.dedup();
990990
for &(ref cgu_name, (linkage, _)) in cgus.iter() {
991991
output.push_str(" ");

0 commit comments

Comments
 (0)