-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
mutex_atomic and CondVar #1516
Comments
Still a problem in most recent nightly... |
This is still reported as warning in Rust 1.45 |
Related to #4295. |
Filed #8260 to downgrade this lint to |
Is that the correct solution here? In my experience I get a bunch of newbies who don't understand sync primitives triggering this lint and then there are a handful of people who actually know better. Making the lint allow by default will mean those in the know don't need to do anything while the others don't know anything to do. I agree that the suggestion is suboptimal and should likely be removed in favor of better docs. |
@llogiq |
Ok, so I'm going to accept the downgrade as a temporary measure until the suggestion and docs have been sorted out. |
Downgrade mutex_atomic to nursery See #1516 and #4295. There are suggestions about removing this lint from the default warned lints in both issues. Also, [`mutex_integer`](https://rust-lang.github.io/rust-clippy/master/index.html#mutex_integer) lint that has the same problems as this lint is in `nursery` group. changelog: Moved [`mutex_atomic`] to `nursery`
Clippy's advice is incorrect here, we need a Mutex for the Condvar to be able to use Condvar::wait. See also: * rust-lang/rust-clippy#1516 * rust-lang/rust-clippy#4295 (comment)
The example at https://doc.rust-lang.org/std/sync/struct.Condvar.html issues a mutex_atomic warning, suggesting the replacement of
Mutex::new(false)
by anAtomicBool
. My understanding is that we need a mutex to use CondVar.The text was updated successfully, but these errors were encountered: