Skip to content

If let else mutex - #5332

Merged
bors merged 16 commits into
rust-lang:masterfrom
DevinR528:if-let-else-mutex
Apr 20, 2020
Merged

If let else mutex#5332
bors merged 16 commits into
rust-lang:masterfrom
DevinR528:if-let-else-mutex

Conversation

@DevinR528

Copy link
Copy Markdown
Contributor

changelog: Adds lint to catch incorrect use of Mutex::lock in if let expressions with lock calls in any of the blocks.

closes: #5219

Comment thread clippy_lints/src/if_let_mutex.rs Outdated
Comment thread clippy_lints/src/if_let_mutex.rs Outdated
Comment thread clippy_lints/src/if_let_mutex.rs Outdated
Comment thread clippy_lints/src/if_let_mutex.rs Outdated
@flip1995 flip1995 added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) A-lint Area: New lints labels Mar 18, 2020
@DevinR528

Copy link
Copy Markdown
Contributor Author

I hope this works its definitely a lot cleaner, I removed if_chain, I wasn't sure how to avoid unnecessary walking and still use if_chain, but if the walking isn't that big of a deal I'll just call both of them up front and use if_chain.

@bors

bors commented Mar 23, 2020

Copy link
Copy Markdown
Contributor

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

@bors

bors commented Mar 30, 2020

Copy link
Copy Markdown
Contributor

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

@flip1995
flip1995 self-requested a review March 30, 2020 17:49
@bors

bors commented Mar 30, 2020

Copy link
Copy Markdown
Contributor

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

@DevinR528
DevinR528 force-pushed the if-let-else-mutex branch from 53f70e4 to e3895f8 Compare April 3, 2020 20:45
@bors

bors commented Apr 8, 2020

Copy link
Copy Markdown
Contributor

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

@flip1995 flip1995 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties and removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Apr 8, 2020

@flip1995 flip1995 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

9cdc7d5 added 2 binary files. Please remove them, preferably with a force push.

Sorry for taking so long for the review. I don't have an excuse, just wasn't really motivated to review PRs recently.

Comment thread clippy_lints/src/if_let_mutex.rs Outdated
Comment thread doc/adding_lints.md Outdated
Comment thread clippy_lints/src/if_let_mutex.rs Outdated
Comment thread clippy_lints/src/if_let_mutex.rs Outdated
Comment thread tests/ui/if_let_mutex.rs Outdated
@flip1995 flip1995 added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Apr 15, 2020
@bors

bors commented Apr 15, 2020

Copy link
Copy Markdown
Contributor

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

@DevinR528

Copy link
Copy Markdown
Contributor Author

No worries I've seen you've been pretty busy getting the new release stuff and everything. Sorry I keep adding the binary files I wonder if there is a way to tell vscode when you open a non existent dir to just fail instead of creating a file.

@bors

bors commented Apr 17, 2020

Copy link
Copy Markdown
Contributor

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

@bors

bors commented Apr 19, 2020

Copy link
Copy Markdown
Contributor

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

@phansch phansch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Implementation wise this looks good to me. Just some minor things =)

Comment thread README.md
Comment thread clippy_lints/src/if_let_mutex.rs Outdated

@flip1995 flip1995 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

r=me after addressing @phansch comments and the test added

Comment thread doc/adding_lints.md Outdated
Comment thread tests/ui/if_let_mutex.rs
@phansch

phansch commented Apr 20, 2020

Copy link
Copy Markdown
Contributor

@bors r=flip1995

@bors

bors commented Apr 20, 2020

Copy link
Copy Markdown
Contributor

📌 Commit 489dd2e has been approved by flip1995

bors added a commit that referenced this pull request Apr 20, 2020
If let else mutex

changelog: Adds lint to catch incorrect use of `Mutex::lock` in `if let` expressions with lock calls in any of the blocks.

closes: #5219
@bors

bors commented Apr 20, 2020

Copy link
Copy Markdown
Contributor

⌛ Testing commit 489dd2e with merge 023f3d1...

@DevinR528

Copy link
Copy Markdown
Contributor Author

How come the tests run sooo much faster? It's sweet.

@bors

bors commented Apr 20, 2020

Copy link
Copy Markdown
Contributor

💔 Test failed - checks-action_test

@phansch

phansch commented Apr 20, 2020

Copy link
Copy Markdown
Contributor

Ah, you'll have to update the UI tests one more time because the line numbers changed.

How come the tests run sooo much faster? It's sweet.

I think that might be because of caching 🏃

@phansch

phansch commented Apr 20, 2020

Copy link
Copy Markdown
Contributor

@bors r=flip1995 thanks!

@bors

bors commented Apr 20, 2020

Copy link
Copy Markdown
Contributor

📌 Commit 3fbe321 has been approved by flip1995

@bors

bors commented Apr 20, 2020

Copy link
Copy Markdown
Contributor

⌛ Testing commit 3fbe321 with merge 6ce05bf...

@bors

bors commented Apr 20, 2020

Copy link
Copy Markdown
Contributor

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing 6ce05bf to master...

@bors
bors merged commit 6ce05bf into rust-lang:master Apr 20, 2020
@bors bors mentioned this pull request Apr 20, 2020
@DevinR528

Copy link
Copy Markdown
Contributor Author

Thanks for the help and input as usual @flip1995 and @phansch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lint Area: New lints S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[new-lint] if let Some... else with locked mutex

4 participants