about summary refs log tree commit diff
diff options
context:
space:
mode:
authorShotaro Yamada <sinkuu@sinkuu.xyz>2018-12-01 08:39:51 +0900
committerShotaro Yamada <sinkuu@sinkuu.xyz>2018-12-04 15:38:48 +0900
commitbc7c3dc71de785da813784bafaa490f12d4d7cfe (patch)
treeeff58c9f7fde6a052c956d6a0fb2ec9d3cd7cdd0
parent65aa0a6249b7d7afddbd7d5b9cf4c8c68575e334 (diff)
downloadrust-bc7c3dc71de785da813784bafaa490f12d4d7cfe.tar.gz
rust-bc7c3dc71de785da813784bafaa490f12d4d7cfe.zip
sort_by_cached_key -> sort_by
-rw-r--r--src/librustc_mir/monomorphize/partitioning.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_mir/monomorphize/partitioning.rs b/src/librustc_mir/monomorphize/partitioning.rs
index 3a6ee6da422..528942df29f 100644
--- a/src/librustc_mir/monomorphize/partitioning.rs
+++ b/src/librustc_mir/monomorphize/partitioning.rs
@@ -585,7 +585,7 @@ fn merge_codegen_units<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>,
     // smallest into each other) we're sure to start off with a deterministic
     // order (sorted by name). This'll mean that if two cgus have the same size
     // the stable sort below will keep everything nice and deterministic.
-    codegen_units.sort_by_key(|cgu| cgu.name().clone());
+    codegen_units.sort_by_key(|cgu| *cgu.name());
 
     // Merge the two smallest codegen units until the target size is reached.
     while codegen_units.len() > target_cgu_count {
@@ -985,7 +985,7 @@ fn collect_and_partition_mono_items<'a, 'tcx>(
                 output.push_str(" @@");
                 let mut empty = Vec::new();
                 let cgus = item_to_cgus.get_mut(i).unwrap_or(&mut empty);
-                cgus.as_mut_slice().sort_by_cached_key(|&(ref name, _)| name.clone());
+                cgus.sort_by_key(|(name, _)| *name);
                 cgus.dedup();
                 for &(ref cgu_name, (linkage, _)) in cgus.iter() {
                     output.push_str(" ");