From a4eba4f79a98dc0035d446ad88ac05fcec740453 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Thu, 30 May 2019 21:06:32 +0100 Subject: [PATCH] Fix the bounds on K for the Send impl of IterMut --- src/map.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/map.rs b/src/map.rs index 6017295759..ad5602a997 100644 --- a/src/map.rs +++ b/src/map.rs @@ -1119,6 +1119,11 @@ pub struct IterMut<'a, K, V> { marker: PhantomData<(&'a K, &'a mut V)>, } +// We override the default Send impl which has K: Sync instead of K: Send. Both +// are correct, but this one is more general since it allows keys which +// implement Send but not Sync. +unsafe impl Send for IterMut<'_, K, V> {} + impl IterMut<'_, K, V> { /// Returns a iterator of references over the remaining items. #[inline]