File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -225,4 +225,27 @@ The initializer is `DEFAULT-TAB-WIDTH'.")
225225
226226(provide 'rust-mode )
227227
228+ ; ; Issue #6887: Rather than inheriting the 'gnu compilation error
229+ ; ; regexp (which is broken on a few edge cases), add our own 'rust
230+ ; ; compilation error regexp and use it instead.
231+ (defvar rustc-compilation-regexps
232+ (let ((file " ^\\ ([^\n ]+\\ )" )
233+ (start-line " \\ ([0-9]+\\ )" )
234+ (start-col " \\ ([0-9]+\\ )" )
235+ (end-line " \\ ([0-9]+\\ )" )
236+ (end-col " \\ ([0-9]+\\ )" )
237+ (error-or-warning " \\ (?:[Ee]rror\\ |\\ ([Ww]arning\\ )\\ )" ))
238+ (let ((re (concat " ^" file " :" start-line " :" start-col
239+ " : " end-line " :" end-col
240+ " \\ (?:[Ee]rror\\ |\\ ([Ww]arning\\ )\\ ):" )))
241+ (cons re '(1 (2 . 4 ) (3 . 5 ) (6 )))))
242+ " Specifications for matching errors in rustc invocations.
243+ See `compilation-error-regexp-alist for help on their format." )
244+
245+ (eval-after-load 'compile
246+ '(progn
247+ (add-to-list 'compilation-error-regexp-alist-alist
248+ (cons 'rustc rustc-compilation-regexps))
249+ (add-to-list 'compilation-error-regexp-alist 'rustc )))
250+
228251; ;; rust-mode.el ends here
You can’t perform that action at this time.
0 commit comments