Skip to content

Commit

Permalink
Mark MutexGuard with #[clippy::has_significant_drop]
Browse files Browse the repository at this point in the history
`#[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 rust-lang/rust-clippy#9399.
  • Loading branch information
c410-f3r authored Feb 2, 2023
1 parent 80ec801 commit f8a1a6e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tokio/src/sync/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ pub struct Mutex<T: ?Sized> {
///
/// The lock is automatically released whenever the guard is dropped, at which
/// point `lock` will succeed yet again.
#[clippy::has_significant_drop]
#[must_use = "if unused the Mutex will immediately unlock"]
pub struct MutexGuard<'a, T: ?Sized> {
#[cfg(all(tokio_unstable, feature = "tracing"))]
Expand Down

0 comments on commit f8a1a6e

Please sign in to comment.