emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/rust-mode aad506d 1/3: Fix cargo compilation regex startin


From: ELPA Syncer
Subject: [nongnu] elpa/rust-mode aad506d 1/3: Fix cargo compilation regex starting match
Date: Thu, 16 Dec 2021 16:58:13 -0500 (EST)

branch: elpa/rust-mode
commit aad506dfb2bf5dc1234c6dce5971d75051576490
Author: Zephyr Shannon <earthlingzephyr@gmail.com>
Commit: Zephyr Shannon <earthlingzephyr@gmail.com>

    Fix cargo compilation regex starting match
    
    Previously this regex attempted to match the entire cargo output
    including the name of the thread that panicked and the entire panic
    message. In addition it was required that there be whitespace before
    the start of the word "thread" in that output. I don't know if this
    was the previous format, but in current Rust compilers "thread" comes
    at the beginning of the first line.
    
    However, there were two problems with this approach. One is that
    making that leading whitespace mandatory caused the regex to not match
    correctly. The second problem is that multiline regex matching in
    emacs is a bit iffy, and even matching the start correctly, if the
    panic message contained enough characters the full multiline regex
    could not be matched and the same problem would occur.
    
    This commit changes and vastly simplifies the regex to search for the
    guaranteed portion of the cargo output, starting with the ending
    `', `. This does come with an increased risk of accidentally matching
    input that is not actually a panic message, but I think in practice
    this will be fairly rare.
---
 rust-compile.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rust-compile.el b/rust-compile.el
index 6c73901..682fe61 100644
--- a/rust-compile.el
+++ b/rust-compile.el
@@ -37,8 +37,8 @@ See `compilation-error-regexp-alist' for help on their 
format.")
 ;; Match test run failures and panics during compilation as
 ;; compilation warnings
 (defvar cargo-compilation-regexps
-  '("^\\s-+thread '[^']+' panicked at \\('[^']+', \\([^:]+\\):\\([0-9]+\\)\\)"
-    2 3 nil nil 1)
+  '("', \\([^:]+\\):\\([0-9]+\\)"
+    1 2 nil nil 0)
   "Specifications for matching panics in cargo test invocations.
 See `compilation-error-regexp-alist' for help on their format.")
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]