@@ -818,6 +818,9 @@ pub struct Iter<'a, K: 'a, V: 'a> {
818
818
elems_left : usize ,
819
819
}
820
820
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
+
821
824
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
822
825
impl < ' a , K , V > Clone for Iter < ' a , K , V > {
823
826
fn clone ( & self ) -> Iter < ' a , K , V > {
@@ -835,18 +838,29 @@ pub struct IterMut<'a, K: 'a, V: 'a> {
835
838
elems_left : usize ,
836
839
}
837
840
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
+
838
846
/// Iterator over the entries in a table, consuming the table.
839
847
pub struct IntoIter < K , V > {
840
848
table : RawTable < K , V > ,
841
849
iter : RawBuckets < ' static , K , V >
842
850
}
843
851
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
+
844
855
/// Iterator over the entries in a table, clearing the table.
845
856
pub struct Drain < ' a , K : ' a , V : ' a > {
846
857
table : & ' a mut RawTable < K , V > ,
847
858
iter : RawBuckets < ' static , K , V > ,
848
859
}
849
860
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
+
850
864
impl < ' a , K , V > Iterator for Iter < ' a , K , V > {
851
865
type Item = ( & ' a K , & ' a V ) ;
852
866
0 commit comments