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

Cover Result for question_mark #7840

Merged
merged 3 commits into from
Oct 20, 2021
Merged

Conversation

dswij
Copy link
Member

@dswij dswij commented Oct 19, 2021

closes #7135

changelog: [question_mark] now covers Result

@rust-highfive
Copy link

r? @llogiq

(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 Oct 19, 2021
@llogiq
Copy link
Contributor

llogiq commented Oct 19, 2021

Looking good so far, just a small nit.

@llogiq
Copy link
Contributor

llogiq commented Oct 20, 2021

Thank you! @bors r+

@bors
Copy link
Collaborator

bors commented Oct 20, 2021

📌 Commit 083a454 has been approved by llogiq

@bors
Copy link
Collaborator

bors commented Oct 20, 2021

⌛ Testing commit 083a454 with merge ee8c155...

@bors
Copy link
Collaborator

bors commented Oct 20, 2021

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: llogiq
Pushing ee8c155 to master...

@bors bors merged commit ee8c155 into rust-lang:master Oct 20, 2021
@dswij dswij deleted the question-mark-result branch October 21, 2021 04:21
@matthiaskrgr
Copy link
Member

Hi I think this cause a few false positives in one of my projects (https://github.com/matthiaskrgr/cargo-cache)
#7859
Could you please have a look? Thanks 😄

@dswij
Copy link
Member Author

dswij commented Oct 22, 2021

Whoops! 😓

#7859 should have been covered by

// No warning
let y = if let Ok(x) = x {
x
} else {
return Err("some error");
};

I'll be taking a look asap

bors added a commit that referenced this pull request Oct 26, 2021
Fix `question_mark` FP on custom error type

Closes #7859

#7840 aims to ignore `question_mark` when the return type is custom, which is [covered here](https://github.com/rust-lang/rust-clippy/blob/df65291edd6b89a241fed483ab165c32df468746/tests/ui/question_mark.rs#L144-L149). But this fails when there is a call in conditional predicate

changelog: [`question_mark`] Fix false positive when there is call in conditional predicate
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.

add Result to question_mark
5 participants