Skip to content

Commit 7c545e1

Browse files
committed
Add Send, Sync implementations for OccupiedEntryRef
1 parent f37c859 commit 7c545e1

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/map.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2845,6 +2845,25 @@ pub struct OccupiedEntryRef<'a, 'b, K, Q: ?Sized, V, S, A: Allocator + Clone = G
28452845
table: &'a mut HashMap<K, V, S, A>,
28462846
}
28472847

2848+
unsafe impl<'a, 'b, K, Q, V, S, A> Send for OccupiedEntryRef<'a, 'b, K, Q, V, S, A>
2849+
where
2850+
K: Send,
2851+
Q: Sync + ?Sized,
2852+
V: Send,
2853+
S: Send,
2854+
A: Send + Allocator + Clone,
2855+
{
2856+
}
2857+
unsafe impl<'a, 'b, K, Q, V, S, A> Sync for OccupiedEntryRef<'a, 'b, K, Q, V, S, A>
2858+
where
2859+
K: Sync,
2860+
Q: Sync + ?Sized,
2861+
V: Sync,
2862+
S: Sync,
2863+
A: Sync + Allocator + Clone,
2864+
{
2865+
}
2866+
28482867
impl<K: Borrow<Q>, Q: ?Sized + Debug, V: Debug, S, A: Allocator + Clone> Debug
28492868
for OccupiedEntryRef<'_, '_, K, Q, V, S, A>
28502869
{

0 commit comments

Comments
 (0)