From 142e536877f5ad31dab75d949542b3c55c537f33 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Fri, 22 Sep 2023 12:01:52 +0800 Subject: [PATCH] Add Send and Sync for `hash_table::OccupiedEntry` --- src/table.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/table.rs b/src/table.rs index 1178a4cbb..37ec55693 100644 --- a/src/table.rs +++ b/src/table.rs @@ -1432,6 +1432,19 @@ where table: &'a mut RawTable, } +unsafe impl Send for OccupiedEntry<'_, T, A> +where + T: Send, + A: Send + Allocator, +{ +} +unsafe impl Sync for OccupiedEntry<'_, T, A> +where + T: Sync, + A: Sync + Allocator, +{ +} + impl fmt::Debug for OccupiedEntry<'_, T, A> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("OccupiedEntry")