Skip to content

Commit

Permalink
Add Send, Sync implementations for OccupiedEntryRef
Browse files Browse the repository at this point in the history
  • Loading branch information
ajtribick committed Dec 19, 2021
1 parent f37c859 commit 7c545e1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2845,6 +2845,25 @@ pub struct OccupiedEntryRef<'a, 'b, K, Q: ?Sized, V, S, A: Allocator + Clone = G
table: &'a mut HashMap<K, V, S, A>,
}

unsafe impl<'a, 'b, K, Q, V, S, A> Send for OccupiedEntryRef<'a, 'b, K, Q, V, S, A>
where
K: Send,
Q: Sync + ?Sized,
V: Send,
S: Send,
A: Send + Allocator + Clone,
{
}
unsafe impl<'a, 'b, K, Q, V, S, A> Sync for OccupiedEntryRef<'a, 'b, K, Q, V, S, A>
where
K: Sync,
Q: Sync + ?Sized,
V: Sync,
S: Sync,
A: Sync + Allocator + Clone,
{
}

impl<K: Borrow<Q>, Q: ?Sized + Debug, V: Debug, S, A: Allocator + Clone> Debug
for OccupiedEntryRef<'_, '_, K, Q, V, S, A>
{
Expand Down

0 comments on commit 7c545e1

Please sign in to comment.