Skip to content

Conversation

@Delta17920
Copy link
Contributor

@Delta17920 Delta17920 commented Dec 15, 2025

The Bug: The ${concat(...)} expression was using the wrong loop index when inside nested repetitions (like optional groups), causing it to get "stuck" on the first element and generate duplicate code.

The Fix: Updated metavar_expr_concat in transcribe.rs to correctly search the repetition stack (tscx.repeats) for the target variable instead of blindly using the last index.

Tests:
Added tests/ui/macros/concat-nested-repetition.rs.

Fixes #150002

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 15, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 15, 2025

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rust-log-analyzer

This comment has been minimized.

@Delta17920 Delta17920 force-pushed the fix/150002-macro-concat-bug branch from d913071 to 0f793cc Compare December 15, 2025 17:02
@jieyouxu
Copy link
Member

@rustbot reroll

@rustbot rustbot assigned davidtwco and unassigned jieyouxu Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macro_metavar_expr_concat broken when combining repeats and optionals

5 participants