@@ -818,6 +818,9 @@ pub struct Iter<'a, K: 'a, V: 'a> {
818818 elems_left : usize ,
819819}
820820
821+ unsafe impl < ' a , K : Sync , V : Sync > Sync for Iter < ' a , K , V > { }
822+ unsafe impl < ' a , K : Sync , V : Sync > Send for Iter < ' a , K , V > { }
823+
821824// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
822825impl < ' a , K , V > Clone for Iter < ' a , K , V > {
823826 fn clone ( & self ) -> Iter < ' a , K , V > {
@@ -835,18 +838,29 @@ pub struct IterMut<'a, K: 'a, V: 'a> {
835838 elems_left : usize ,
836839}
837840
841+ unsafe impl < ' a , K : Sync , V : Sync > Sync for IterMut < ' a , K , V > { }
842+ // Both K: Sync and K: Send are correct for IterMut's Send impl,
843+ // but Send is the more useful bound
844+ unsafe impl < ' a , K : Send , V : Send > Send for IterMut < ' a , K , V > { }
845+
838846/// Iterator over the entries in a table, consuming the table.
839847pub struct IntoIter < K , V > {
840848 table : RawTable < K , V > ,
841849 iter : RawBuckets < ' static , K , V >
842850}
843851
852+ unsafe impl < K : Sync , V : Sync > Sync for IntoIter < K , V > { }
853+ unsafe impl < K : Send , V : Send > Send for IntoIter < K , V > { }
854+
844855/// Iterator over the entries in a table, clearing the table.
845856pub struct Drain < ' a , K : ' a , V : ' a > {
846857 table : & ' a mut RawTable < K , V > ,
847858 iter : RawBuckets < ' static , K , V > ,
848859}
849860
861+ unsafe impl < ' a , K : Sync , V : Sync > Sync for Drain < ' a , K , V > { }
862+ unsafe impl < ' a , K : Send , V : Send > Send for Drain < ' a , K , V > { }
863+
850864impl < ' a , K , V > Iterator for Iter < ' a , K , V > {
851865 type Item = ( & ' a K , & ' a V ) ;
852866
0 commit comments