emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#70794: closed (30.0.50; Add Rust compilation regex)


From: GNU bug Tracking System
Subject: bug#70794: closed (30.0.50; Add Rust compilation regex)
Date: Sat, 18 May 2024 10:53:01 +0000

Your message dated Sat, 18 May 2024 13:52:29 +0300
with message-id <868r07e6j6.fsf@gnu.org>
and subject line Re: bug#70794: 30.0.50; Add Rust compilation regex
has caused the debbugs.gnu.org bug report #70794,
regarding 30.0.50; Add Rust compilation regex
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
70794: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70794
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 30.0.50; Add Rust compilation regex Date: Mon, 06 May 2024 03:28:43 +0200

Hi:

Recently working with rust I have noticed that emacs does not recognizes
the rust/cargo error patterns.

Considering that emacs has now the rust-ts-mode, it may worth adding
the rust/cargo error patterns to compile when using that mode

In my system so far I have this:

```
(with-eval-after-load 'rust-ts-mode
  (with-eval-after-load 'compile
    (add-to-list
     'compilation-error-regexp-alist-alist
     `(cargo
       "\\(?:\\(?4:error\\)\\|\\(?5:warning\\)\\):[^\0]+?--> 
\\(?1:[^:]+\\):\\(?2:[[:digit:]]+\\):\\(?3:[[:digit:]]+\\)"
       1 2 3 (5)
       nil
       (5 compilation-warning-face)
       (4 compilation-error-face)))

    (add-to-list 'compilation-error-regexp-alist 'cargo)))

```

Maybe a more frequent rust user has a more general regex to
recommend. But this one works for me.

WDYT?




--- End Message ---
--- Begin Message --- Subject: Re: bug#70794: 30.0.50; Add Rust compilation regex Date: Sat, 18 May 2024 13:52:29 +0300
> Date: Wed, 15 May 2024 15:10:02 +0200
> From: Ergus <spacibba@aol.com>
> Cc: 70794@debbugs.gnu.org
> 
> On Sat, May 11, 2024 at 11:51:04AM GMT, Eli Zaretskii wrote:
> >
> >Thanks, but could you please also send the examples of Rust messages,
> >because we need to add them to etc/compilation.txt?
> 
> Hi Eli:
> 
> Typically they look like this:
> 
> ```
> 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
> ```
> 
> or
> 
> ```
> 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
> ```
> 
> Two details:
> 
> 1. As you can see the [] is optional
> 2. The path is always relative to project's root

Thanks, installed on master, and closing the bug.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]