File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 11//! Checks for uses of mutex where an atomic value could be used
22//!
3- //! This lint is **warn ** by default
3+ //! This lint is **allow ** by default
44
55use clippy_utils:: diagnostics:: span_lint;
66use clippy_utils:: ty:: is_type_diagnostic_item;
@@ -20,6 +20,10 @@ declare_clippy_lint! {
2020 /// `std::sync::atomic::AtomicBool` and `std::sync::atomic::AtomicPtr` are leaner and
2121 /// faster.
2222 ///
23+ /// On the other hand, `Mutex`es are, in general, easier to
24+ /// verify correctness. An atomic does not behave the same as
25+ /// an equivalent mutex. See [this issue](https://github.com/rust-lang/rust-clippy/issues/4295)'s commentary for more details.
26+ ///
2327 /// ### Known problems
2428 /// This lint cannot detect if the mutex is actually used
2529 /// for waiting before a critical section.
@@ -40,7 +44,7 @@ declare_clippy_lint! {
4044 #[ clippy:: version = "pre 1.29.0" ]
4145 pub MUTEX_ATOMIC ,
4246 restriction,
43- "using a mutex where an atomic value could be used instead"
47+ "using a mutex where an atomic value could be used instead. "
4448}
4549
4650declare_clippy_lint ! {
You can’t perform that action at this time.
0 commit comments