Skip to content

Conversation

ThibsG
Copy link
Contributor

@ThibsG ThibsG commented Jan 10, 2020

This lint should trigger on other identifiers which have _ prefix (such as _e) and only if they are unused in the panic block.

Note: the is_unused function is greatly inspired from pat_is_wild function in loops lints.
I've been considering doing some refactoring, maybe in utils. Maybe this PR or a new one. What do you think ?

fixes #5024

changelog: none

@ThibsG ThibsG changed the title Match wild err arm improve5024 Match wild err arm improvements Jan 10, 2020
@flip1995 flip1995 added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 10, 2020
Copy link
Member

@flip1995 flip1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. extracting this visitor into utils would be great!

@ThibsG ThibsG force-pushed the MatchWildErrArmImprove5024 branch from cc6106e to 9a0d942 Compare January 10, 2020 16:26
@bors
Copy link
Contributor

bors commented Jan 11, 2020

☔ The latest upstream changes (presumably #5040) made this pull request unmergeable. Please resolve the merge conflicts.

@ThibsG ThibsG force-pushed the MatchWildErrArmImprove5024 branch from 9a0d942 to 44fb8b5 Compare January 13, 2020 15:53
@flip1995
Copy link
Member

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Jan 15, 2020

📌 Commit 44fb8b5 has been approved by flip1995

@bors
Copy link
Contributor

bors commented Jan 15, 2020

⌛ Testing commit 44fb8b5 with merge be09bb4...

bors added a commit that referenced this pull request Jan 15, 2020
Match wild err arm improvements

This lint should trigger on other identifiers which have `_` prefix (such as `_e`) and only if they are unused in the panic block.

_Note_: the `is_unused` function is greatly inspired from `pat_is_wild` function in [loops lints](https://github.com/rust-lang/rust-clippy/blob/43ac9416d935942d6c7d2b2e0c876c551652c4ec/clippy_lints/src/loops.rs#L1689).
I've been considering doing some refactoring, maybe in utils. Maybe this PR or a new one. What do you think ?

fixes #5024

changelog: none
@bors
Copy link
Contributor

bors commented Jan 15, 2020

☀️ Test successful - checks-travis, status-appveyor
Approved by: flip1995
Pushing be09bb4 to master...

@bors bors merged commit 44fb8b5 into rust-lang:master Jan 15, 2020
@bors bors mentioned this pull request Jan 15, 2020
@ThibsG ThibsG deleted the MatchWildErrArmImprove5024 branch February 5, 2020 12:50
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.

match_wild_err_arm triggers weirdly
3 participants