1
Fork 0

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
This commit is contained in:
bors 2020-09-14 21:43:17 +00:00
commit 9b4154193e
6 changed files with 16 additions and 9 deletions

View file

@ -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("--"))
})

View file

@ -230,8 +230,8 @@ fn get_arm_identity_info<'a, 'tcx>(
}
}
}
nop_stmts.sort();
// We sort primitive usize here so we can use unstable sort
nop_stmts.sort_unstable();
// Use one of the statements we're going to discard between the point
// where the storage location for the variant field becomes live and