summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErgus <spacibba@aol.com>2024-05-15 15:10:02 +0200
committerEli Zaretskii <eliz@gnu.org>2024-05-18 13:51:01 +0300
commit2e862f81a355435fb7e837ffebee2f657c26ff23 (patch)
tree553b91917094e00439f5b4937460d749132378ad
parenta019d2bd56818046854345922ad805f3212cd116 (diff)
Add support for Rust compilation messages
* etc/compilation.txt (Rust): Add Rust/cargo examples. * lisp/progmodes/compile.el (compilation-error-regexp-alist-alist): Add rust/cargo error and warning patterns. (Bug#70794)
-rw-r--r--etc/compilation.txt39
-rw-r--r--lisp/progmodes/compile.el7
2 files changed, 46 insertions, 0 deletions
diff --git a/etc/compilation.txt b/etc/compilation.txt
index 05f0829864c..44388e1f197 100644
--- a/etc/compilation.txt
+++ b/etc/compilation.txt
@@ -523,6 +523,45 @@ NoMethodError: undefined method `not_exists' for nil:NilClass
4 tests, 3 assertions, 3 failures, 1 errors
+* Rust
+
+symbol: cargo
+
+The [] part is optional, and the file names are always relative to
+project's root.
+
+error[E0425]: cannot find function `ruun` in module `broot::cli`
+ --> src/main.rs:6:23
+ |
+6 | match broot::cli::ruun() {
+ | ^^^^ help: a function with a similar name exists: `run`
+ |
+ ::: /tmp/broot/src/cli/mod.rs:49:1
+ |
+49 | pub fn run() -> Result<Option<Launchable>, ProgramError> {
+ | -------------------------------------------------------- similarly
+ named function `run` defined here
+
+error: cannot find macro `deebug` in this scope
+ --> src/main.rs:5:5
+ |
+5 | deebug!("env::args(): {:#?}", std::env::args().collect::<Vec<String>>());
+ | ^^^^^^ help: a macro with a similar name exists: `debug`
+ |
+ ::: /home/ergo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/log-0.4.21/src/macros.rs:154:1
+ |
+154 | macro_rules! debug {
+ | ------------------ similarly named macro `debug` defined here
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> src/main.rs:3:1
+ |
+3 | #[feature(proc_macro_diagnostic)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(unused_attributes)]` on by default
+
+
* RXP
symbol: rxp
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index b18eb81fee1..2e4eb11811a 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -224,6 +224,13 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
\\(?: characters? \\([0-9]+\\)-?\\([0-9]+\\)?:\\)?\\([ \n]Warning\\(?: [0-9]+\\)?:\\)?\\)"
2 (3 . 4) (5 . 6) (7))
+ (cargo
+ "\\(?:\\(?4:error\\)\\|\\(?5:warning\\)\\):[^\0]+?--> \\(?1:[^:]+\\):\\(?2:[[:digit:]]+\\):\\(?3:[[:digit:]]+\\)"
+ 1 2 3 (5)
+ nil
+ (5 compilation-warning-face)
+ (4 compilation-error-face))
+
(cmake
"^CMake \\(?:Error\\|\\(Warning\\)\\) at \\(.*\\):\\([1-9][0-9]*\\) ([^)]+):$"
2 3 nil (1))