Skip to content

Commit

Permalink
Mark some structures 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 and taiki-e committed Feb 28, 2023
1 parent 78a4331 commit 6871c00
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crossbeam-utils/src/sync/sharded_lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ impl<T> From<T> for ShardedLock<T> {
}

/// A guard used to release the shared read access of a [`ShardedLock`] when dropped.
#[clippy::has_significant_drop]
pub struct ShardedLockReadGuard<'a, T: ?Sized> {
lock: &'a ShardedLock<T>,
_guard: RwLockReadGuard<'a, ()>,
Expand Down Expand Up @@ -511,6 +512,7 @@ impl<T: ?Sized + fmt::Display> fmt::Display for ShardedLockReadGuard<'_, T> {
}

/// A guard used to release the exclusive write access of a [`ShardedLock`] when dropped.
#[clippy::has_significant_drop]
pub struct ShardedLockWriteGuard<'a, T: ?Sized> {
lock: &'a ShardedLock<T>,
_marker: PhantomData<RwLockWriteGuard<'a, T>>,
Expand Down

0 comments on commit 6871c00

Please sign in to comment.