diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index a2bf6c0839df..72817ad64521 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -745,6 +745,11 @@ fn check_expected_errors(&self, proc_res: &ProcRes) { } } + unexpected.sort_by_key(|e| (e.line_num, e.column_num)); + unimportant.sort_by_key(|e| (e.line_num, e.column_num)); + + // `not_found` are sorted because `expected_errors` are sorted as they are read from file + // line by line. let mut not_found = Vec::new(); // anything not yet found is a problem for (index, expected_error) in expected_errors.iter().enumerate() {