Skip to content

Commit

Permalink
Auto merge of #118958 - c410-f3r:concat-again, r=petrochenkov
Browse files Browse the repository at this point in the history
Add a new concat metavar expr

Revival of #111930

Giving it another try now that #117050 was merged.

With the new rules, meta-variable expressions must be referenced with a dollar sign (`$`) and this can cause misunderstands with `$concat`.

```rust
macro_rules! foo {
    ( $bar:ident ) => {
        const ${concat(VAR, bar)}: i32 = 1;
    };
}

// Will produce `VARbar` instead of `VAR_123`
foo!(_123);
```

In other words, forgetting the dollar symbol can produce undesired outputs.

cc #29599
cc rust-lang/rust#124225
  • Loading branch information
bors committed Jun 14, 2024
2 parents 6d4da7b + 2150a24 commit 0ce4fda
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 0ce4fda

Please sign in to comment.