Skip to content

Commit 9df7c6d

Browse files
committed
Auto merge of #100 - kyren:master, r=Amanieu
Add manual Send and Sync impls for RawOccupiedEntryMut These impls match the raw impls for `OccupiedEntry`, which are necessary because they both contain `Bucket` which is not automatically `Sync`. I believe `RawOccupiedEntryMut` is already automatically `Send`, but this adds both manual impls to match `OccupiedEntry`. Fixes #99
2 parents ae53f8b + a4647c5 commit 9df7c6d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/map.rs

+13
Original file line numberDiff line numberDiff line change
@@ -1280,6 +1280,19 @@ pub struct RawOccupiedEntryMut<'a, K, V> {
12801280
table: &'a mut RawTable<(K, V)>,
12811281
}
12821282

1283+
unsafe impl<K, V> Send for RawOccupiedEntryMut<'_, K, V>
1284+
where
1285+
K: Send,
1286+
V: Send,
1287+
{
1288+
}
1289+
unsafe impl<K, V> Sync for RawOccupiedEntryMut<'_, K, V>
1290+
where
1291+
K: Sync,
1292+
V: Sync,
1293+
{
1294+
}
1295+
12831296
/// A view into a vacant entry in a `HashMap`.
12841297
/// It is part of the [`RawEntryMut`] enum.
12851298
///

0 commit comments

Comments
 (0)