-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
new lint: missing-spin-loop
#8174
Conversation
r? @flip1995 (rust-highfive has picked a reviewer for you, use r? to override) |
0394b51
to
d1e704e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, just a NIT.
d1e704e
to
2b03d5e
Compare
This is blocked on rust/#92870. |
2b03d5e
to
b6379bf
Compare
No longer blocked. No idea why the base test was cancelled, but everything seems to be in order here locally. r? @flip1995 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. r=me after removing the FIXME
.
if let ExprKind::MethodCall(method, [callee, ..], _) = unpack_cond(cond).kind; | ||
if [sym::load, sym::compare_exchange, sym::compare_exchange_weak].contains(&method.ident.name); | ||
if let ty::Adt(def, _substs) = cx.typeck_results().expr_ty(callee).kind(); | ||
//FIXME: The AtomicBool sym is apparently not correctly assigned, once it is, uncomment: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this fixme can now be removed.
b6379bf
to
9f1080c
Compare
📌 Commit 9f1080c has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This fixes #7809. I went with the shorter name because the function is called
std::hint::spin_loop
. It doesn't yet detectwhile let
loops. I left that for a follow-up PR.changelog: new lint: [
missing_spin_loop
]