Skip to content

Commit 521fb04

Browse files
committed
compilation error regexp specific to rustc.
Fix #6887.
1 parent bed8489 commit 521fb04

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/etc/emacs/rust-mode.el

+15
Original file line numberDiff line numberDiff line change
@@ -225,4 +225,19 @@ 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 ((re (concat "^\\([^ \n]+\\):\\([0-9]+\\):\\([0-9]+\\): "
233+
"\\([0-9]+\\):\\([0-9]+\\) "
234+
"\\(?:[Ee]rror\\|\\([Ww]arning\\)\\):")))
235+
(cons re '(1 (2 . 4) (3 . 5) (6))))
236+
"Specifications for matching errors in rustc invocations.
237+
See `compilation-error-regexp-alist for help on their format.")
238+
239+
(add-to-list 'compilation-error-regexp-alist-alist
240+
(cons 'rustc rustc-compilation-regexps))
241+
(add-to-list 'compilation-error-regexp-alist 'rustc)
242+
228243
;;; rust-mode.el ends here

0 commit comments

Comments
 (0)