Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b6daaf0

Browse files
committedDec 8, 2020
Account for renaming AllocRef to Allocator on nightly
The trait's identifier was changed in rust-lang/rust#79286.
1 parent b226638 commit b6daaf0

File tree

8 files changed

+246
-244
lines changed

8 files changed

+246
-244
lines changed
 

‎src/external_trait_impls/rayon/map.rs

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Rayon extensions for `HashMap`.
22
33
use crate::hash_map::HashMap;
4-
use crate::raw::{AllocRef, Global};
4+
use crate::raw::{Allocator, Global};
55
use core::fmt;
66
use core::hash::{BuildHasher, Hash};
77
use rayon::iter::plumbing::UnindexedConsumer;
@@ -16,11 +16,11 @@ use rayon::iter::{FromParallelIterator, IntoParallelIterator, ParallelExtend, Pa
1616
/// [`par_iter`]: /hashbrown/struct.HashMap.html#method.par_iter
1717
/// [`HashMap`]: /hashbrown/struct.HashMap.html
1818
/// [`IntoParallelRefIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelRefIterator.html
19-
pub struct ParIter<'a, K, V, S, A: AllocRef + Clone = Global> {
19+
pub struct ParIter<'a, K, V, S, A: Allocator + Clone = Global> {
2020
map: &'a HashMap<K, V, S, A>,
2121
}
2222

23-
impl<'a, K: Sync, V: Sync, S: Sync, A: AllocRef + Clone + Sync> ParallelIterator
23+
impl<'a, K: Sync, V: Sync, S: Sync, A: Allocator + Clone + Sync> ParallelIterator
2424
for ParIter<'a, K, V, S, A>
2525
{
2626
type Item = (&'a K, &'a V);
@@ -39,14 +39,14 @@ impl<'a, K: Sync, V: Sync, S: Sync, A: AllocRef + Clone + Sync> ParallelIterator
3939
}
4040
}
4141

42-
impl<K, V, S, A: AllocRef + Clone> Clone for ParIter<'_, K, V, S, A> {
42+
impl<K, V, S, A: Allocator + Clone> Clone for ParIter<'_, K, V, S, A> {
4343
#[cfg_attr(feature = "inline-more", inline)]
4444
fn clone(&self) -> Self {
4545
ParIter { map: self.map }
4646
}
4747
}
4848

49-
impl<K: fmt::Debug + Eq + Hash, V: fmt::Debug, S: BuildHasher, A: AllocRef + Clone> fmt::Debug
49+
impl<K: fmt::Debug + Eq + Hash, V: fmt::Debug, S: BuildHasher, A: Allocator + Clone> fmt::Debug
5050
for ParIter<'_, K, V, S, A>
5151
{
5252
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
@@ -61,11 +61,11 @@ impl<K: fmt::Debug + Eq + Hash, V: fmt::Debug, S: BuildHasher, A: AllocRef + Clo
6161
///
6262
/// [`par_keys`]: /hashbrown/struct.HashMap.html#method.par_keys
6363
/// [`HashMap`]: /hashbrown/struct.HashMap.html
64-
pub struct ParKeys<'a, K, V, S, A: AllocRef + Clone> {
64+
pub struct ParKeys<'a, K, V, S, A: Allocator + Clone> {
6565
map: &'a HashMap<K, V, S, A>,
6666
}
6767

68-
impl<'a, K: Sync, V: Sync, S: Sync, A: AllocRef + Clone + Sync> ParallelIterator
68+
impl<'a, K: Sync, V: Sync, S: Sync, A: Allocator + Clone + Sync> ParallelIterator
6969
for ParKeys<'a, K, V, S, A>
7070
{
7171
type Item = &'a K;
@@ -81,14 +81,14 @@ impl<'a, K: Sync, V: Sync, S: Sync, A: AllocRef + Clone + Sync> ParallelIterator
8181
}
8282
}
8383

84-
impl<K, V, S, A: AllocRef + Clone> Clone for ParKeys<'_, K, V, S, A> {
84+
impl<K, V, S, A: Allocator + Clone> Clone for ParKeys<'_, K, V, S, A> {
8585
#[cfg_attr(feature = "inline-more", inline)]
8686
fn clone(&self) -> Self {
8787
ParKeys { map: self.map }
8888
}
8989
}
9090

91-
impl<K: fmt::Debug + Eq + Hash, V, S: BuildHasher, A: AllocRef + Clone> fmt::Debug
91+
impl<K: fmt::Debug + Eq + Hash, V, S: BuildHasher, A: Allocator + Clone> fmt::Debug
9292
for ParKeys<'_, K, V, S, A>
9393
{
9494
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
@@ -103,11 +103,11 @@ impl<K: fmt::Debug + Eq + Hash, V, S: BuildHasher, A: AllocRef + Clone> fmt::Deb
103103
///
104104
/// [`par_values`]: /hashbrown/struct.HashMap.html#method.par_values
105105
/// [`HashMap`]: /hashbrown/struct.HashMap.html
106-
pub struct ParValues<'a, K, V, S, A: AllocRef + Clone = Global> {
106+
pub struct ParValues<'a, K, V, S, A: Allocator + Clone = Global> {
107107
map: &'a HashMap<K, V, S, A>,
108108
}
109109

110-
impl<'a, K: Sync, V: Sync, S: Sync, A: AllocRef + Clone + Sync> ParallelIterator
110+
impl<'a, K: Sync, V: Sync, S: Sync, A: Allocator + Clone + Sync> ParallelIterator
111111
for ParValues<'a, K, V, S, A>
112112
{
113113
type Item = &'a V;
@@ -123,14 +123,14 @@ impl<'a, K: Sync, V: Sync, S: Sync, A: AllocRef + Clone + Sync> ParallelIterator
123123
}
124124
}
125125

126-
impl<K, V, S, A: AllocRef + Clone> Clone for ParValues<'_, K, V, S, A> {
126+
impl<K, V, S, A: Allocator + Clone> Clone for ParValues<'_, K, V, S, A> {
127127
#[cfg_attr(feature = "inline-more", inline)]
128128
fn clone(&self) -> Self {
129129
ParValues { map: self.map }
130130
}
131131
}
132132

