Skip to content

Commit 2bd15ed

Browse files
committed
Apply feedback from rust-lang/rust#56241
1 parent 332db4d commit 2bd15ed

File tree

7 files changed

+293
-163
lines changed

7 files changed

+293
-163
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
@@ -26,7 +26,6 @@
2626
#![allow(clippy::module_name_repetitions)]
2727

2828
#[cfg(test)]
29-
#[cfg_attr(feature = "rayon", macro_use)]
3029
extern crate std;
3130
#[cfg(test)]
3231
extern crate rand;
@@ -45,6 +44,7 @@ extern crate std as alloc;
4544
#[macro_use]
4645
mod macros;
4746

47+
mod scopeguard;
4848
mod external_trait_impls;
4949
mod fx;
5050
mod map;

src/map.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,7 @@ impl<K, V> HashMap<K, V, DefaultHashBuilder> {
231231
}
232232
}
233233

234-
impl<K, V, S> HashMap<K, V, S>
235-
{
234+
impl<K, V, S> HashMap<K, V, S> {
236235
/// Creates an empty `HashMap` which will use the given hash builder to hash
237236
/// keys.
238237
///
@@ -1090,7 +1089,7 @@ where
10901089
/// [`HashMap`]: struct.HashMap.html
10911090
pub struct Iter<'a, K: 'a, V: 'a> {
10921091
inner: RawIter<(K, V)>,
1093-
_marker: PhantomData<&'a HashMap<K, V>>,
1092+
_marker: PhantomData<(&'a K, &'a V)>,
10941093
}
10951094

10961095
// FIXME(#26925) Remove in favor of `#[derive(Clone)]`
@@ -1120,7 +1119,7 @@ impl<'a, K: Debug, V: Debug> fmt::Debug for Iter<'a, K, V> {
11201119
pub struct IterMut<'a, K: 'a, V: 'a> {
11211120
inner: RawIter<(K, V)>,
11221121
// To ensure invariance with respect to V
1123-
_marker: PhantomData<&'a mut V>,
1122+
_marker: PhantomData<(&'a K, &'a mut V)>,
11241123
}
11251124

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

src/raw/generic.rs

+6
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ impl Group {
132132
BitMask((self.0 & repeat(0x80)).to_le())
133133
}
134134

135+
/// Returns a `BitMask` indicating all bytes in the group which are full.
136+
#[inline]
137+
pub fn match_full(&self) -> BitMask {
138+
self.match_empty_or_deleted().invert()
139+
}
140+
135141
/// Performs the following transformation on all bytes in the group:
136142
/// - `EMPTY => EMPTY`
137143
/// - `DELETED => EMPTY`

0 commit comments

Comments
 (0)