diff --git a/rustic-compile.el b/rustic-compile.el index a8b3680..ccfad02 100644 --- a/rustic-compile.el +++ b/rustic-compile.el @@ -153,7 +153,7 @@ "Create hyperlink in compilation buffers for file paths preceded by ':::'.") (defvar rustic-compilation-panic - (let ((panic "thread '[^']+' panicked at ") + (let ((panic "thread '[^']+'\\(?: ([0-9]+)\\)? panicked at ") (file "\\([^\n]+\\)") (start-line "\\([0-9]+\\)") (start-col "\\([0-9]+\\)")) diff --git a/test/rustic-compilation-error-tests.el b/test/rustic-compilation-error-tests.el index e48ed78..9612e78 100644 --- a/test/rustic-compilation-error-tests.el +++ b/test/rustic-compilation-error-tests.el @@ -239,4 +239,10 @@ (should (string= default-directory test-workspace)) (should-not (get-text-property (point) 'compilation-message))))))) +(ert-deftest rustic-compilation-panic-regex () + (let* ((cases '("thread 'crate::module::submodule::tests::test' (294268) panicked at lib/rs/mylib/src/module.rs:1282:76:" + "thread 'crate::module::submodule::tests::test' panicked at lib/rs/mylib/src/module.rs:1282:76:"))) + (dolist (s cases) + (should (string-match (car rustic-compilation-panic) s))))) + (provide 'rustic-compilation-error-tests)