]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_typeck/src/check/mod.rs
Auto merge of #76541 - matthiaskrgr:unstable_sort, r=davidtwco
[rust.git] / compiler / rustc_typeck / src / check / mod.rs
index e3846d9c4efcc92e908a2d262afe2761d7e9ab7d..9a9e57638d7589ad10c85c3c13f94709bcf5407a 100644 (file)
@@ -4285,11 +4285,13 @@ fn point_at_arg_instead_of_call_if_possible(
                             None
                         }
                     })
-                    .collect::<Vec<_>>();
+                    .collect::<Vec<usize>>();
 
                 // Both checked and coerced types could have matched, thus we need to remove
                 // duplicates.
-                referenced_in.sort();
+
+                // We sort primitive type usize here and can use unstable sort
+                referenced_in.sort_unstable();
                 referenced_in.dedup();
 
                 if let (Some(ref_in), None) = (referenced_in.pop(), referenced_in.pop()) {