Skip to content

Commit 4e938b1

Browse files
committed
Merge pull request #63 from krig/panic-compilation-warning
Match panics during build as compilation warnings
2 parents 78e8b08 + f17e11a commit 4e938b1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

rust-mode.el

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,11 +752,21 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
752752
"Specifications for matching errors in rustc invocations.
753753
See `compilation-error-regexp-alist for help on their format.")
754754

755+
;; Match test run failures and panics during compilation as
756+
;; compilation warnings
757+
(defvar cargo-compilation-regexps
758+
'("^\\s-+thread '[^']+' panicked at \\('[^']+', \\([^:]+\\):\\([0-9]+\\)\\)" 2 3 nil nil 1)
759+
"Specifications for matching panics in cargo test invocations.
760+
See `compilation-error-regexp-alist for help on their format.")
761+
755762
(eval-after-load 'compile
756763
'(progn
757764
(add-to-list 'compilation-error-regexp-alist-alist
758765
(cons 'rustc rustc-compilation-regexps))
759-
(add-to-list 'compilation-error-regexp-alist 'rustc)))
766+
(add-to-list 'compilation-error-regexp-alist 'rustc)
767+
(add-to-list 'compilation-error-regexp-alist-alist
768+
(cons 'cargo cargo-compilation-regexps))
769+
(add-to-list 'compilation-error-regexp-alist 'cargo)))
760770

761771
;;; Functions to submit (parts of) buffers to the rust playpen, for
762772
;;; sharing.

0 commit comments

Comments
 (0)