Skip to content

Commit

Permalink
Merge #958
Browse files Browse the repository at this point in the history
958: Mark some structures with `#[clippy::has_significant_drop]` r=taiki-e a=c410-f3r

`#[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 the soon-to-be-finished rust-lang/rust-clippy#9399.

Co-authored-by: Caio <[email protected]>
  • Loading branch information
bors[bot] and c410-f3r authored Feb 4, 2023
2 parents d2dbfaf + d1a5c9e commit 99ec614
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 99ec614

Please sign in to comment.