Rust-GCC / Rust-GCC/gccrs

ICE when expanding repeating macro to nothing

Open
#4,601 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.