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:
parent
d92155bf6a
commit
b4935e0726
6 changed files with 16 additions and 9 deletions
|
@ -1121,7 +1121,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
// features. We check that at least one type is available for
|
||||
// the current target.
|
||||
let reg_class = reg.reg_class();
|
||||
let mut required_features = vec![];
|
||||
let mut required_features: Vec<&str> = vec![];
|
||||
for &(_, feature) in reg_class.supported_types(asm_arch) {
|
||||
if let Some(feature) = feature {
|
||||
if self.sess.target_features.contains(&Symbol::intern(feature)) {
|
||||
|
@ -1135,7 +1135,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
break;
|
||||
}
|
||||
}
|
||||
required_features.sort();
|
||||
// We are sorting primitive strs here and can use unstable sort here
|
||||
required_features.sort_unstable();
|
||||
required_features.dedup();
|
||||
match &required_features[..] {
|
||||
[] => {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue