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

Add lint for &mut Mutex::lock #6103

Merged
merged 6 commits into from
Oct 25, 2020
Merged

Conversation

FrancisMurillo
Copy link
Contributor

@FrancisMurillo FrancisMurillo commented Oct 2, 2020

Fixes #1765

changelog: Add lint [mut_mutex_lock] for &mut Mutex::lock and suggests using &mut Mutex::get_mut instead.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @flip1995 (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 2, 2020
@bors
Copy link
Contributor

bors commented Oct 2, 2020

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

Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@FrancisMurillo
Copy link
Contributor Author

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

clippy_lints/src/mut_mutex_lock.rs Outdated Show resolved Hide resolved
tests/ui/mut_mutex_lock.rs Show resolved Hide resolved
clippy_lints/src/mut_mutex_lock.rs Outdated Show resolved Hide resolved
@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 Oct 10, 2020
clippy_lints/src/mut_mutex_lock.rs Outdated Show resolved Hide resolved
clippy_lints/src/mut_mutex_lock.rs Outdated Show resolved Hide resolved
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.

Thanks! There's an unrelated change left. After that is fixed, ping me and I'll r+ this PR.

tests/ui/or_fun_call.fixed Outdated Show resolved Hide resolved
@flip1995
Copy link
Member

@bors r+

Thanks!

@bors
Copy link
Contributor

bors commented Oct 25, 2020

📌 Commit 6a010ab has been approved by flip1995

@flip1995
Copy link
Member

@bors r-

There's an empty commit: 4d50d85

@FrancisMurillo
Copy link
Contributor Author

Dropped the empty commit

@flip1995
Copy link
Member

@bors r+

Thanks for addressing everything so quickly even though I'm so slow with my reviews...

@bors
Copy link
Contributor

bors commented Oct 25, 2020

📌 Commit e7e03b7 has been approved by flip1995

@FrancisMurillo
Copy link
Contributor Author

No worries. Nonetheless, thanks for reviewing my PR. 👍

@bors
Copy link
Contributor

bors commented Oct 25, 2020

⌛ Testing commit e7e03b7 with merge 399732b...

@bors
Copy link
Contributor

bors commented Oct 25, 2020

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

@bors bors merged commit 399732b into rust-lang:master Oct 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

Suggest get_mut() instead of lock() method on Mutex
5 participants