Add Rust panic message pattern (bug#80403)

* etc/compilation.txt: Add example.
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
New rule.
* test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data)
(compile-test-error-regexps): Add test case.

Copyright-paperwork-exempt: yes
This commit is contained in:
Jacek Świerk
2026-03-01 14:42:43 +01:00
committed by Mattias Engdegård
parent 331e2e3787
commit 60bbe8786a
3 changed files with 21 additions and 2 deletions

View File

@@ -489,7 +489,7 @@ Fatal error: Call to undefined function: mysql_pconnect() in db.inc on line 66
* Rust
symbol: rust
symbol: rust rust-panic
error[E0277]: `Foo` is not an iterator
--> src/main.rs:4:16
@@ -498,6 +498,9 @@ warning: borrow of packed field is unsafe and requires unsafe function or block
note: required by a bound in `Trait`
--> src/auxiliary/trait-debuginfo.rs:23:18
thread 'main' (1234) panicked at library/std/src/io/stdio.rs:30:40:
thread 'main' (1234) panicked at library/std/src/io/stdio.rs:50:60:
* Ruby
symbol: ruby

View File

@@ -405,6 +405,18 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
(ruby-Test::Unit
"^ [[ ]?\\([^ (].*\\):\\([1-9][0-9]*\\)\\(\\]\\)?:in " 1 2)
(rust-panic
,(rx bol (opt " ")
"thread '" (+ nonl) "' " (? "(" (+ digit) ") ")
(group-n 1 "panicked" ) " at"
" " (group-n 2 (+ nonl)) ; file
":" (group-n 3 (+ digit)) ; line
":" (group-n 4 (+ digit)) ; column
":" eol)
2 3 4 nil
nil
(1 compilation-error-face))
;; Tested with Lua 5.1, 5.2, 5.3, 5.4, and LuaJIT 2.1.
(lua
,(rx bol

View File

@@ -384,6 +384,10 @@
(rust
"note: required by a bound in `Trait`\n --> src/auxiliary/trait-debuginfo.rs:23:18"
1 18 23 "src/auxiliary/trait-debuginfo.rs" info)
(rust-panic "thread 'main' (1234) panicked at library/std/src/io/stdio.rs:30:40:"
1 40 30 "library/std/src/io/stdio.rs" error)
(rust-panic " thread 'main' (1234) panicked at library/std/src/io/stdio.rs:50:60:"
1 60 50 "library/std/src/io/stdio.rs" error)
;; ruby (uses gnu)
(gnu "plain-exception.rb:7:in `fun': unhandled exception"
1 nil 7 "plain-exception.rb" error)
@@ -552,7 +556,7 @@ The test data is in `compile-tests--test-regexps-data'."
1 15 5 "alpha.c")))
(compile--test-error-line test))
(should (eq compilation-num-errors-found 108))
(should (eq compilation-num-errors-found 110))
(should (eq compilation-num-warnings-found 37))
(should (eq compilation-num-infos-found 36)))))