diff options
| author | Ergus | 2024-05-15 15:10:02 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2024-05-18 13:51:01 +0300 |
| commit | 2e862f81a355435fb7e837ffebee2f657c26ff23 (patch) | |
| tree | 553b91917094e00439f5b4937460d749132378ad | |
| parent | a019d2bd56818046854345922ad805f3212cd116 (diff) | |
| download | emacs-2e862f81a355435fb7e837ffebee2f657c26ff23.tar.gz emacs-2e862f81a355435fb7e837ffebee2f657c26ff23.zip | |
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.txt | 39 | ||||
| -rw-r--r-- | lisp/progmodes/compile.el | 7 |
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 | |||
| 523 | 523 | ||
| 524 | 4 tests, 3 assertions, 3 failures, 1 errors | 524 | 4 tests, 3 assertions, 3 failures, 1 errors |
| 525 | 525 | ||
| 526 | * Rust | ||
| 527 | |||
| 528 | symbol: cargo | ||
| 529 | |||
| 530 | The [] part is optional, and the file names are always relative to | ||
| 531 | project's root. | ||
| 532 | |||
| 533 | error[E0425]: cannot find function `ruun` in module `broot::cli` | ||
| 534 | --> src/main.rs:6:23 | ||
| 535 | | | ||
| 536 | 6 | match broot::cli::ruun() { | ||
| 537 | | ^^^^ help: a function with a similar name exists: `run` | ||
| 538 | | | ||
| 539 | ::: /tmp/broot/src/cli/mod.rs:49:1 | ||
| 540 | | | ||
| 541 | 49 | pub fn run() -> Result<Option<Launchable>, ProgramError> { | ||
| 542 | | -------------------------------------------------------- similarly | ||
| 543 | named function `run` defined here | ||
| 544 | |||
| 545 | error: cannot find macro `deebug` in this scope | ||
| 546 | --> src/main.rs:5:5 | ||
| 547 | | | ||
| 548 | 5 | deebug!("env::args(): {:#?}", std::env::args().collect::<Vec<String>>()); | ||
| 549 | | ^^^^^^ help: a macro with a similar name exists: `debug` | ||
| 550 | | | ||
| 551 | ::: /home/ergo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/log-0.4.21/src/macros.rs:154:1 | ||
| 552 | | | ||
| 553 | 154 | macro_rules! debug { | ||
| 554 | | ------------------ similarly named macro `debug` defined here | ||
| 555 | |||
| 556 | warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` | ||
| 557 | --> src/main.rs:3:1 | ||
| 558 | | | ||
| 559 | 3 | #[feature(proc_macro_diagnostic)] | ||
| 560 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| 561 | | | ||
| 562 | = note: `#[warn(unused_attributes)]` on by default | ||
| 563 | |||
| 564 | |||
| 526 | * RXP | 565 | * RXP |
| 527 | 566 | ||
| 528 | symbol: rxp | 567 | 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)) | |||
| 224 | \\(?: characters? \\([0-9]+\\)-?\\([0-9]+\\)?:\\)?\\([ \n]Warning\\(?: [0-9]+\\)?:\\)?\\)" | 224 | \\(?: characters? \\([0-9]+\\)-?\\([0-9]+\\)?:\\)?\\([ \n]Warning\\(?: [0-9]+\\)?:\\)?\\)" |
| 225 | 2 (3 . 4) (5 . 6) (7)) | 225 | 2 (3 . 4) (5 . 6) (7)) |
| 226 | 226 | ||
| 227 | (cargo | ||
| 228 | "\\(?:\\(?4:error\\)\\|\\(?5:warning\\)\\):[^\0]+?--> \\(?1:[^:]+\\):\\(?2:[[:digit:]]+\\):\\(?3:[[:digit:]]+\\)" | ||
| 229 | 1 2 3 (5) | ||
| 230 | nil | ||
| 231 | (5 compilation-warning-face) | ||
| 232 | (4 compilation-error-face)) | ||
| 233 | |||
| 227 | (cmake | 234 | (cmake |
| 228 | "^CMake \\(?:Error\\|\\(Warning\\)\\) at \\(.*\\):\\([1-9][0-9]*\\) ([^)]+):$" | 235 | "^CMake \\(?:Error\\|\\(Warning\\)\\) at \\(.*\\):\\([1-9][0-9]*\\) ([^)]+):$" |
| 229 | 2 3 nil (1)) | 236 | 2 3 nil (1)) |