Skip to content

Commit 431bdbf

Browse files
committed
compilation error regexp specific to rustc.
Fix rust-lang#6887.
1 parent b6848f5 commit 431bdbf

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/etc/emacs/rust-mode.el

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,19 @@
220220

221221
(provide 'rust-mode)
222222

223+
;; Issue #6887: Rather than inheriting the 'gnu compilation error
224+
;; regexp (which is broken on a few edge cases), add our own 'rust
225+
;; compilation error regexp and use it instead.
226+
(defvar rustc-compilation-regexps
227+
(let ((re (concat "^\\([^ \n]+\\):\\([0-9]+\\):\\([0-9]+\\): "
228+
"\\([0-9]+\\):\\([0-9]+\\) "
229+
"\\(?:[Ee]rror\\|\\([Ww]arning\\)\\):")))
230+
(cons re '(1 (2 . 4) (3 . 5) (6))))
231+
"Specifications for matching errors in rustc invocations.
232+
See `compilation-error-regexp-alist for help on their format.")
233+
234+
(add-to-list 'compilation-error-regexp-alist-alist
235+
(cons 'rustc rustc-compilation-regexps))
236+
(add-to-list 'compilation-error-regexp-alist 'rustc)
237+
223238
;;; rust-mode.el ends here

0 commit comments

Comments
 (0)