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 let_and_return bad suggestion #5946

Merged
merged 1 commit into from Aug 26, 2020
Merged

Fix let_and_return bad suggestion #5946

merged 1 commit into from Aug 26, 2020

Conversation

ghost
Copy link

@ghost ghost commented Aug 23, 2020

Add a cast to the suggestion when the return expression has adjustments.
These adjustments are lost when the suggestion is applied.

This is similar to the problem in issue #4437.

Closes #5729

changelog: Fix let_and_return bad suggestion

Add a cast to the suggestion when the return expression has adjustments.
These adjustments are lost when the suggestion is applied.

This is similar to the problem in issue #4437.

Closes #5729
@rust-highfive
Copy link

r? @flip1995

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Aug 23, 2020
@flip1995
Copy link
Member

This lint is marked as Applicability::MachineApplicable

Can you please test what happens, if you add // run-rustfix to the top of the test file? Are there any problems with the .fixed file?

@flip1995 flip1995 added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Aug 25, 2020
@ghost
Copy link
Author

ghost commented Aug 26, 2020

I tried enabling the rustfix but none of the suggestions were applied. Does rustfix work with multi-part suggestions?

@flip1995
Copy link
Member

Oh it's a multi-part suggestion. No it doesn't work with them. Thanks for looking into it!

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 26, 2020

📌 Commit e8d33d7 has been approved by flip1995

@bors
Copy link
Collaborator

bors commented Aug 26, 2020

⌛ Testing commit e8d33d7 with merge 894581b...

@bors
Copy link
Collaborator

bors commented Aug 26, 2020

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing 894581b to master...

@bors bors merged commit 894581b into rust-lang:master Aug 26, 2020
@ghost ghost deleted the fix-5729 branch October 29, 2020 05:18
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 from the author. (Use `@rustbot ready` to update this status)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

let_and_return lint false positive
3 participants