Navigation Menu

Skip to content

Commit

Permalink
address review feedback (sort_by_key is so much cleaner here than `…
Browse files Browse the repository at this point in the history
…sort_by`!).
  • Loading branch information
pnkfelix committed Jul 31, 2018
1 parent faf841a commit 779792f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/librustc_mir/borrow_check/mod.rs
Expand Up @@ -331,9 +331,7 @@ fn do_mir_borrowck<'a, 'gcx, 'tcx>(
}

if mbcx.errors_buffer.len() > 0 {
mbcx.errors_buffer.sort_by(|diag1, diag2| {
diag1.span.primary_span().cmp(&diag2.span.primary_span())
});
mbcx.errors_buffer.sort_by_key(|diag| diag.span.primary_span());

if tcx.migrate_borrowck() {
match tcx.borrowck(def_id).signalled_any_error {
Expand Down

0 comments on commit 779792f

Please sign in to comment.