Skip to content

Commit a9ddbcf

Browse files
committed
Auto merge of #82 - Amanieu:itermut_send, r=Amanieu
Fix the bounds on K for the Send impl of IterMut This makes the bounds match the ones of the previous `HashMap` implementation in libstd. cc rust-lang/rust#61357
2 parents 1889600 + a4eba4f commit a9ddbcf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/map.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,11 @@ pub struct IterMut<'a, K, V> {
11191119
marker: PhantomData<(&'a K, &'a mut V)>,
11201120
}
11211121

1122+
// We override the default Send impl which has K: Sync instead of K: Send. Both
1123+
// are correct, but this one is more general since it allows keys which
1124+
// implement Send but not Sync.
1125+
unsafe impl<K: Send, V: Send> Send for IterMut<'_, K, V> {}
1126+
11221127
impl<K, V> IterMut<'_, K, V> {
11231128
/// Returns a iterator of references over the remaining items.
11241129
#[inline]

0 commit comments

Comments
 (0)