Skip to content

fix: Do not remove the original token when descending into derives #20387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 6, 2025

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