Skip to content

Update rustic-compilation-panic regex#126

Merged
CeleritasCelery merged 1 commit intoemacs-rustic:mainfrom
mplanchard:2026-03-31/fix-compilation-panic-re
Apr 2, 2026
Merged

Update rustic-compilation-panic regex#126
CeleritasCelery merged 1 commit intoemacs-rustic:mainfrom
mplanchard:2026-03-31/fix-compilation-panic-re

Conversation

@mplanchard
Copy link
Copy Markdown
Contributor

In a recent Rust upgrade, my panic messages in tests now have an additional thread ID component after the initial thread 'whatever' portion of the message, like in:

thread 'crate::module::submodule::tests::test' (294268) panicked at lib/rs/mylib/src/module.rs:1282:76:

This feature was added to rustc here: rust-lang/rust#115746

This no longer matches the current regex for rustic-compilation-panic, which expects nothing but a space between the module and the "panicked". That then breaks the "jump to failing test" functionality in test compilation buffers.

To fix, I added a component to the regex that allows that value to be optionally present. I also couldn't find any existing tests for the regex, so I added a simple one. Not sure if it's in the right location, or if it should be somewhere else. The test could be more sophisticated: it doesn't validate that the appropriate groups are present, just that the regex matches.

In a recent Rust upgrade, my panic messages in tests now have an
additional thread ID component after the initial `thread 'whatever'`
portion of the message, like in:

```
thread 'crate::module::submodule::tests::test' (294268) panicked at lib/rs/mylib/src/module.rs:1282:76:
```

This feature was added to rustc here: rust-lang/rust#115746

This no longer matches the current regex for `rustic-compilation-panic`,
which expects nothing but a space between the module and the `"panicked"`.
That then breaks the "jump to failing test" functionality in test
compilation buffers.

To fix, I added a component to the regex that allows that value to be
optionally present. I also couldn't find any existing tests for the
regex, so I added a simple one. Not sure if it's in the right
location, or if it should be somewhere else. The test could be more
sophisticated: it doesn't validate that the appropriate groups are
present, just that the regex matches.
@mplanchard
Copy link
Copy Markdown
Contributor Author

mplanchard commented Mar 31, 2026

For a workaround in the meantime, it seems to work well enough to just set in the :config section of my use-package declaration for rustic

(setq rustic-compilation-panic
      '("thread '[^']+'\\(?: ([0-9]+)\\)? panicked at \\([^\n]+\\):\\([0-9]+\\):\\([0-9]+\\):"
        1 2 3))

@CeleritasCelery CeleritasCelery merged commit c5e83bc into emacs-rustic:main Apr 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants