ICE when expanding repeating macro to nothing
Open
Nobody has claimed this yet.
expansion
- Dominant language
- C++
- Stars
- 2.9k
- Forks
- 231
- Avg merge
- 19h 55m
- Merged PRs (30d)
- 67
Description
// no possible bounds violation
macro_rules! try_from_unbounded {
($source:ty, $($target:ty),*) => {$()*}
}
rustc instead reports an error:
error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
--> src/lib.rs:4:40
|
4 | ($source:ty, $($target:ty),*) => {$()*}
| ^^
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_rules! reproducer from the issue and tracing gccrs's handling of the empty repetition in the macro expansion. Compare its behavior with rustc and existing macro diagnostics; done means the reproducer no longer causes an internal compiler error and receives the intended handling for an empty expansion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100