From 1253b59473916933b192e2f6e3eba57359a51f7b Mon Sep 17 00:00:00 2001 From: cydparser Date: Mon, 3 Mar 2025 14:38:12 -0800 Subject: [PATCH] Add regexp for stack backtrace locations Fixes #560 --- rust-compile.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rust-compile.el b/rust-compile.el index 04ac6b6..47798a0 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))) @@ -79,6 +85,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-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