| Age | Commit message (Collapse) | Author |
|
|
|
While debugging tests it’s annoying when ‘compilation-mode’ matches
‘dbg!’ output incorrectly. Currently, rust-mode’s regexps assign it as
an error and incorrectly include ‘[’. The proposed change adds a
regexp to match such things and assign them info level.
|
|
If we encounter a panic when executing Rust code in
`compilation-mode`, we now correctly highlight the location where the
panic occurred.
For example:
```
thread 'main' panicked at src/main.rs:2:5:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
Here, `src/main.rs:2:5` is highlighted. The developer is then able to
execute `compile-goto-error` to jump to the correct spot in the code.
Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
Co-authored-by: zlef <zachlefevre@gmail.com>
|
|
|
|
It's more distracting than helpful.
|
|
Previously this regex attempted to match the entire cargo output
including the name of the thread that panicked and the entire panic
message. In addition it was required that there be whitespace before
the start of the word "thread" in that output. I don't know if this
was the previous format, but in current Rust compilers "thread" comes
at the beginning of the first line.
However, there were two problems with this approach. One is that
making that leading whitespace mandatory caused the regex to not match
correctly. The second problem is that multiline regex matching in
emacs is a bit iffy, and even matching the start correctly, if the
panic message contained enough characters the full multiline regex
could not be matched and the same problem would occur.
This commit changes and vastly simplifies the regex to search for the
guaranteed portion of the cargo output, starting with the ending
`', `. This does come with an increased risk of accidentally matching
input that is not actually a panic message, but I think in practice
this will be fairly rare.
|
|
For the time being `require' the new library from "rust-mode.el".
In the mid-term we should stop doing that, so that users can load
it if and only if they want to do so.
|