* etc/compilation.txt: Add examples of Rust compiler error, warning and
note messages.
* lisp/progmodes/compile.el
(compilation-error-regexp-alist-alist): Add Rust regexps for error,
warning and note messages.
* test/lisp/progmodes/compile-tests.el
(compile-tests--test-regexps-data): Add new test cases.
(compile-test-error-regexps): Increase expected errors.
(cherry picked from commit
676f12c65f751f14093c446a7b637a365de253a5)
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
"\\(?: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://\\(.+\\)"
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")
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.