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: Disallow renaming of non-local items #15232

Merged
merged 5 commits into from Sep 11, 2023
Merged

Conversation

alibektas
Copy link
Member

fixes #14850 . This makes me wonder , why stop at structs and not do the same for other ADTs? Would be happy to add them too if nothing speaks against it.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 8, 2023
@HKalbasi
Copy link
Member

HKalbasi commented Jul 8, 2023

I think it should include all items (ADTs, functions, consts, ...)

@alibektas alibektas changed the title ide : Disallow renaming of non-local structs ide : Disallow renaming of non-local items Jul 8, 2023
crates/ide-db/src/rename.rs Show resolved Hide resolved
crates/ide-db/src/rename.rs Outdated Show resolved Hide resolved
crates/ide/src/rename.rs Outdated Show resolved Hide resolved
Comment on lines 87 to 97
if mac.is_builtin_derive(sema.db) {
bail!("Cannot rename builtin macro")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also add a test for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

I can't seem to find a way that would bypass Cannot rename a non-local definition. and bail out at Cannot rename builtin derive

@lowr lowr added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 18, 2023
@bors
Copy link
Collaborator

bors commented Aug 2, 2023

☔ The latest upstream changes (presumably #15377) made this pull request unmergeable. Please resolve the merge conflicts.

@alibektas
Copy link
Member Author

@rustbot review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 24, 2023
crates/ide-db/src/rename.rs Outdated Show resolved Hide resolved
@Veykril Veykril added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 8, 2023
@Veykril
Copy link
Member

Veykril commented Sep 11, 2023

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 11, 2023

📌 Commit 0118741 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Sep 11, 2023

⌛ Testing commit 0118741 with merge 0e251ff...

@bors
Copy link
Collaborator

bors commented Sep 11, 2023

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 0e251ff to master...

@bors bors merged commit 0e251ff into rust-lang:master Sep 11, 2023
10 checks passed
@lnicola lnicola changed the title ide : Disallow renaming of non-local items fix: Disallow renaming of non-local items Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should not rename structs in standard library
6 participants