]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/mutex_atomic.rs
Merge commit '1480cea393d0cee195e59949eabdfbcf1230f7f9' into clippyup
[rust.git] / src / tools / clippy / clippy_lints / src / mutex_atomic.rs
index 09cb53331763d04f5188d36089dee85f1e360b77..dc866ab6373bbb76fd013d62159e30f2ab3587e3 100644 (file)
@@ -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;
     /// `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.
@@ -39,8 +43,8 @@
     /// ```
     #[clippy::version = "pre 1.29.0"]
     pub MUTEX_ATOMIC,
-    nursery,
-    "using a mutex where an atomic value could be used instead"
+    restriction,
+    "using a mutex where an atomic value could be used instead."
 }
 
 declare_clippy_lint! {