Skip to content

Commit

Permalink
Add compilation regex for panics.
Browse files Browse the repository at this point in the history
  • Loading branch information
zlef committed Feb 12, 2024
1 parent 9c26dc1 commit 70659a2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rust-compile.el
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ See `compilation-error-regexp-alist' for help on their format.")
"Specifications for matching code references in rustc invocations.
See `compilation-error-regexp-alist' for help on their format.")

(defvar rustc-panic-run-regexps
(let ((re (concat "thread '[[:alnum:]]+' panicked at " rustc-compilation-location)))
(cons re '(2 3 4 nil nil)))
"Specifications for matching code references in rustc invocations.
See `compilation-error-regexp-alist' for help on their format.")

;; Match test run failures and panics during compilation as
;; compilation warnings
(defvar cargo-compilation-regexps
Expand Down Expand Up @@ -73,6 +79,9 @@ the compilation window until the top of the error is visible."
(add-to-list 'compilation-error-regexp-alist-alist
(cons 'rustc-colon rustc-colon-compilation-regexps))
(add-to-list 'compilation-error-regexp-alist 'rustc-colon)
(add-to-list 'compilation-error-regexp-alist-alist
(cons 'rustc-panic rustc-panic-run-regexps))
(add-to-list 'compilation-error-regexp-alist 'rustc-panic)
(add-to-list 'compilation-error-regexp-alist-alist
(cons 'cargo cargo-compilation-regexps))
(add-to-list 'compilation-error-regexp-alist 'cargo)
Expand Down

0 comments on commit 70659a2

Please sign in to comment.