Skip to content

Fix: Check more carefully for cases where a rename can't be done #8658

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 1 commit into from
Apr 25, 2021

Conversation

dzhu
Copy link

@dzhu dzhu commented Apr 25, 2021

Attempting to rename an element of a tuple field would previously replace the type with the new name, which doesn't make sense; now it fails instead.

The check is done in both prepare_rename and rename so that the case is caught before the user is prompted for a new name. Some other existing failure cases are also now additionally checked in prepare_rename.

Closes: #8592

(I threw in some doc edits for a relevant type; of course, I can remove those if the policy here is to be strict about scope of changes within a PR.)

Attempting to rename an element of a tuple field would previously
replace the type with the new name, which doesn't make sense; now it
fails instead.

The check is done in both `prepare_rename` and `rename` so that the case
is caught before the user is prompted for a new name. Some other
existing failure cases are also now additionally checked in
`prepare_rename`.
@Veykril
Copy link
Member

Veykril commented Apr 25, 2021

lgtm thanks!
bors r+

@bors
Copy link
Contributor

bors bot commented Apr 25, 2021

@bors bors bot merged commit 6175353 into rust-lang:master Apr 25, 2021
@Veykril Veykril changed the title Check more carefully for cases where a rename can't be done Fix: Check more carefully for cases where a rename can't be done Apr 25, 2021
@dzhu dzhu deleted the check-renames branch April 26, 2021 06:06
@dzhu
Copy link
Author

dzhu commented Apr 26, 2021

Thanks for the help and the quick response!

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.

Renaming a tuple struct field replaces its type with the new name
2 participants