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: bug in extract_function.rs #16009

Merged
merged 1 commit into from Dec 7, 2023
Merged

Conversation

werifu
Copy link
Contributor

@werifu werifu commented Dec 4, 2023

There is a little bug in extract_function: It appends use path::to::ControlFlow; if the function created contains string "ControlFlow".

A case below (also in the test named does_not_import_control_flow which will fail in the original code)

image image

Now I have changed the condition determining whether adding import statement. Only when the new function body contains ControlFlow::Break or ControlFlow::Continue can the import statement be added.

Last related PR: #10309

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

Veykril commented Dec 7, 2023

Thanks!
@bors r+

@bors
Copy link
Collaborator

bors commented Dec 7, 2023

📌 Commit 05e8b92 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Dec 7, 2023

⌛ Testing commit 05e8b92 with merge 49dd380...

@bors
Copy link
Collaborator

bors commented Dec 7, 2023

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 49dd380 to master...

@bors bors merged commit 49dd380 into rust-lang:master Dec 7, 2023
10 checks passed
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.

None yet

4 participants