File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -146,12 +146,15 @@ impl Diagnostics {
146146 }
147147 }
148148
149- self . messages
149+ let mut result: Vec < _ > = self
150+ . messages
150151 . iter ( )
151152 . enumerate ( )
152153 . filter ( |( i, _) | !suppressed[ * i] )
153154 . map ( |( _, m) | m. clone ( ) )
154- . collect ( )
155+ . collect ( ) ;
156+ result. sort_by_key ( |m| m. range . start ( ) ) ;
157+ result
155158 }
156159
157160 /// Raw access to all diagnostics (for debugging/testing).
Original file line number Diff line number Diff line change @@ -37,14 +37,14 @@ fn combined_errors() {
3737 let q = Query :: try_from ( "(call (Undefined) extra)" ) . unwrap ( ) ;
3838 assert ! ( !q. is_valid( ) ) ;
3939 insta:: assert_snapshot!( q. dump_diagnostics( ) , @r"
40- error: bare identifier is not a valid expression; wrap in parentheses: `(identifier)`
40+ error: `Undefined` is not defined
4141 |
4242 1 | (call (Undefined) extra)
43- | ^^^^^
43+ | ^^^^ ^^^^^
4444
45- error: `Undefined` is not defined
45+ error: bare identifier is not a valid expression; wrap in parentheses: `(identifier)`
4646 |
4747 1 | (call (Undefined) extra)
48- | ^^^^ ^^^^^
48+ | ^^^^^
4949 " ) ;
5050}
You can’t perform that action at this time.
0 commit comments