133-
impl<K: Eq + Hash, V: fmt::Debug, S: BuildHasher, A: AllocRef + Clone> fmt::Debug
133+
impl<K: Eq + Hash, V: fmt::Debug, S: BuildHasher, A: Allocator + Clone> fmt::Debug
134134
for ParValues<'_, K, V, S, A>
135135
{
136136
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
@@ -147,11 +147,11 @@ impl<K: Eq + Hash, V: fmt::Debug, S: BuildHasher, A: AllocRef + Clone> fmt::Debu
147147
/// [`par_iter_mut`]: /hashbrown/struct.HashMap.html#method.par_iter_mut
148148
/// [`HashMap`]: /hashbrown/struct.HashMap.html
149149
/// [`IntoParallelRefMutIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelRefMutIterator.html
150-
pub struct ParIterMut<'a, K, V, S, A: AllocRef + Clone> {
150+
pub struct ParIterMut<'a, K, V, S, A: Allocator + Clone> {
151151
map: &'a mut HashMap<K, V, S, A>,
152152
}
153153

154-
impl<'a, K: Send + Sync, V: Send, S: Send, A: AllocRef + Clone + Sync> ParallelIterator
154+
impl<'a, K: Send + Sync, V: Send, S: Send, A: Allocator + Clone + Sync> ParallelIterator
155155
for ParIterMut<'a, K, V, S, A>
156156
{
157157
type Item = (&'a K, &'a mut V);
@@ -170,7 +170,7 @@ impl<'a, K: Send + Sync, V: Send, S: Send, A: AllocRef + Clone + Sync> ParallelI
170170
}
171171
}
172172

173-
impl<K: fmt::Debug + Eq + Hash, V: fmt::Debug, S: BuildHasher, A: AllocRef + Clone> fmt::Debug
173+
impl<K: fmt::Debug + Eq + Hash, V: fmt::Debug, S: BuildHasher, A: Allocator + Clone> fmt::Debug
174174
for ParIterMut<'_, K, V, S, A>
175175
{
176176
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
@@ -185,11 +185,11 @@ impl<K: fmt::Debug + Eq + Hash, V: fmt::Debug, S: BuildHasher, A: AllocRef + Clo
185185
///
186186
/// [`par_values_mut`]: /hashbrown/struct.HashMap.html#method.par_values_mut
187187
/// [`HashMap`]: /hashbrown/struct.HashMap.html
188-
pub struct ParValuesMut<'a, K, V, S, A: AllocRef + Clone = Global> {
188+
pub struct ParValuesMut<'a, K, V, S, A: Allocator + Clone = Global> {
189189
map: &'a mut HashMap<K, V, S, A>,
190190
}
191191

192-
impl<'a, K: Send, V: Send, S: Send, A: AllocRef + Clone + Send> ParallelIterator
192+
impl<'a, K: Send, V: Send, S: Send, A: Allocator + Clone + Send> ParallelIterator
193193
for ParValuesMut<'a, K, V, S, A>
194194
{
195195
type Item = &'a mut V;
@@ -205,7 +205,7 @@ impl<'a, K: Send, V: Send, S: Send, A: AllocRef + Clone + Send> ParallelIterator
205205
}
206206
}
207207

208-
impl<K: Eq + Hash, V: fmt::Debug, S: BuildHasher, A: AllocRef + Clone> fmt::Debug
208+
impl<K: Eq + Hash, V: fmt::Debug, S: BuildHasher, A: Allocator + Clone> fmt::Debug
209209
for ParValuesMut<'_, K, V, S, A>
210210
{
211211
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
@@ -222,11 +222,11 @@ impl<K: Eq + Hash, V: fmt::Debug, S: BuildHasher, A: AllocRef + Clone> fmt::Debu
222222
/// [`into_par_iter`]: /hashbrown/struct.HashMap.html#method.into_par_iter
223223
/// [`HashMap`]: /hashbrown/struct.HashMap.html
224224
/// [`IntoParallelIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelIterator.html
225-
pub struct IntoParIter<K, V, S, A: AllocRef + Clone = Global> {
225+
pub struct IntoParIter<K, V, S, A: Allocator + Clone = Global> {
226226
map: HashMap<K, V, S, A>,
227227
}
228228

229-
impl<K: Send, V: Send, S: Send, A: AllocRef + Clone + Send> ParallelIterator
229+
impl<K: Send, V: Send, S: Send, A: Allocator + Clone + Send> ParallelIterator
230230
for IntoParIter<K, V, S, A>
231231
{
232232
type Item = (K, V);
@@ -240,7 +240,7 @@ impl<K: Send, V: Send, S: Send, A: AllocRef + Clone + Send> ParallelIterator
240240
}
241241
}
242242

243-
impl<K: fmt::Debug + Eq + Hash, V: fmt::Debug, S: BuildHasher, A: AllocRef + Clone> fmt::Debug
243+
impl<K: fmt::Debug + Eq + Hash, V: fmt::Debug, S: BuildHasher, A: Allocator + Clone> fmt::Debug
244244
for IntoParIter<K, V, S, A>
245245
{
246246
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
@@ -255,11 +255,11 @@ impl<K: fmt::Debug + Eq + Hash, V: fmt::Debug, S: BuildHasher, A: AllocRef + Clo
255255
///
256256
/// [`par_drain`]: /hashbrown/struct.HashMap.html#method.par_drain
257257
/// [`HashMap`]: /hashbrown/struct.HashMap.html
258-
pub struct ParDrain<'a, K, V, S, A: AllocRef + Clone = Global> {
258+
pub struct ParDrain<'a, K, V, S, A: Allocator + Clone = Global> {
259259
map: &'a mut HashMap<K, V, S, A>,
260260
}
261261

262-
impl<K: Send, V: Send, S: Send, A: AllocRef + Clone + Sync> ParallelIterator
262+
impl<K: Send, V: Send, S: Send, A: Allocator + Clone + Sync> ParallelIterator
263263
for ParDrain<'_, K, V, S, A>
264264
{
265265
type Item = (K, V);
@@ -273,15 +273,15 @@ impl<K: Send, V: Send, S: Send, A: AllocRef + Clone + Sync> ParallelIterator
273273
}
274274
}
275275

276-
impl<K: fmt::Debug + Eq + Hash, V: fmt::Debug, S: BuildHasher, A: AllocRef + Clone> fmt::Debug
276+
impl<K: fmt::Debug + Eq + Hash, V: fmt::Debug, S: BuildHasher, A: Allocator + Clone> fmt::Debug
277277
for ParDrain<'_, K, V, S, A>
278278
{
279279
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
280280
self.map.iter().fmt(f)
281281
}
282282
}
283283

