KEMBAR78
fix: Do not remove the original token when descending into derives by ChayimFriedman2 · Pull Request #20387 · rust-lang/rust-analyzer · GitHub
Skip to content

Conversation

@ChayimFriedman2
Copy link
Contributor

@ChayimFriedman2 ChayimFriedman2 commented Aug 4, 2025

This caused rename to remove both, because it couldn't rename the derive-expanded one.

I spent some time trying to create a test for this, before giving up. But I checked manually that this works.

Fixes #20386.

Also, allow renaming only some of the definitions (the first commit).

This caused rename to remove both, because it couldn't rename the derive-expanded one.

I spent some time trying to create a test for this, before giving up. But I checked manually that this works.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 4, 2025
Copy link
Member

@ShoyuVanilla ShoyuVanilla left a comment

Choose a reason for hiding this comment

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

While I'm not an expert in macro handling, I believe that this is done correctly👍

@ShoyuVanilla ShoyuVanilla added this pull request to the merge queue Aug 6, 2025
Merged via the queue into rust-lang:master with commit 8241ec6 Aug 6, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 6, 2025
@ChayimFriedman2 ChayimFriedman2 deleted the rename-macro branch August 6, 2025 10:37
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.

Can't rename local that is defined in a macro declaration

3 participants