Skip to content

Conversation

@kraktus
Copy link
Contributor

@kraktus kraktus commented Sep 17, 2022

close #9482

changelog: [drop_copy]: Do not lint idiomatic in match arm

@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 Sep 17, 2022
@Jarcho
Copy link
Contributor

Jarcho commented Sep 27, 2022

Thank you. @bors r+

@bors
Copy link
Contributor

bors commented Sep 27, 2022

📌 Commit 187c27e has been approved by Jarcho

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Sep 27, 2022

⌛ Testing commit 187c27e with merge 672fb8e...

@bors
Copy link
Contributor

bors commented Sep 27, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Jarcho
Pushing 672fb8e to master...

@bors bors merged commit 672fb8e into rust-lang:master Sep 27, 2022
bors added a commit that referenced this pull request Jan 5, 2023
[`drop_ref`]: don't lint idiomatic in match arm

fixes #10122

As established in issue #9482, it is idiomatic to use a single `drop()` expression in a match arm to achieve a side-effect of a function while discarding its output. This should also apply to cases where the function returns a reference.

The change to the lint's code was less than 1 line, because all the heavy lifting was done in PR #9491.

---

changelog: FP: [`drop_ref`]: No longer lints idiomatic expression in `match` arms
[#10142](#10142)
<!-- changelog_checked -->
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.

drop_copy should not trigger when drop is used in a match branch

5 participants