]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/let_underscore.rs
Rollup merge of #91562 - dtolnay:asyncspace, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / clippy_lints / src / let_underscore.rs
index 9efd7aba7e83bccf09af6aea4f86da86285eeeda..d03276f7f98ba70912584d40a3256c88c0d86d58 100644 (file)
@@ -26,6 +26,7 @@
     /// // is_ok() is marked #[must_use]
     /// let _ = f().is_ok();
     /// ```
+    #[clippy::version = "1.42.0"]
     pub LET_UNDERSCORE_MUST_USE,
     restriction,
     "non-binding let on a `#[must_use]` expression"
@@ -33,7 +34,8 @@
 
 declare_clippy_lint! {
     /// ### What it does
-    /// Checks for `let _ = sync_lock`
+    /// Checks for `let _ = sync_lock`.
+    /// This supports `mutex` and `rwlock` in `std::sync` and `parking_lot`.
     ///
     /// ### Why is this bad?
     /// This statement immediately drops the lock instead of
@@ -53,6 +55,7 @@
     /// ```rust,ignore
     /// let _lock = mutex.lock();
     /// ```
+    #[clippy::version = "1.43.0"]
     pub LET_UNDERSCORE_LOCK,
     correctness,
     "non-binding let on a synchronization lock"
@@ -94,6 +97,7 @@
     ///     // dropped at end of scope
     /// }
     /// ```
+    #[clippy::version = "1.50.0"]
     pub LET_UNDERSCORE_DROP,
     pedantic,
     "non-binding let on a type that implements `Drop`"
 
 declare_lint_pass!(LetUnderscore => [LET_UNDERSCORE_MUST_USE, LET_UNDERSCORE_LOCK, LET_UNDERSCORE_DROP]);
 
-const SYNC_GUARD_PATHS: [&[&str]; 3] = [
+const SYNC_GUARD_PATHS: [&[&str]; 5] = [
     &paths::MUTEX_GUARD,
     &paths::RWLOCK_READ_GUARD,
     &paths::RWLOCK_WRITE_GUARD,
+    &paths::PARKING_LOT_RAWMUTEX,
+    &paths::PARKING_LOT_RAWRWLOCK,
 ];
 
 impl<'tcx> LateLintPass<'tcx> for LetUnderscore {