rust-lang / rust-lang/rust-analyzer
Empty macro that recurses twice per invocation causes r-a to hang up
Open
Nobody has claimed this yet.
A-macro
A-nameres
C-bug
I-hang
S-actionable
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
The following macro causes r-a to hang, trying to expand the macro for a very long time(it will never finish) as this visits every branch of the expansion tree up to depth 128(our current limit).
macro_rules! error {
() => {
error! {}
error! {}
}
}
error! {}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue gives only a Rust macro reproducer, not a file or test path. Start by reproducing it in rust-analyzer's macro-expansion handling; done means this recursive empty macro no longer hangs and the behavior is covered by an appropriate regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100