diff --git a/etc/compilation.txt b/etc/compilation.txt index 67c7000ae09..39d9c3a923c 100644 --- a/etc/compilation.txt +++ b/etc/compilation.txt @@ -487,6 +487,17 @@ symbol: php Parse error: parse error, unexpected $ in main.php on line 59 Fatal error: Call to undefined function: mysql_pconnect() in db.inc on line 66 +* Rust + +symbol: rust + +error[E0277]: `Foo` is not an iterator + --> src/main.rs:4:16 +warning: borrow of packed field is unsafe and requires unsafe function or block (error E0133) + --> lint_example.rs:11:13 +note: required by a bound in `Trait` + --> src/auxiliary/trait-debuginfo.rs:23:18 + * Ruby symbol: ruby diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 1ca58b3ac7d..8cfa793cfc6 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -565,6 +565,19 @@ during global destruction\\.$\\)" 1 2) "\\(?:Parse\\|Fatal\\) error: \\(.*\\) in \\(.*\\) on line \\([0-9]+\\)" 2 3 nil nil) + (rust + ,(rx bol (or (group-n 1 "error") (group-n 2 "warning") (group-n 3 "note")) + (? "[" (+ (in "A-Z" "0-9")) "]") ":" (* nonl) + "\n" (+ " ") "-->" + " " (group-n 4 (+ nonl)) ; file + ":" (group-n 5 (+ (in "0-9"))) ; line + ":" (group-n 6 (+ (in "0-9")))) ; column + 4 5 6 (2 . 3) + nil + (1 compilation-error-face) + (2 compilation-warning-face) + (3 compilation-info-face)) + (rxp "^\\(?:Error\\|Warnin\\(g\\)\\):.*\n.* line \\([0-9]+\\) char\ \\([0-9]+\\) of file://\\(.+\\)" diff --git a/test/lisp/progmodes/compile-tests.el b/test/lisp/progmodes/compile-tests.el index b12e5d0b2d4..38d5d2bb43b 100644 --- a/test/lisp/progmodes/compile-tests.el +++ b/test/lisp/progmodes/compile-tests.el @@ -372,6 +372,15 @@ 1 nil 59 "main.php") (php "Fatal error: Call to undefined function: mysql_pconnect() in db.inc on line 66" 1 nil 66 "db.inc") + ;; rust + (rust + "error[E0277]: `Foo` is not an iterator\n --> src/main.rs:4:16" + 1 16 4 "src/main.rs") + (rust "warning: borrow of packed field is unsafe and requires unsafe function or block (error E0133)\n --> lint_example.rs:11:13" + 1 13 11 "lint_example.rs") + (rust + "note: required by a bound in `Trait`\n --> src/auxiliary/trait-debuginfo.rs:23:18" + 1 18 23 "src/auxiliary/trait-debuginfo.rs") ;; ruby (uses gnu) (gnu "plain-exception.rb:7:in `fun': unhandled exception" 1 nil 7 "plain-exception.rb") @@ -538,9 +547,9 @@ 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 107)) - (should (eq compilation-num-warnings-found 36)) - (should (eq compilation-num-infos-found 35))))) + (should (eq compilation-num-errors-found 108)) + (should (eq compilation-num-warnings-found 37)) + (should (eq compilation-num-infos-found 36))))) (ert-deftest compile-test-grep-regexps () "Test the `grep-regexp-alist' regexps.