Skip to content

Commit 142e536

Browse files
committed
Add Send and Sync for hash_table::OccupiedEntry
1 parent b31e883 commit 142e536

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/table.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,6 +1432,19 @@ where
14321432
table: &'a mut RawTable<T, A>,
14331433
}
14341434

1435+
unsafe impl<T, A> Send for OccupiedEntry<'_, T, A>
1436+
where
1437+
T: Send,
1438+
A: Send + Allocator,
1439+
{
1440+
}
1441+
unsafe impl<T, A> Sync for OccupiedEntry<'_, T, A>
1442+
where
1443+
T: Sync,
1444+
A: Sync + Allocator,
1445+
{
1446+
}
1447+
14351448
impl<T: fmt::Debug, A: Allocator> fmt::Debug for OccupiedEntry<'_, T, A> {
14361449
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
14371450
f.debug_struct("OccupiedEntry")

0 commit comments

Comments
 (0)