Skip to content
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

fix: Renaming both struct and function with the same name #19306

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

asuto15
Copy link
Contributor

@asuto15 asuto15 commented Mar 6, 2025

fixes #18892.

Note

Although the original issue did not specify whether to rename both definitions or only one, since the original code exports both under the same name, it is preferable for rust-analyzer’s behavior to rename both.
This implementation therefore renames both the struct and the function, ensuring consistency.

Important

This implementation is limited to handling struct/function pairs. It does not cover other combinations (e.g. enum variants with associated functions, constants paired with functions, or trait methods).
If needed, separate issues should be created to address those other cases individually.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 6, 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Renaming a struct that has a function with the same name will break code:
2 participants