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

try_err: Consider Try impl for Poll when generating suggestions #5857

Merged
merged 1 commit into from
Aug 5, 2020
Merged

try_err: Consider Try impl for Poll when generating suggestions #5857

merged 1 commit into from
Aug 5, 2020

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Aug 2, 2020

There are two different implementation of Try trait for Poll type:
Poll<Result<T, E>> and Poll<Option<Result<T, E>>>. Take them into
account when generating suggestions.

For example, for Err(e)? suggest either return Poll::Ready(Err(e)) or
return Poll::Ready(Some(Err(e))) as appropriate.

Fixes #5855

changelog: try_err: Consider Try impl for Poll when generating suggestions

@rust-highfive
Copy link

r? @matthiaskrgr

(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 2, 2020
There are two different implementation of Try trait for Poll type;
Poll<Result<T, E>> and Poll<Option<Result<T, E>>>. Take them into
account when generating suggestions.

For example, for Err(e)? suggest either return Poll::Ready(Err(e)) or
return Poll::Ready(Some(Err(e))) as appropriate.
@matthiaskrgr
Copy link
Member

Thanks!

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 5, 2020

📌 Commit e967710 has been approved by matthiaskrgr

@bors
Copy link
Collaborator

bors commented Aug 5, 2020

⌛ Testing commit e967710 with merge 3d7e3fd...

@bors
Copy link
Collaborator

bors commented Aug 5, 2020

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: matthiaskrgr
Pushing 3d7e3fd to master...

@bors bors merged commit 3d7e3fd into rust-lang:master Aug 5, 2020
@tmiasko tmiasko deleted the try-err-poll branch August 5, 2020 10:51
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.

try_err false positive / incorrect suggestion with Poll return type
4 participants