From 59dfa3dfe9fe531f47655b6a77d9032f3120a09f Mon Sep 17 00:00:00 2001 From: Caio Date: Thu, 2 Feb 2023 11:24:48 -0300 Subject: [PATCH 1/2] Mark `MutexGuard` with `#[clippy::has_significant_drop]` `#[clippy::has_significant_drop]` tells that a structure should be considered when evaluating some lints. Examples of such behavior are the existent `clippy::significant_drop_in_scrutinee` and in the soon-to-be-finished https://github.com/rust-lang/rust-clippy/issues/9399. --- lock_api/src/mutex.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs index c97e5430..75ecf5ad 100644 --- a/lock_api/src/mutex.rs +++ b/lock_api/src/mutex.rs @@ -485,6 +485,7 @@ where /// /// The data protected by the mutex can be accessed through this guard via its /// `Deref` and `DerefMut` implementations. +#[clippy::has_significant_drop]` #[must_use = "if unused the Mutex will immediately unlock"] pub struct MutexGuard<'a, R: RawMutex, T: ?Sized> { mutex: &'a Mutex, From b52ce42fa9f062ada6124e87622c0e3977c822c4 Mon Sep 17 00:00:00 2001 From: Caio Date: Fri, 3 Feb 2023 18:31:06 -0300 Subject: [PATCH 2/2] Bad character --- lock_api/src/mutex.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs index 75ecf5ad..a302c87a 100644 --- a/lock_api/src/mutex.rs +++ b/lock_api/src/mutex.rs @@ -485,7 +485,7 @@ where /// /// The data protected by the mutex can be accessed through this guard via its /// `Deref` and `DerefMut` implementations. -#[clippy::has_significant_drop]` +#[clippy::has_significant_drop] #[must_use = "if unused the Mutex will immediately unlock"] pub struct MutexGuard<'a, R: RawMutex, T: ?Sized> { mutex: &'a Mutex,