Skip to content

Commit 1253b59

Browse files
committed
Add regexp for stack backtrace locations
Fixes rust-lang#560
1 parent efd8308 commit 1253b59

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

rust-compile.el

+9
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ See `compilation-error-regexp-alist' for help on their format.")
2828
"Specifications for matching `:::` hints in rustc invocations.
2929
See `compilation-error-regexp-alist' for help on their format.")
3030

31+
(defvar rustc-backtrace-compilation-regexps
32+
(let ((re (concat "^ +at " rustc-compilation-location)))
33+
(cons re '(2 3 4 0 1)))
34+
"Specifications for matching stack backtraces in rustc invocations.
35+
See `compilation-error-regexp-alist' for help on their format.")
36+
3137
(defvar rustc-refs-compilation-regexps
3238
(let ((re "^\\([0-9]+\\)[[:space:]]*|"))
3339
(cons re '(nil 1 nil 0 1)))
@@ -79,6 +85,9 @@ the compilation window until the top of the error is visible."
7985
(add-to-list 'compilation-error-regexp-alist-alist
8086
(cons 'rustc-colon rustc-colon-compilation-regexps))
8187
(add-to-list 'compilation-error-regexp-alist 'rustc-colon)
88+
(add-to-list 'compilation-error-regexp-alist-alist
89+
(cons 'rustc-backtrace rustc-backtrace-compilation-regexps))
90+
(add-to-list 'compilation-error-regexp-alist 'rustc-backtrace)
8291
(add-to-list 'compilation-error-regexp-alist-alist
8392
(cons 'cargo cargo-compilation-regexps))
8493
(add-to-list 'compilation-error-regexp-alist-alist

0 commit comments

Comments
 (0)