284-
impl<K: Sync, V: Sync, S: Sync, A: AllocRef + Clone + Sync> HashMap<K, V, S, A> {
284+
impl<K: Sync, V: Sync, S: Sync, A: Allocator + Clone + Sync> HashMap<K, V, S, A> {
285285
/// Visits (potentially in parallel) immutably borrowed keys in an arbitrary order.
286286
#[cfg_attr(feature = "inline-more", inline)]
287287
pub fn par_keys(&self) -> ParKeys<'_, K, V, S, A> {
@@ -295,7 +295,7 @@ impl<K: Sync, V: Sync, S: Sync, A: AllocRef + Clone + Sync> HashMap<K, V, S, A>
295295
}
296296
}
297297

298-
impl<K: Send, V: Send, S: Send, A: AllocRef + Clone + Sync> HashMap<K, V, S, A> {
298+
impl<K: Send, V: Send, S: Send, A: Allocator + Clone + Sync> HashMap<K, V, S, A> {
299299
/// Visits (potentially in parallel) mutably borrowed values in an arbitrary order.
300300
#[cfg_attr(feature = "inline-more", inline)]
301301
pub fn par_values_mut(&mut self) -> ParValuesMut<'_, K, V, S, A> {
@@ -315,7 +315,7 @@ where
315315
K: Eq + Hash + Sync,
316316
V: PartialEq + Sync,
317317
S: BuildHasher + Sync,
318-
A: AllocRef + Clone + Sync,
318+
A: Allocator + Clone + Sync,
319319
{
320320
/// Returns `true` if the map is equal to another,
321321
/// i.e. both maps contain the same keys mapped to the same values.
@@ -329,7 +329,7 @@ where
329329
}
330330
}
331331

332-
impl<K: Send, V: Send, S: Send, A: AllocRef + Clone + Send> IntoParallelIterator
332+
impl<K: Send, V: Send, S: Send, A: Allocator + Clone + Send> IntoParallelIterator
333333
for HashMap<K, V, S, A>
334334
{
335335
type Item = (K, V);
@@ -341,7 +341,7 @@ impl<K: Send, V: Send, S: Send, A: AllocRef + Clone + Send> IntoParallelIterator
341341
}
342342
}
343343

344-
impl<'a, K: Sync, V: Sync, S: Sync, A: AllocRef + Clone + Sync> IntoParallelIterator
344+
impl<'a, K: Sync, V: Sync, S: Sync, A: Allocator + Clone + Sync> IntoParallelIterator
345345
for &'a HashMap<K, V, S, A>
346346
{
347347
type Item = (&'a K, &'a V);
@@ -353,7 +353,7 @@ impl<'a, K: Sync, V: Sync, S: Sync, A: AllocRef + Clone + Sync> IntoParallelIter
353353
}
354354
}
355355

