about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/monomorphize
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-09-14 21:43:17 +0000
committerbors <bors@rust-lang.org>2020-09-14 21:43:17 +0000
commit9b4154193e8471f36b1a9e781f1ef7d492fc6a6c (patch)
treee6b2d628b74e7881a48bfae79107f09da7db18af /compiler/rustc_mir/src/monomorphize
parent41dc3942eb33e8e882b6e4782a9bd9d2b8970647 (diff)
parentb4935e07269429e04abe0d6d25f7e3211f4fa3f6 (diff)
Auto merge of #76541 - matthiaskrgr:unstable_sort, r=davidtwco
use sort_unstable to sort primitive types

It's not important to retain original order if we have &[1, 1, 2, 3] for example.

clippy::stable_sort_primitive
Diffstat (limited to 'compiler/rustc_mir/src/monomorphize')
-rw-r--r--compiler/rustc_mir/src/monomorphize/partitioning/merging.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_mir/src/monomorphize/partitioning/merging.rs b/compiler/rustc_mir/src/monomorphize/partitioning/merging.rs
index 1787e6df1b9..d92f1367e7d 100644
--- a/compiler/rustc_mir/src/monomorphize/partitioning/merging.rs
+++ b/compiler/rustc_mir/src/monomorphize/partitioning/merging.rs
@@ -74,7 +74,9 @@ pub fn merge_codegen_units<'tcx>(
 
                 // Sort the names, so things are deterministic and easy to
                 // predict.
-                cgu_contents.sort();
+
+                // We are sorting primitive &strs here so we can use unstable sort
+                cgu_contents.sort_unstable();
 
                 (current_cgu_name, cgu_contents.join("--"))
             })