/// // 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"
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
/// ```rust,ignore
/// let _lock = mutex.lock();
/// ```
+ #[clippy::version = "1.43.0"]
pub LET_UNDERSCORE_LOCK,
correctness,
"non-binding let on a synchronization lock"
/// // 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 {