356-
impl<'a, K: Send + Sync, V: Send, S: Send, A: AllocRef + Clone + Sync> IntoParallelIterator
356+
impl<'a, K: Send + Sync, V: Send, S: Send, A: Allocator + Clone + Sync> IntoParallelIterator
357357
for &'a mut HashMap<K, V, S, A>
358358
{
359359
type Item = (&'a K, &'a mut V);
@@ -391,7 +391,7 @@ where
391391
K: Eq + Hash + Send,
392392
V: Send,
393393
S: BuildHasher,
394-
A: AllocRef + Clone,
394+
A: Allocator + Clone,
395395
{
396396
fn par_extend<I>(&mut self, par_iter: I)
397397
where
@@ -407,7 +407,7 @@ where
407407
K: Copy + Eq + Hash + Sync,
408408
V: Copy + Sync,
409409
S: BuildHasher,
410-
A: AllocRef + Clone,
410+
A: Allocator + Clone,
411411
{
412412
fn par_extend<I>(&mut self, par_iter: I)
413413
where
@@ -423,7 +423,7 @@ where
423423
K: Eq + Hash,
424424
S: BuildHasher,
425425
I: IntoParallelIterator,
426-
A: AllocRef + Clone,
426+
A: Allocator + Clone,
427427
HashMap<K, V, S, A>: Extend<I::Item>,
428428
{
429429
let (list, len) = super::helpers::collect(par_iter);

‎src/external_trait_impls/rayon/raw.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::raw::Bucket;
2-
use crate::raw::{AllocRef, RawIter, RawIterRange, RawTable};
2+
use crate::raw::{Allocator, RawIter, RawIterRange, RawTable};
33
use crate::scopeguard::guard;
44
use alloc::alloc::dealloc;
55
use core::marker::PhantomData;
@@ -60,11 +60,11 @@ impl<T> UnindexedProducer for ParIterProducer<T> {
6060
}
6161

6262
/// Parallel iterator which consumes a table and returns elements.
63-
pub struct RawIntoParIter<T, A: AllocRef + Clone> {
63+
pub struct RawIntoParIter<T, A: Allocator + Clone> {
6464
table: RawTable<T, A>,
6565
}
6666

67-
impl<T: Send, A: AllocRef + Clone> ParallelIterator for RawIntoParIter<T, A> {
67+
impl<T: Send, A: Allocator + Clone> ParallelIterator for RawIntoParIter<T, A> {
6868
type Item = T;
6969

7070
#[cfg_attr(feature = "inline-more", inline)]
@@ -86,16 +86,16 @@ impl<T: Send, A: AllocRef + Clone> ParallelIterator for RawIntoParIter<T, A> {
8686
}
8787

8888
/// Parallel iterator which consumes elements without freeing the table storage.
89-
pub struct RawParDrain<'a, T, A: AllocRef + Clone> {
89+
pub struct RawParDrain<'a, T, A: Allocator + Clone> {
9090
// We don't use a &'a mut RawTable<T> because we want RawParDrain to be
9191
// covariant over T.
9292
table: NonNull<RawTable<T, A>>,
9393
marker: PhantomData<&'a RawTable<T, A>>,
9494
}
9595

96-
unsafe impl<T, A: AllocRef + Clone> Send for RawParDrain<'_, T, A> {}
96+
unsafe impl<T, A: Allocator + Clone> Send for RawParDrain<'_, T, A> {}
9797

98-
impl<T: Send, A: AllocRef + Clone> ParallelIterator for RawParDrain<'_, T, A> {
98+
impl<T: Send, A: Allocator + Clone> ParallelIterator for RawParDrain<'_, T, A> {
9999
type Item = T;
100100

101101
#[cfg_attr(feature = "inline-more", inline)]
@@ -113,7 +113,7 @@ impl<T: Send, A: AllocRef + Clone> ParallelIterator for RawParDrain<'_, T, A> {
113113
}
114114
}
115115

116-
impl<T, A: AllocRef + Clone> Drop for RawParDrain<'_, T, A> {
116+
impl<T, A: Allocator + Clone> Drop for RawParDrain<'_, T, A> {
117117
fn drop(&mut self) {
118118
// If drive_unindexed is not called then simply clear the table.
119119
unsafe { self.table.as_mut().clear() }
@@ -172,7 +172,7 @@ impl<T> Drop for ParDrainProducer<T> {
172172
}
173173
}
174174

175-
impl<T, A: AllocRef + Clone> RawTable<T, A> {
175+
impl<T, A: Allocator + Clone> RawTable<T, A> {
176176
/// Returns a parallel iterator over the elements in a `RawTable`.
177177
#[cfg_attr(feature = "inline-more", inline)]
178178
pub unsafe fn par_iter(&self) -> RawParIter<T> {

‎src/external_trait_impls/rayon/set.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Rayon extensions for `HashSet`.
22
33
use crate::hash_set::HashSet;
4-
use crate::raw::{AllocRef, Global};
4+
use crate::raw::{Allocator, Global};
55
use core::hash::{BuildHasher, Hash};
66
use rayon::iter::plumbing::UnindexedConsumer;
77
use rayon::iter::{FromParallelIterator, IntoParallelIterator, ParallelExtend, ParallelIterator};
@@ -15,11 +15,11 @@ use rayon::iter::{FromParallelIterator, IntoParallelIterator, ParallelExtend, Pa
1515
/// [`into_par_iter`]: /hashbrown/struct.HashSet.html#method.into_par_iter
1616
/// [`HashSet`]: /hashbrown/struct.HashSet.html
1717
/// [`IntoParallelIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelIterator.html
18-
pub struct IntoParIter<T, S, A: AllocRef + Clone = Global> {
18+
pub struct IntoParIter<T, S, A: Allocator + Clone = Global> {
1919
set: HashSet<T, S, A>,
2020
}
2121

22-
impl<T: Send, S: Send, A: AllocRef + Clone + Send> ParallelIterator for IntoParIter<T, S, A> {
22+
impl<T: Send, S: Send, A: Allocator + Clone + Send> ParallelIterator for IntoParIter<T, S, A> {
2323
type Item = T;
2424

2525
fn drive_unindexed<C>(self, consumer: C) -> C::Result
@@ -41,11 +41,11 @@ impl<T: Send, S: Send, A: AllocRef + Clone + Send> ParallelIterator for IntoParI
4141
///
4242
/// [`par_drain`]: /hashbrown/struct.HashSet.html#method.par_drain
4343
/// [`HashSet`]: /hashbrown/struct.HashSet.html
44-
pub struct ParDrain<'a, T, S, A: AllocRef + Clone = Global> {
44+
pub struct ParDrain<'a, T, S, A: Allocator + Clone = Global> {
4545
set: &'a mut HashSet<T, S, A>,
4646
}
4747

48-
impl<T: Send, S: Send, A: AllocRef + Clone + Send + Sync> ParallelIterator
48+
impl<T: Send, S: Send, A: Allocator + Clone + Send + Sync> ParallelIterator
4949
for ParDrain<'_, T, S, A>
5050
{
5151
type Item = T;
@@ -71,11 +71,11 @@ impl<T: Send, S: Send, A: AllocRef + Clone + Send + Sync> ParallelIterator
7171
/// [`par_iter`]: /hashbrown/struct.HashSet.html#method.par_iter
7272
/// [`HashSet`]: /hashbrown/struct.HashSet.html
7373
/// [`IntoParallelRefIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelRefIterator.html
74-
pub struct ParIter<'a, T, S, A: AllocRef + Clone = Global> {
74+
pub struct ParIter<'a, T, S, A: Allocator + Clone = Global> {
7575
set: &'a HashSet<T, S, A>,
7676
}
7777

78-
impl<'a, T: Sync, S: Sync, A: AllocRef + Clone + Sync> ParallelIterator for ParIter<'a, T, S, A> {
78+
impl<'a, T: Sync, S: Sync, A: Allocator + Clone + Sync> ParallelIterator for ParIter<'a, T, S, A> {
7979
type Item = &'a T;
8080

8181
fn drive_unindexed<C>(self, consumer: C) -> C::Result
@@ -94,7 +94,7 @@ impl<'a, T: Sync, S: Sync, A: AllocRef + Clone + Sync> ParallelIterator for ParI
9494
///
9595
/// [`par_difference`]: /hashbrown/struct.HashSet.html#method.par_difference
9696
/// [`HashSet`]: /hashbrown/struct.HashSet.html
97-
pub struct ParDifference<'a, T, S, A: AllocRef + Clone = Global> {
97+
pub struct ParDifference<'a, T, S, A: Allocator + Clone = Global> {
9898
a: &'a HashSet<T, S, A>,
9999
b: &'a HashSet<T, S, A>,
100100
}
@@ -103,7 +103,7 @@ impl<'a, T, S, A> ParallelIterator for ParDifference<'a, T, S, A>
103103
where
104104
T: Eq + Hash + Sync,
105105
S: BuildHasher + Sync,
106-
A: AllocRef + Clone + Sync,
106+
A: Allocator + Clone + Sync,
107107
{
108108
type Item = &'a T;
109109

@@ -127,7 +127,7 @@ where
127127
///
128128
/// [`par_symmetric_difference`]: /hashbrown/struct.HashSet.html#method.par_symmetric_difference
129129
/// [`HashSet`]: /hashbrown/struct.HashSet.html
130-
pub struct ParSymmetricDifference<'a, T, S, A: AllocRef + Clone = Global> {
130+
pub struct ParSymmetricDifference<'a, T, S, A: Allocator + Clone = Global> {
131131
a: &'a HashSet<T, S, A>,
132132
b: &'a HashSet<T, S, A>,
133133
}
@@ -136,7 +136,7 @@ impl<'a, T, S, A> ParallelIterator for ParSymmetricDifference<'a, T, S, A>
136136
where
137137
T: Eq + Hash + Sync,
138138
S: BuildHasher + Sync,
139-
A: AllocRef + Clone + Sync,
139+
A: Allocator + Clone + Sync,
140140
{
141141
type Item = &'a T;
142142

@@ -159,7 +159,7 @@ where
159159
///
160160
/// [`par_intersection`]: /hashbrown/struct.HashSet.html#method.par_intersection
161161
/// [`HashSet`]: /hashbrown/struct.HashSet.html
162-
pub struct ParIntersection<'a, T, S, A: AllocRef + Clone = Global> {
162+
pub struct ParIntersection<'a, T, S, A: Allocator + Clone = Global> {
163163
a: &'a HashSet<T, S, A>,
164164
b: &'a HashSet<T, S, A>,
165165
}
@@ -168,7 +168,7 @@ impl<'a, T, S, A> ParallelIterator for ParIntersection<'a, T, S, A>
168168
where
169169
T: Eq + Hash + Sync,
170170
S: BuildHasher + Sync,
171-
A: AllocRef + Clone + Sync,
171+
A: Allocator + Clone + Sync,
172172
{
173173
type Item = &'a T;
174174

@@ -230,7 +230,7 @@ impl<T, S, A> HashSet<T, S, A>
230230
where
231231
T: Eq + Hash + Sync,
232232
S: BuildHasher + Sync,
233-
A: AllocRef + Clone + Sync,
233+
A: Allocator + Clone + Sync,
234234
{
235235
/// Visits (potentially in parallel) the values representing the difference,
236236
/// i.e. the values that are in `self` but not in `other`.
@@ -297,7 +297,7 @@ impl<T, S, A> HashSet<T, S, A>
297297
where
298298
T: Eq + Hash + Send,
299299
S: BuildHasher + Send,
300-
A: AllocRef + Clone + Send,
300+
A: Allocator + Clone + Send,
301301
{
302302
/// Consumes (potentially in parallel) all values in an arbitrary order,
303303
/// while preserving the set's allocated memory for reuse.
@@ -307,7 +307,7 @@ where
307307
}
308308
}
309309

310-
impl<T: Send, S: Send, A: AllocRef + Clone + Send> IntoParallelIterator for HashSet<T, S, A> {
310+
impl<T: Send, S: Send, A: Allocator + Clone + Send> IntoParallelIterator for HashSet<T, S, A> {
311311
type Item = T;
312312
type Iter = IntoParIter<T, S, A>;
313313

@@ -317,7 +317,7 @@ impl<T: Send, S: Send, A: AllocRef + Clone + Send> IntoParallelIterator for Hash
317317
}
318318
}
319319

320-
impl<'a, T: Sync, S: Sync, A: AllocRef + Clone + Sync> IntoParallelIterator
320+
impl<'a, T: Sync, S: Sync, A: Allocator + Clone + Sync> IntoParallelIterator
321321
for &'a HashSet<T, S, A>
322322
{
323323
type Item = &'a T;
@@ -378,7 +378,7 @@ fn extend<T, S, I, A>(set: &mut HashSet<T, S, A>, par_iter: I)
378378
where
379379
T: Eq + Hash,
380380
S: BuildHasher,
381-
A: AllocRef + Clone,
381+
A: Allocator + Clone,
382382
I: IntoParallelIterator,
383383
HashSet<T, S, A>: Extend<I::Item>,
384384
{

‎src/map.rs

Lines changed: 66 additions & 66 deletions
Large diffs are not rendered by default.

‎src/raw/alloc.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ pub use self::inner::*;
33
#[cfg(feature = "nightly")]
44
mod inner {
55
use crate::alloc::alloc::Layout;
6-
pub use crate::alloc::alloc::{AllocRef, Global};
6+
pub use crate::alloc::alloc::{Allocator, Global};
77
use core::ptr::NonNull;
88

99
#[allow(clippy::map_err_ignore)]
10-
pub fn do_alloc<A: AllocRef>(alloc: &A, layout: Layout) -> Result<NonNull<u8>, ()> {
10+
pub fn do_alloc<A: Allocator>(alloc: &A, layout: Layout) -> Result<NonNull<u8>, ()> {
1111
alloc
12-
.alloc(layout)
12+
.allocate(layout)
1313
.map(|ptr| ptr.as_non_null_ptr())
1414
.map_err(|_| ())
1515
}
@@ -22,18 +22,18 @@ mod inner {
2222

2323
pub struct AllocError;
2424

25-
pub unsafe trait AllocRef {
26-
fn alloc(&self, layout: Layout) -> Result<NonNull<u8>, AllocError>;
27-
unsafe fn dealloc(&self, ptr: NonNull<u8>, layout: Layout);
25+
pub unsafe trait Allocator {
26+
fn allocate(&self, layout: Layout) -> Result<NonNull<u8>, AllocError>;
27+
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout);
2828
}
2929

3030
#[derive(Copy, Clone)]
3131
pub struct Global;
32-
unsafe impl AllocRef for Global {
33-
fn alloc(&self, layout: Layout) -> Result<NonNull<u8>, AllocError> {
32+
unsafe impl Allocator for Global {
33+
fn allocate(&self, layout: Layout) -> Result<NonNull<u8>, AllocError> {
3434
unsafe { NonNull::new(alloc(layout)).ok_or(AllocError) }
3535
}
36-
unsafe fn dealloc(&self, ptr: NonNull<u8>, layout: Layout) {
36+
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout) {
3737
dealloc(ptr.as_ptr(), layout)
3838
}
3939
}
@@ -44,7 +44,7 @@ mod inner {
4444
}
4545

4646
#[allow(clippy::map_err_ignore)]
47-
pub fn do_alloc<A: AllocRef>(alloc: &A, layout: Layout) -> Result<NonNull<u8>, ()> {
48-
alloc.alloc(layout).map_err(|_| ())
47+
pub fn do_alloc<A: Allocator>(alloc: &A, layout: Layout) -> Result<NonNull<u8>, ()> {
48+
alloc.allocate(layout).map_err(|_| ())
4949
}
5050
}

‎src/raw/mod.rs

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ cfg_if! {
3232
}
3333

3434
mod alloc;
35-
pub use self::alloc::{do_alloc, AllocRef, Global};
35+
pub use self::alloc::{do_alloc, Allocator, Global};
3636

3737
mod bitmask;
3838

@@ -367,7 +367,7 @@ impl<T> Bucket<T> {
367367
}
368368

369369
/// A raw hash table with an unsafe API.
370-
pub struct RawTable<T, A: AllocRef + Clone> {
370+
pub struct RawTable<T, A: Allocator + Clone> {
371371
// Mask to get an index from a hash value. The value is one less than the
372372
// number of buckets in the table.
373373
bucket_mask: usize,
@@ -408,7 +408,7 @@ impl<T> RawTable<T, Global> {
408408
}
409409
}
410410

411-
impl<T, A: AllocRef + Clone> RawTable<T, A> {
411+
impl<T, A: Allocator + Clone> RawTable<T, A> {
412412
/// Creates a new empty hash table without allocating any memory, using the
413413
/// given allocator.
414414
///
@@ -508,7 +508,7 @@ impl<T, A: AllocRef + Clone> RawTable<T, A> {
508508
Some(lco) => lco,
509509
None => hint::unreachable_unchecked(),
510510
};
511-
self.alloc.dealloc(
511+
self.alloc.deallocate(
512512
NonNull::new_unchecked(self.ctrl.as_ptr().sub(ctrl_offset)),
513513
layout,
514514
);
@@ -1221,10 +1221,10 @@ impl<T, A: AllocRef + Clone> RawTable<T, A> {
12211221
}
12221222
}
12231223

1224-
unsafe impl<T, A: AllocRef + Clone> Send for RawTable<T, A> where T: Send {}
1225-
unsafe impl<T, A: AllocRef + Clone> Sync for RawTable<T, A> where T: Sync {}
1224+
unsafe impl<T, A: Allocator + Clone> Send for RawTable<T, A> where T: Send {}
1225+
unsafe impl<T, A: Allocator + Clone> Sync for RawTable<T, A> where T: Sync {}
12261226

1227-
impl<T: Clone, A: AllocRef + Clone> Clone for RawTable<T, A> {
1227+
impl<T: Clone, A: Allocator + Clone> Clone for RawTable<T, A> {
12281228
fn clone(&self) -> Self {
12291229
if self.is_empty_singleton() {
12301230
Self::new_in(self.alloc.clone())
@@ -1297,7 +1297,7 @@ impl<T: Clone, A: AllocRef + Clone> Clone for RawTable<T, A> {
12971297
trait RawTableClone {
12981298
unsafe fn clone_from_spec(&mut self, source: &Self, on_panic: impl FnMut(&mut Self));
12991299
}
1300-
impl<T: Clone, A: AllocRef + Clone> RawTableClone for RawTable<T, A> {
1300+
impl<T: Clone, A: Allocator + Clone> RawTableClone for RawTable<T, A> {
13011301
#[cfg_attr(feature = "inline-more", inline)]
13021302
default_fn! {
13031303
unsafe fn clone_from_spec(&mut self, source: &Self, on_panic: impl FnMut(&mut Self)) {
@@ -1306,7 +1306,7 @@ impl<T: Clone, A: AllocRef + Clone> RawTableClone for RawTable<T, A> {
13061306
}
13071307
}
13081308
#[cfg(feature = "nightly")]
1309-
impl<T: Copy, A: AllocRef + Clone> RawTableClone for RawTable<T, A> {
1309+
impl<T: Copy, A: Allocator + Clone> RawTableClone for RawTable<T, A> {
13101310
#[cfg_attr(feature = "inline-more", inline)]
13111311
unsafe fn clone_from_spec(&mut self, source: &Self, _on_panic: impl FnMut(&mut Self)) {
13121312
source
@@ -1321,7 +1321,7 @@ impl<T: Copy, A: AllocRef + Clone> RawTableClone for RawTable<T, A> {
13211321
}
13221322
}
13231323

1324-
impl<T: Clone, A: AllocRef + Clone> RawTable<T, A> {
1324+
impl<T: Clone, A: Allocator + Clone> RawTable<T, A> {
13251325
/// Common code for clone and clone_from. Assumes `self.buckets() == source.buckets()`.
13261326
#[cfg_attr(feature = "inline-more", inline)]
13271327
unsafe fn clone_from_impl(&mut self, source: &Self, mut on_panic: impl FnMut(&mut Self)) {
@@ -1411,7 +1411,7 @@ impl<T: Clone, A: AllocRef + Clone> RawTable<T, A> {
14111411
}
14121412

14131413
#[cfg(feature = "nightly")]
1414-
unsafe impl<#[may_dangle] T, A: AllocRef + Clone> Drop for RawTable<T, A> {
1414+
unsafe impl<#[may_dangle] T, A: Allocator + Clone> Drop for RawTable<T, A> {
14151415
#[cfg_attr(feature = "inline-more", inline)]
14161416
fn drop(&mut self) {
14171417
if !self.is_empty_singleton() {
@@ -1427,7 +1427,7 @@ unsafe impl<#[may_dangle] T, A: AllocRef + Clone> Drop for RawTable<T, A> {
14271427
}
14281428
}
14291429
#[cfg(not(feature = "nightly"))]
1430-
impl<T, A: AllocRef + Clone> Drop for RawTable<T, A> {
1430+
impl<T, A: Allocator + Clone> Drop for RawTable<T, A> {
14311431
#[cfg_attr(feature = "inline-more", inline)]
14321432
fn drop(&mut self) {
14331433
if !self.is_empty_singleton() {
@@ -1443,7 +1443,7 @@ impl<T, A: AllocRef + Clone> Drop for RawTable<T, A> {
14431443
}
14441444
}
14451445

1446-
impl<T, A: AllocRef + Clone> IntoIterator for RawTable<T, A> {
1446+
impl<T, A: Allocator + Clone> IntoIterator for RawTable<T, A> {
14471447
type Item = T;
14481448
type IntoIter = RawIntoIter<T, A>;
14491449

@@ -1770,25 +1770,25 @@ impl<T> ExactSizeIterator for RawIter<T> {}
17701770
impl<T> FusedIterator for RawIter<T> {}
17711771

17721772
/// Iterator which consumes a table and returns elements.
1773-
pub struct RawIntoIter<T, A: AllocRef + Clone> {
1773+
pub struct RawIntoIter<T, A: Allocator + Clone> {
17741774
iter: RawIter<T>,
17751775
allocation: Option<(NonNull<u8>, Layout)>,
17761776
marker: PhantomData<T>,
17771777
alloc: A,
17781778
}
17791779

1780-
impl<T, A: AllocRef + Clone> RawIntoIter<T, A> {
1780+
impl<T, A: Allocator + Clone> RawIntoIter<T, A> {
17811781
#[cfg_attr(feature = "inline-more", inline)]
17821782
pub fn iter(&self) -> RawIter<T> {
17831783
self.iter.clone()
17841784
}
17851785
}
17861786

1787-
unsafe impl<T, A: AllocRef + Clone> Send for RawIntoIter<T, A> where T: Send {}
1788-
unsafe impl<T, A: AllocRef + Clone> Sync for RawIntoIter<T, A> where T: Sync {}
1787+
unsafe impl<T, A: Allocator + Clone> Send for RawIntoIter<T, A> where T: Send {}
1788+
unsafe impl<T, A: Allocator + Clone> Sync for RawIntoIter<T, A> where T: Sync {}
17891789

17901790
#[cfg(feature = "nightly")]
1791-
unsafe impl<#[may_dangle] T, A: AllocRef + Clone> Drop for RawIntoIter<T, A> {
1791+
unsafe impl<#[may_dangle] T, A: Allocator + Clone> Drop for RawIntoIter<T, A> {
17921792
#[cfg_attr(feature = "inline-more", inline)]
17931793
fn drop(&mut self) {
17941794
unsafe {
@@ -1801,13 +1801,13 @@ unsafe impl<#[may_dangle] T, A: AllocRef + Clone> Drop for RawIntoIter<T, A> {
18011801

18021802
// Free the table
18031803
if let Some((ptr, layout)) = self.allocation {
1804-
self.alloc.dealloc(ptr, layout);
1804+
self.alloc.deallocate(ptr, layout);
18051805
}
18061806
}
18071807
}
18081808
}
18091809
#[cfg(not(feature = "nightly"))]
1810-
impl<T, A: AllocRef + Clone> Drop for RawIntoIter<T, A> {
1810+
impl<T, A: Allocator + Clone> Drop for RawIntoIter<T, A> {
18111811
#[cfg_attr(feature = "inline-more", inline)]
18121812
fn drop(&mut self) {
18131813
unsafe {
@@ -1821,13 +1821,13 @@ impl<T, A: AllocRef + Clone> Drop for RawIntoIter<T, A> {
18211821
// Free the table
18221822
if let Some((ptr, layout)) = self.allocation {
18231823
self.alloc
1824-
.dealloc(NonNull::new_unchecked(ptr.as_ptr()), layout);
1824+
.deallocate(NonNull::new_unchecked(ptr.as_ptr()), layout);
18251825
}
18261826
}
18271827
}
18281828
}
18291829

1830-
impl<T, A: AllocRef + Clone> Iterator for RawIntoIter<T, A> {
1830+
impl<T, A: Allocator + Clone> Iterator for RawIntoIter<T, A> {
18311831
type Item = T;
18321832

18331833
#[cfg_attr(feature = "inline-more", inline)]
@@ -1841,11 +1841,11 @@ impl<T, A: AllocRef + Clone> Iterator for RawIntoIter<T, A> {
18411841
}
18421842
}
18431843

1844-
impl<T, A: AllocRef + Clone> ExactSizeIterator for RawIntoIter<T, A> {}
1845-
impl<T, A: AllocRef + Clone> FusedIterator for RawIntoIter<T, A> {}
1844+
impl<T, A: Allocator + Clone> ExactSizeIterator for RawIntoIter<T, A> {}
1845+
impl<T, A: Allocator + Clone> FusedIterator for RawIntoIter<T, A> {}
18461846

18471847
/// Iterator which consumes elements without freeing the table storage.
1848-
pub struct RawDrain<'a, T, A: AllocRef + Clone> {
1848+
pub struct RawDrain<'a, T, A: Allocator + Clone> {
18491849
iter: RawIter<T>,
18501850

18511851
// The table is moved into the iterator for the duration of the drain. This
@@ -1859,17 +1859,17 @@ pub struct RawDrain<'a, T, A: AllocRef + Clone> {
18591859
marker: PhantomData<&'a RawTable<T, A>>,
18601860
}
18611861

1862-
impl<T, A: AllocRef + Clone> RawDrain<'_, T, A> {
1862+
impl<T, A: Allocator + Clone> RawDrain<'_, T, A> {
18631863
#[cfg_attr(feature = "inline-more", inline)]
18641864
pub fn iter(&self) -> RawIter<T> {
18651865
self.iter.clone()
18661866
}
18671867
}
18681868

1869-
unsafe impl<T, A: AllocRef + Copy> Send for RawDrain<'_, T, A> where T: Send {}
1870-
unsafe impl<T, A: AllocRef + Copy> Sync for RawDrain<'_, T, A> where T: Sync {}
1869+
unsafe impl<T, A: Allocator + Copy> Send for RawDrain<'_, T, A> where T: Send {}
1870+
unsafe impl<T, A: Allocator + Copy> Sync for RawDrain<'_, T, A> where T: Sync {}
18711871

1872-
impl<T, A: AllocRef + Clone> Drop for RawDrain<'_, T, A> {
1872+
impl<T, A: Allocator + Clone> Drop for RawDrain<'_, T, A> {
18731873
#[cfg_attr(feature = "inline-more", inline)]
18741874
fn drop(&mut self) {
18751875
unsafe {
@@ -1892,7 +1892,7 @@ impl<T, A: AllocRef + Clone> Drop for RawDrain<'_, T, A> {
18921892
}
18931893
}
18941894

1895-
impl<T, A: AllocRef + Clone> Iterator for RawDrain<'_, T, A> {
1895+
impl<T, A: Allocator + Clone> Iterator for RawDrain<'_, T, A> {
18961896
type Item = T;
18971897

18981898
#[cfg_attr(feature = "inline-more", inline)]
@@ -1909,13 +1909,13 @@ impl<T, A: AllocRef + Clone> Iterator for RawDrain<'_, T, A> {
19091909
}
19101910
}
19111911

1912-
impl<T, A: AllocRef + Clone> ExactSizeIterator for RawDrain<'_, T, A> {}
1913-
impl<T, A: AllocRef + Clone> FusedIterator for RawDrain<'_, T, A> {}
1912+
impl<T, A: Allocator + Clone> ExactSizeIterator for RawDrain<'_, T, A> {}
1913+
impl<T, A: Allocator + Clone> FusedIterator for RawDrain<'_, T, A> {}
19141914

19151915
/// Iterator over occupied buckets that could match a given hash.
19161916
///
19171917
/// In rare cases, the iterator may return a bucket with a different hash.
1918-
pub struct RawIterHash<'a, T, A: AllocRef + Clone> {
1918+
pub struct RawIterHash<'a, T, A: Allocator + Clone> {
19191919
table: &'a RawTable<T, A>,
19201920

19211921
// The top 7 bits of the hash.
@@ -1930,7 +1930,7 @@ pub struct RawIterHash<'a, T, A: AllocRef + Clone> {
19301930
bitmask: BitMaskIter,
19311931
}
19321932

1933-
impl<'a, T, A: AllocRef + Clone> RawIterHash<'a, T, A> {
1933+
impl<'a, T, A: Allocator + Clone> RawIterHash<'a, T, A> {
19341934
fn new(table: &'a RawTable<T, A>, hash: u64) -> Self {
19351935
unsafe {
19361936
let h2_hash = h2(hash);
@@ -1949,7 +1949,7 @@ impl<'a, T, A: AllocRef + Clone> RawIterHash<'a, T, A> {
19491949
}
19501950
}
19511951

1952-
impl<'a, T, A: AllocRef + Clone> Iterator for RawIterHash<'a, T, A> {
1952+
impl<'a, T, A: Allocator + Clone> Iterator for RawIterHash<'a, T, A> {
19531953
type Item = Bucket<T>;
19541954

19551955
fn next(&mut self) -> Option<Bucket<T>> {

‎src/rustc_entry.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use self::RustcEntry::*;
22
use crate::map::{make_hash, Drain, HashMap, IntoIter, Iter, IterMut};
3-
use crate::raw::{AllocRef, Bucket, Global, RawTable};
3+
use crate::raw::{Allocator, Bucket, Global, RawTable};
44
use core::fmt::{self, Debug};
55
use core::hash::{BuildHasher, Hash};
66
use core::mem;
@@ -9,7 +9,7 @@ impl<K, V, S, A> HashMap<K, V, S, A>
99
where
1010
K: Eq + Hash,
1111
S: BuildHasher,
12-
A: AllocRef + Clone,
12+
A: Allocator + Clone,
1313
{
1414
/// Gets the given key's corresponding entry in the map for in-place manipulation.
1515
///
@@ -62,7 +62,7 @@ where
6262
/// [`entry`]: struct.HashMap.html#method.rustc_entry
6363
pub enum RustcEntry<'a, K, V, A = Global>
6464
where
65-
A: AllocRef + Clone,
65+
A: Allocator + Clone,
6666
{
6767
/// An occupied entry.
6868
Occupied(RustcOccupiedEntry<'a, K, V, A>),
@@ -71,7 +71,7 @@ where
7171
Vacant(RustcVacantEntry<'a, K, V, A>),
7272
}
7373

74-
impl<K: Debug, V: Debug, A: AllocRef + Clone> Debug for RustcEntry<'_, K, V, A> {
74+
impl<K: Debug, V: Debug, A: Allocator + Clone> Debug for RustcEntry<'_, K, V, A> {
7575
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7676
match *self {
7777
Vacant(ref v) => f.debug_tuple("Entry").field(v).finish(),
@@ -86,7 +86,7 @@ impl<K: Debug, V: Debug, A: AllocRef + Clone> Debug for RustcEntry<'_, K, V, A>
8686
/// [`RustcEntry`]: enum.RustcEntry.html
8787
pub struct RustcOccupiedEntry<'a, K, V, A = Global>
8888
where
89-
A: AllocRef + Clone,
89+
A: Allocator + Clone,
9090
{
9191
key: Option<K>,
9292
elem: Bucket<(K, V)>,
@@ -97,18 +97,18 @@ unsafe impl<K, V, A> Send for RustcOccupiedEntry<'_, K, V, A>
9797
where
9898
K: Send,
9999
V: Send,
100-
A: AllocRef + Clone + Send,
100+
A: Allocator + Clone + Send,
101101
{
102102
}
103103
unsafe impl<K, V, A> Sync for RustcOccupiedEntry<'_, K, V, A>
104104
where
105105
K: Sync,
106106
V: Sync,
107-
A: AllocRef + Clone + Sync,
107+
A: Allocator + Clone + Sync,
108108
{
109109
}
110110

111-
impl<K: Debug, V: Debug, A: AllocRef + Clone> Debug for RustcOccupiedEntry<'_, K, V, A> {
111+
impl<K: Debug, V: Debug, A: Allocator + Clone> Debug for RustcOccupiedEntry<'_, K, V, A> {
112112
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
113113
f.debug_struct("OccupiedEntry")
114114
.field("key", self.key())
@@ -123,20 +123,20 @@ impl<K: Debug, V: Debug, A: AllocRef + Clone> Debug for RustcOccupiedEntry<'_, K
123123
/// [`RustcEntry`]: enum.RustcEntry.html
124124
pub struct RustcVacantEntry<'a, K, V, A = Global>
125125
where
126-
A: AllocRef + Clone,
126+
A: Allocator + Clone,
127127
{
128128
hash: u64,
129129
key: K,
130130
table: &'a mut RawTable<(K, V), A>,
131131
}
132132

133-
impl<K: Debug, V, A: AllocRef + Clone> Debug for RustcVacantEntry<'_, K, V, A> {
133+
impl<K: Debug, V, A: Allocator + Clone> Debug for RustcVacantEntry<'_, K, V, A> {
134134
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
135135
f.debug_tuple("VacantEntry").field(self.key()).finish()
136136
}
137137
}
138138

139-
impl<'a, K, V, A: AllocRef + Clone> RustcEntry<'a, K, V, A> {
139+
impl<'a, K, V, A: Allocator + Clone> RustcEntry<'a, K, V, A> {
140140
/// Sets the value of the entry, and returns a RustcOccupiedEntry.
141141
///
142142
/// # Examples
@@ -265,7 +265,7 @@ impl<'a, K, V, A: AllocRef + Clone> RustcEntry<'a, K, V, A> {
265265
}
266266
}
267267

268-
impl<'a, K, V: Default, A: AllocRef + Clone> RustcEntry<'a, K, V, A> {
268+
impl<'a, K, V: Default, A: Allocator + Clone> RustcEntry<'a, K, V, A> {
269269
/// Ensures a value is in the entry by inserting the default value if empty,
270270
/// and returns a mutable reference to the value in the entry.
271271
///
@@ -293,7 +293,7 @@ impl<'a, K, V: Default, A: AllocRef + Clone> RustcEntry<'a, K, V, A> {
293293
}
294294
}
295295

296-
impl<'a, K, V, A: AllocRef + Clone> RustcOccupiedEntry<'a, K, V, A> {
296+
impl<'a, K, V, A: Allocator + Clone> RustcOccupiedEntry<'a, K, V, A> {
297297
/// Gets a reference to the key in the entry.
298298
///
299299
/// # Examples
@@ -520,7 +520,7 @@ impl<'a, K, V, A: AllocRef + Clone> RustcOccupiedEntry<'a, K, V, A> {
520520
}
521521
}
522522

523-
impl<'a, K, V, A: AllocRef + Clone> RustcVacantEntry<'a, K, V, A> {
523+
impl<'a, K, V, A: Allocator + Clone> RustcVacantEntry<'a, K, V, A> {
524524
/// Gets a reference to the key that would be used when inserting a value
525525
/// through the `RustcVacantEntry`.
526526
///

‎src/set.rs

Lines changed: 60 additions & 58 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.