about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRay Redondo <raydredondo@gmail.com>2022-12-29 14:48:36 -0600
committerRay Redondo <raydredondo@gmail.com>2022-12-29 14:48:36 -0600
commit0298095ac21e8fd5eb5ead8edc1b49a365972cc4 (patch)
tree9a92cbc7f19d1d619bf062cb265fb55375b2e423
parent0e5fcb7b7f13c30668637568e9eb11ce0672a5ed (diff)
downloadrust-0298095ac21e8fd5eb5ead8edc1b49a365972cc4.tar.gz
rust-0298095ac21e8fd5eb5ead8edc1b49a365972cc4.zip
add comment about mutex_atomic issue to description
-rw-r--r--clippy_lints/src/mutex_atomic.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/clippy_lints/src/mutex_atomic.rs b/clippy_lints/src/mutex_atomic.rs
index 45bb217979a..dc866ab6373 100644
--- a/clippy_lints/src/mutex_atomic.rs
+++ b/clippy_lints/src/mutex_atomic.rs
@@ -1,6 +1,6 @@
 //! Checks for uses of mutex where an atomic value could be used
 //!
-//! This lint is **warn** by default
+//! This lint is **allow** by default
 
 use clippy_utils::diagnostics::span_lint;
 use clippy_utils::ty::is_type_diagnostic_item;
@@ -20,6 +20,10 @@ declare_clippy_lint! {
     /// `std::sync::atomic::AtomicBool` and `std::sync::atomic::AtomicPtr` are leaner and
     /// faster.
     ///
+    /// On the other hand, `Mutex`es are, in general, easier to
+    /// verify correctness. An atomic does not behave the same as
+    /// an equivalent mutex. See [this issue](https://github.com/rust-lang/rust-clippy/issues/4295)'s commentary for more details.
+    ///
     /// ### Known problems
     /// This lint cannot detect if the mutex is actually used
     /// for waiting before a critical section.
@@ -40,7 +44,7 @@ declare_clippy_lint! {
     #[clippy::version = "pre 1.29.0"]
     pub MUTEX_ATOMIC,
     restriction,
-    "using a mutex where an atomic value could be used instead"
+    "using a mutex where an atomic value could be used instead."
 }
 
 declare_clippy_lint! {