Sort NLL error diagnostics by span in an attempt to make them match source order
(and thus, hopefully, more closely match user expectation).
This commit is contained in:
parent
54628c8ea8
commit
e8c29959cd
@ -331,6 +331,10 @@ 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())
|
||||
});
|
||||
|
||||
if tcx.migrate_borrowck() {
|
||||
match tcx.borrowck(def_id).signalled_any_error {
|
||||
SignalledError::NoErrorsSeen => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user