We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
sort_by_key
sort_by
1 parent f93827f commit ea32862Copy full SHA for ea32862
src/librustc_errors/emitter.rs
@@ -954,9 +954,9 @@ impl EmitterWriter {
954
// | | |
955
// | | something about `foo`
956
// | something about `fn foo()`
957
- annotations_position.sort_by(|a, b| {
+ annotations_position.sort_by_key(|x| {
958
// Decreasing order. When `a` and `b` are the same length, prefer `Primary`.
959
- (a.1.len(), !a.1.is_primary).cmp(&(b.1.len(), !b.1.is_primary)).reverse()
+ (Reverse(a.1.len()), a.1.is_primary)
960
});
961
962
// Write the underlines.
0 commit comments