Macro Expansion Hangs/OOMs
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
macro_rules! m {
[ $( $( ),+ )* ] => {}
}
m! {}
The above code hangs and quickly exhausts memory. This happens on nightly and dates back all the way back to version 1.0.0.
You can safely run the code on the playground here.
This bug was found using fuzzing.
@rustbot label +C-bug +A-macros +I-hang +S-has-mcve
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
Start by running the minimal macro example from the issue, including the linked Rust Playground reproduction, and confirm the hang and memory exhaustion. Trace macro expansion for this input and add a regression test demonstrating that it terminates without exhausting memory; done means the reproducer completes normally while preserving valid macro behavior.
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
- Clearly specified
- Newbie friendliness
- 45/100