summaryrefslogtreecommitdiff
path: root/rust-compile.el
diff options
context:
space:
mode:
authorSibi Prabakaran <sibi@psibi.in>2025-06-09 19:50:10 +0530
committerGitHub <noreply@github.com>2025-06-09 19:50:10 +0530
commit0d5d54a19e89f9012f3fa84174f562ab18cebb96 (patch)
tree81c2dd704c45c75162e6fab684129c18fde03847 /rust-compile.el
parent25d91cff281909e9b7cb84e31211c4e7b0480f94 (diff)
parent684f67938c7f7e8c0f3cee638f03f2603e0e1e3f (diff)
downloadrust-mode-0d5d54a19e89f9012f3fa84174f562ab18cebb96.tar.gz
Merge pull request #569 from hron/rust-compilation-dbg!
Add compilation regexp to match ‘dbg!’ output
Diffstat (limited to 'rust-compile.el')
-rw-r--r--rust-compile.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/rust-compile.el b/rust-compile.el
index 04ac6b6..abeb753 100644
--- a/rust-compile.el
+++ b/rust-compile.el
@@ -48,6 +48,12 @@ See `compilation-error-regexp-alist' for help on their format.")
"Specifications for matching panics in cargo test invocations.
See `compilation-error-regexp-alist' for help on their format.")
+(defvar rustc-dbg!-compilation-regexps
+ (let ((re (concat "\\[" rustc-compilation-location "\\]")))
+ (cons re '(2 3 4 0 1)))
+ "Specifications for matching dbg! output.
+See `compilation-error-regexp-alist' for help on their format.")
+
(defun rustc-scroll-down-after-next-error ()
"In the new style error messages, the regular expression
matches on the file name (which appears after `-->`), but the
@@ -85,6 +91,9 @@ the compilation window until the top of the error is visible."
(cons 'rustc-panics rustc-panics-compilation-regexps))
(add-to-list 'compilation-error-regexp-alist 'rustc-panics)
(add-to-list 'compilation-error-regexp-alist 'cargo)
+ (add-to-list 'compilation-error-regexp-alist-alist
+ (cons 'rust-dbg! rustc-dbg!-compilation-regexps))
+ (add-to-list 'compilation-error-regexp-alist 'rust-dbg!)
(add-hook 'next-error-hook #'rustc-scroll-down-after-next-error)))
;;; _