summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rust-compile.el9
-rw-r--r--rust-mode-tests.el7
2 files changed, 14 insertions, 2 deletions
diff --git a/rust-compile.el b/rust-compile.el
index abeb753..cbdf43a 100644
--- a/rust-compile.el
+++ b/rust-compile.el
@@ -28,6 +28,12 @@ See `compilation-error-regexp-alist' for help on their format.")
"Specifications for matching `:::` hints in rustc invocations.
See `compilation-error-regexp-alist' for help on their format.")
+(defvar rustc-backtrace-compilation-regexps
+ (let ((re (concat "^ +at " rustc-compilation-location)))
+ (cons re '(2 3 4 0 1)))
+ "Specifications for matching stack backtraces in rustc invocations.
+See `compilation-error-regexp-alist' for help on their format.")
+
(defvar rustc-refs-compilation-regexps
(let ((re "^\\([0-9]+\\)[[:space:]]*|"))
(cons re '(nil 1 nil 0 1)))
@@ -86,6 +92,9 @@ the compilation window until the top of the error is visible."
(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-backtrace rustc-backtrace-compilation-regexps))
+ (add-to-list 'compilation-error-regexp-alist 'rustc-backtrace)
+ (add-to-list 'compilation-error-regexp-alist-alist
(cons 'cargo cargo-compilation-regexps))
(add-to-list 'compilation-error-regexp-alist-alist
(cons 'rustc-panics rustc-panics-compilation-regexps))
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 56d759c..259afb2 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -3694,6 +3694,7 @@ let b = 1;"
(insert " ::: file5.rs:12:34\n\n")
(insert "thread 'main' panicked at src/file7.rs:12:34:\n\n")
(insert "[src/file8.rs:159:5] symbol_value(SOME_VAR) = Some(\n\n")
+ (insert " at file9.rs:12:34\n\n")
;; should not match
(insert "werror found a -> b\n --> no_match.rs:12:34\n\n")
(insert "error[E0061]: this function takes 1 parameter but 2 parameters were supplied\n --> file6.rs:132:34
@@ -3714,13 +3715,15 @@ let b = 1;"
((like-previous-one "82" back-to-indentation compilation-info "82")
(like-previous-one "132" back-to-indentation compilation-info "132"))
(("src/file7.rs" "12" "34" nil "src/file7.rs:12:34"))
- (("src/file8.rs" "159" "5" compilation-info "src/file8.rs:159:5")))
+ (("src/file8.rs" "159" "5" compilation-info "src/file8.rs:159:5"))
+ (("file9.rs" "12" "34" compilation-info "file9.rs:12:34")))
(mapcar #'rust-collect-matches
(list rustc-compilation-regexps
rustc-colon-compilation-regexps
rustc-refs-compilation-regexps
rustc-panics-compilation-regexps
- rustc-dbg!-compilation-regexps))))))
+ rustc-dbg!-compilation-regexps
+ rustc-backtrace-compilation-regexps))))))
;; If electric-pair-mode is available, load it and run the tests that use it. If not,
;; no error--the tests will be skipped.