File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
//! Checks for uses of mutex where an atomic value could be used
2
2
//!
3
- //! This lint is **warn ** by default
3
+ //! This lint is **allow ** by default
4
4
5
5
use clippy_utils:: diagnostics:: span_lint;
6
6
use clippy_utils:: ty:: is_type_diagnostic_item;
@@ -20,6 +20,10 @@ declare_clippy_lint! {
20
20
/// `std::sync::atomic::AtomicBool` and `std::sync::atomic::AtomicPtr` are leaner and
21
21
/// faster.
22
22
///
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
+ ///
23
27
/// ### Known problems
24
28
/// This lint cannot detect if the mutex is actually used
25
29
/// for waiting before a critical section.
@@ -40,7 +44,7 @@ declare_clippy_lint! {
40
44
#[ clippy:: version = "pre 1.29.0" ]
41
45
pub MUTEX_ATOMIC ,
42
46
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. "
44
48
}
45
49
46
50
declare_clippy_lint ! {
You can’t perform that action at this time.
0 commit comments