Skip to content

Commit 5d1d4e9

Browse files
committed
Apply feedback from rust-lang/rust#56241
1 parent 4f1cfb0 commit 5d1d4e9

File tree

7 files changed

+291
-164
lines changed

7 files changed

+291
-164
lines changed

src/external_trait_impls/rayon/raw.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ pub struct RawParIter<T> {
1515
iter: RawIterRange<T>,
1616
}
1717

18-
unsafe impl<T> Send for RawParIter<T> {}
19-
2018
impl<T> ParallelIterator for RawParIter<T> {
2119
type Item = Bucket<T>;
2220

@@ -35,8 +33,6 @@ struct ParIterProducer<T> {
3533
iter: RawIterRange<T>,
3634
}
3735

38-
unsafe impl<T> Send for ParIterProducer<T> {}
39-
4036
impl<T> UnindexedProducer for ParIterProducer<T> {
4137
type Item = Bucket<T>;
4238

@@ -62,8 +58,6 @@ pub struct RawIntoParIter<T> {
6258
table: RawTable<T>,
6359
}
6460

65-
unsafe impl<T> Send for RawIntoParIter<T> {}
66-
6761
impl<T: Send> ParallelIterator for RawIntoParIter<T> {
6862
type Item = T;
6963

@@ -87,8 +81,8 @@ impl<T: Send> ParallelIterator for RawIntoParIter<T> {
8781

8882
/// Parallel iterator which consumes elements without freeing the table storage.
8983
pub struct RawParDrain<'a, T> {
90-
// We don't use a &'a RawTable<T> because we want RawParDrain to be
91-
// covariant over 'a.
84+
// We don't use a &'a mut RawTable<T> because we want RawParDrain to be
85+
// covariant over T.
9286
table: NonNull<RawTable<T>>,
9387
_marker: PhantomData<&'a RawTable<T>>,
9488
}
@@ -126,8 +120,6 @@ struct ParDrainProducer<T> {
126120
iter: RawIterRange<T>,
127121
}
128122

129-
unsafe impl<T: Send> Send for ParDrainProducer<T> {}
130-
131123
impl<T: Send> UnindexedProducer for ParDrainProducer<T> {
132124
type Item = T;
133125

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#![warn(missing_docs)]
2626

2727
#[cfg(test)]
28-
#[cfg_attr(feature = "rayon", macro_use)]
2928
extern crate std;
3029
#[cfg(test)]
3130
extern crate rand;
@@ -41,6 +40,7 @@ extern crate serde;
4140
#[cfg_attr(test, macro_use)]
4241
extern crate std as alloc;
4342

43+
mod scopeguard;
4444
mod external_trait_impls;
4545
mod fx;
4646
mod map;

src/map.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ where
10921092
/// [`HashMap`]: struct.HashMap.html
10931093
pub struct Iter<'a, K: 'a, V: 'a> {
10941094
inner: RawIter<(K, V)>,
1095-
_marker: PhantomData<&'a HashMap<K, V>>,
1095+
_marker: PhantomData<(&'a K, &'a V)>,
10961096
}
10971097

10981098
// FIXME(#26925) Remove in favor of `#[derive(Clone)]`
@@ -1122,7 +1122,7 @@ impl<'a, K: Debug, V: Debug> fmt::Debug for Iter<'a, K, V> {
11221122
pub struct IterMut<'a, K: 'a, V: 'a> {
11231123
inner: RawIter<(K, V)>,
11241124
// To ensure invariance with respect to V
1125-
_marker: PhantomData<&'a mut V>,
1125+
_marker: PhantomData<(&'a K, &'a mut V)>,
11261126
}
11271127

11281128
impl<'a, K, V> IterMut<'a, K, V> {

src/raw/generic.rs

+6
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ impl Group {
122122
BitMask((self.0 & repeat(0x80)).to_le())
123123
}
124124

125+
/// Returns a `BitMask` indicating all bytes in the group which are full.
126+
#[inline]
127+
pub fn match_full(&self) -> BitMask {
128+
self.match_empty_or_deleted().invert()
129+
}
130+
125131
/// Performs the following transformation on all bytes in the group:
126132
/// - `EMPTY => EMPTY`
127133
/// - `DELETED => EMPTY`

0 commit comments

Comments
 (0)