Skip to content

fix: complete ref_match in macro#22399

Merged
ChayimFriedman2 merged 1 commit into
rust-lang:masterfrom
A4-Tacks:ref-match-in-macro-call
May 18, 2026
Merged

fix: complete ref_match in macro#22399
ChayimFriedman2 merged 1 commit into
rust-lang:masterfrom
A4-Tacks:ref-match-in-macro-call

Conversation

@A4-Tacks
Copy link
Copy Markdown
Member

@A4-Tacks A4-Tacks commented May 18, 2026

Why isn't original_range_opt() used in #12800 #12830 #13092?

Example

macro_rules! id { ($($t:tt)*) => ($($t)*); }
fn foo(data: &i32) {}
fn main() {
    let indent = 2i32;
    id!(foo(i$0))
}

Before this PR

indent

After this PR

&indent
indent

Example
---
```rust
macro_rules! id { ($($t:tt)*) => ($($t)*); }
fn foo(data: &i32) {}
fn main() {
    let indent = 2i32;
    id!(foo(i$0))
}
```

**Before this PR**

```
indent
```

**After this PR**

```
&indent
indent
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 18, 2026
Copy link
Copy Markdown
Contributor

@ChayimFriedman2 ChayimFriedman2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we had original_range_opt() back then.

View changes since this review

@ChayimFriedman2 ChayimFriedman2 enabled auto-merge May 18, 2026 03:23
@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue May 18, 2026
Merged via the queue into rust-lang:master with commit cdfe408 May 18, 2026
18 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants