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

Extend invalid_atomic_ordering for compare_exchange{,_weak} and fetch_update #6025

Merged
merged 7 commits into from
Sep 16, 2020

Conversation

thomcc
Copy link
Member

@thomcc thomcc commented Sep 9, 2020

changelog: The invalid_atomic_ordering lint can now detect misuse of compare_exchange, compare_exchange_weak, and fetch_update.


I was surprised not to find an issue or existing support here, since these are the functions which are always hardest to get the ordering right on for me (as the allowed orderings for fail depend on the success parameter).

I believe this lint now covers all atomic methods which care about their ordering now, but I could be wrong.

Hopefully I didn't forget to do anything for the PR!

@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 @phansch (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 Sep 9, 2020
Copy link
Member

@phansch phansch left a comment

Choose a reason for hiding this comment

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

LGTM implementation wise! However, I haven't used atomics at all, so would prefer a second review from @flip1995

clippy_lints/src/atomic_ordering.rs Outdated Show resolved Hide resolved
clippy_lints/src/atomic_ordering.rs Show resolved Hide resolved
clippy_lints/src/atomic_ordering.rs 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.

LGTM. But I think the examples in the documentation could benefit from some explanation.

clippy_lints/src/atomic_ordering.rs 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! everything LGTM now. Waiting for rustup.

@flip1995 flip1995 added S-waiting-on-bors Status: The marked PR was approved and is only waiting bors and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Sep 12, 2020
@matthiaskrgr
Copy link
Member

@bors r=flip1995

@bors
Copy link
Collaborator

bors commented Sep 16, 2020

📌 Commit 09f7a37 has been approved by flip1995

@bors
Copy link
Collaborator

bors commented Sep 16, 2020

⌛ Testing commit 09f7a37 with merge 44d6439...

@bors
Copy link
Collaborator

bors commented Sep 16, 2020

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

@bors bors merged commit 44d6439 into rust-lang:master Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: The marked PR was approved and is only waiting bors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants