Skip to content

[drop_copy]: Do not lint idiomatic in match arm - #9491

Merged
bors merged 2 commits into
rust-lang:masterfrom
kraktus:drop_copy
Sep 27, 2022
Merged

[drop_copy]: Do not lint idiomatic in match arm#9491
bors merged 2 commits into
rust-lang:masterfrom
kraktus:drop_copy

Conversation

@kraktus

@kraktus kraktus commented Sep 17, 2022

Copy link
Copy Markdown
Contributor

close #9482

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

@rust-highfive

Copy link
Copy Markdown

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
Comment thread clippy_lints/src/drop_forget_ref.rs Outdated
@Jarcho

Jarcho commented Sep 27, 2022

Copy link
Copy Markdown
Contributor

Thank you. @bors r+

@bors

bors commented Sep 27, 2022

Copy link
Copy Markdown
Contributor

📌 Commit 187c27e has been approved by Jarcho

It is now in the queue for this repository.

@bors

bors commented Sep 27, 2022

Copy link
Copy Markdown
Contributor

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

@bors

bors commented Sep 27, 2022

Copy link
Copy Markdown
Contributor

☀️ 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