Skip to content

Commit 4cae5d5

Browse files
committed
Fix trait bounds on Send/Sync impls
1 parent b3eaf32 commit 4cae5d5

File tree

3 files changed

+41
-9
lines changed

3 files changed

+41
-9
lines changed

src/external_trait_impls/rayon/raw.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl<T, A: Allocator + Clone> RawIntoParIter<T, A> {
8787
}
8888
}
8989

90-
impl<T: Send, A: Allocator + Clone> ParallelIterator for RawIntoParIter<T, A> {
90+
impl<T: Send, A: Allocator + Clone + Send> ParallelIterator for RawIntoParIter<T, A> {
9191
type Item = T;
9292

9393
#[cfg_attr(feature = "inline-more", inline)]
@@ -116,7 +116,7 @@ pub struct RawParDrain<'a, T, A: Allocator + Clone = Global> {
116116
marker: PhantomData<&'a RawTable<T, A>>,
117117
}
118118

119-
unsafe impl<T, A: Allocator + Clone> Send for RawParDrain<'_, T, A> {}
119+
unsafe impl<T: Send, A: Allocator + Clone> Send for RawParDrain<'_, T, A> {}
120120

121121
impl<T, A: Allocator + Clone> RawParDrain<'_, T, A> {
122122
#[cfg_attr(feature = "inline-more", inline)]

src/map.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2113,14 +2113,16 @@ unsafe impl<K, V, S, A> Send for RawOccupiedEntryMut<'_, K, V, S, A>
21132113
where
21142114
K: Send,
21152115
V: Send,
2116+
S: Send,
21162117
A: Send + Allocator + Clone,
21172118
{
21182119
}
21192120
unsafe impl<K, V, S, A> Sync for RawOccupiedEntryMut<'_, K, V, S, A>
21202121
where
21212122
K: Sync,
21222123
V: Sync,
2123-
A: Send + Allocator + Clone,
2124+
S: Sync,
2125+
A: Sync + Allocator + Clone,
21242126
{
21252127
}
21262128

src/raw/mod.rs

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,8 +1031,18 @@ impl<T, A: Allocator + Clone> RawTable<T, A> {
10311031
}
10321032
}
10331033

1034-
unsafe impl<T, A: Allocator + Clone> Send for RawTable<T, A> where T: Send {}
1035-
unsafe impl<T, A: Allocator + Clone> Sync for RawTable<T, A> where T: Sync {}
1034+
unsafe impl<T, A: Allocator + Clone> Send for RawTable<T, A>
1035+
where
1036+
T: Send,
1037+
A: Send,
1038+
{
1039+
}
1040+
unsafe impl<T, A: Allocator + Clone> Sync for RawTable<T, A>
1041+
where
1042+
T: Sync,
1043+
A: Sync,
1044+
{
1045+
}
10361046

10371047
impl<A> RawTableInner<A> {
10381048
#[inline]
@@ -2156,8 +2166,18 @@ impl<T, A: Allocator + Clone> RawIntoIter<T, A> {
21562166
}
21572167
}
21582168

2159-
unsafe impl<T, A: Allocator + Clone> Send for RawIntoIter<T, A> where T: Send {}
2160-
unsafe impl<T, A: Allocator + Clone> Sync for RawIntoIter<T, A> where T: Sync {}
2169+
unsafe impl<T, A: Allocator + Clone> Send for RawIntoIter<T, A>
2170+
where
2171+
T: Send,
2172+
A: Send,
2173+
{
2174+
}
2175+
unsafe impl<T, A: Allocator + Clone> Sync for RawIntoIter<T, A>
2176+
where
2177+
T: Sync,
2178+
A: Sync,
2179+
{
2180+
}
21612181

21622182
#[cfg(feature = "nightly")]
21632183
unsafe impl<#[may_dangle] T, A: Allocator + Clone> Drop for RawIntoIter<T, A> {
@@ -2229,8 +2249,18 @@ impl<T, A: Allocator + Clone> RawDrain<'_, T, A> {
22292249
}
22302250
}
22312251

2232-
unsafe impl<T, A: Allocator + Copy> Send for RawDrain<'_, T, A> where T: Send {}
2233-
unsafe impl<T, A: Allocator + Copy> Sync for RawDrain<'_, T, A> where T: Sync {}
2252+
unsafe impl<T, A: Allocator + Copy> Send for RawDrain<'_, T, A>
2253+
where
2254+
T: Send,
2255+
A: Send,
2256+
{
2257+
}
2258+
unsafe impl<T, A: Allocator + Copy> Sync for RawDrain<'_, T, A>
2259+
where
2260+
T: Sync,
2261+
A: Sync,
2262+
{
2263+
}
22342264

22352265
impl<T, A: Allocator + Clone> Drop for RawDrain<'_, T, A> {
22362266
#[cfg_attr(feature = "inline-more", inline)]

0 commit comments

Comments
 (0)