Skip to content

Commit

Permalink
Auto merge of #82 - Amanieu:itermut_send, r=Amanieu
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed May 30, 2019
2 parents 1889600 + a4eba4f commit a9ddbcf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<K: Send, V: Send> Send for IterMut<'_, K, V> {}

impl<K, V> IterMut<'_, K, V> {
/// Returns a iterator of references over the remaining items.
#[inline]
Expand Down

0 comments on commit a9ddbcf

Please sign in to comment.