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

REF: fix extract variable on RsExprStmt and last expr in block #8100

Merged
merged 1 commit into from Nov 16, 2021
Merged

REF: fix extract variable on RsExprStmt and last expr in block #8100

merged 1 commit into from Nov 16, 2021

Conversation

afetisov
Copy link
Contributor

@afetisov afetisov commented Nov 12, 2021

This involves a change to the tests. The old behaviour was breaking code since it changed the returned value of the block from T to (), and breaking code is bad. It's also trivially easy to change the returned value after refactoring to a more complex expression, since only a single identifier should be returned.

This commit also includes a fix for extracting several occurrences of an expression. Previously if we extracted an RsExprStmt, then the logic would short-circuit and extract only it, ignoring the possibility of other occurrences.

Fixes #8099
Fixes #8095
Fixes #8082
Fixes #8091

changelog: fix "Extract variable" refactoring on expression statements and return values

@dima74 dima74 self-assigned this Nov 12, 2021
@dima74 dima74 added the fix Pull requests that fix some bug(s) label Nov 12, 2021
@dima74 dima74 added this to In Progress in To test via automation Nov 12, 2021
This involves a change to the tests. The old behaviour was breaking code since it changed the returned value of the block from T to (), and breaking code is bad. It's also trivially easy to change the returned value after refactoring to a more complex expression, since only a single identifier should be returned.

This commit also includes a fix for extracting several occurrences of an expression. Previously if we extracted an RsExprStmt, then the logic would short-circuit and extract only it, ignoring the possibility of other occurrences.
@dima74
Copy link
Member

dima74 commented Nov 16, 2021

👍
bors r+

@bors
Copy link
Contributor

bors bot commented Nov 16, 2021

Build succeeded:

@bors bors bot merged commit 7a8715c into intellij-rust:master Nov 16, 2021
To test automation moved this from In Progress to Test Nov 16, 2021
@github-actions github-actions bot added this to the v161 milestone Nov 16, 2021
@neonaot neonaot self-assigned this Nov 17, 2021
@neonaot neonaot moved this from Test to Done in To test Nov 17, 2021
@afetisov afetisov deleted the extract-last-variable branch February 3, 2022 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Pull requests that fix some bug(s)
Projects
To test
  
Done
3 participants