@@ -20,13 +20,13 @@ pub struct Drain<
20
20
' a ,
21
21
T : ' a ,
22
22
#[ unstable( feature = "allocator_api" , issue = "32838" ) ] A : Allocator = Global ,
23
- const COOP_PREFERRED : bool = { SHORT_TERM_VEC_PREFERS_COOP ! ( ) } ,
23
+ const COOP_PREF : bool = { SHORT_TERM_VEC_PREFERS_COOP ! ( ) } ,
24
24
> where
25
- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
25
+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREF ) ] : ,
26
26
{
27
27
// We can't just use a &mut VecDeque<T, A>, as that would make Drain invariant over T
28
28
// and we want it to be covariant instead
29
- deque : NonNull < VecDeque < T , A , COOP_PREFERRED > > ,
29
+ deque : NonNull < VecDeque < T , A , COOP_PREF > > ,
30
30
// drain_start is stored in deque.len
31
31
drain_len : usize ,
32
32
// index into the logical array, not the physical one (always lies in [0..deque.len))
@@ -38,12 +38,12 @@ pub struct Drain<
38
38
_marker : PhantomData < & ' a T > ,
39
39
}
40
40
41
- impl < ' a , T , A : Allocator , const COOP_PREFERRED : bool > Drain < ' a , T , A , COOP_PREFERRED >
41
+ impl < ' a , T , A : Allocator , const COOP_PREF : bool > Drain < ' a , T , A , COOP_PREF >
42
42
where
43
- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
43
+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREF ) ] : ,
44
44
{
45
45
pub ( super ) unsafe fn new (
46
- deque : & ' a mut VecDeque < T , A , COOP_PREFERRED > ,
46
+ deque : & ' a mut VecDeque < T , A , COOP_PREF > ,
47
47
drain_start : usize ,
48
48
drain_len : usize ,
49
49
) -> Self {
@@ -95,10 +95,10 @@ where
95
95
}
96
96
97
97
#[ stable( feature = "collection_debug" , since = "1.17.0" ) ]
98
- impl < T : fmt:: Debug , A : Allocator , const COOP_PREFERRED : bool > fmt:: Debug
99
- for Drain < ' _ , T , A , COOP_PREFERRED >
98
+ impl < T : fmt:: Debug , A : Allocator , const COOP_PREF : bool > fmt:: Debug
99
+ for Drain < ' _ , T , A , COOP_PREF >
100
100
where
101
- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
101
+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREF ) ] : ,
102
102
{
103
103
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
104
104
f. debug_tuple ( "Drain" )
@@ -111,36 +111,36 @@ where
111
111
}
112
112
113
113
#[ stable( feature = "drain" , since = "1.6.0" ) ]
114
- unsafe impl < T : Sync , A : Allocator + Sync , const COOP_PREFERRED : bool > Sync
115
- for Drain < ' _ , T , A , COOP_PREFERRED >
114
+ unsafe impl < T : Sync , A : Allocator + Sync , const COOP_PREF : bool > Sync
115
+ for Drain < ' _ , T , A , COOP_PREF >
116
116
where
117
- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
117
+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREF ) ] : ,
118
118
{
119
119
}
120
120
#[ stable( feature = "drain" , since = "1.6.0" ) ]
121
- unsafe impl < T : Send , A : Allocator + Send , const COOP_PREFERRED : bool > Send
122
- for Drain < ' _ , T , A , COOP_PREFERRED >
121
+ unsafe impl < T : Send , A : Allocator + Send , const COOP_PREF : bool > Send
122
+ for Drain < ' _ , T , A , COOP_PREF >
123
123
where
124
- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
124
+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREF ) ] : ,
125
125
{
126
126
}
127
127
128
128
#[ stable( feature = "drain" , since = "1.6.0" ) ]
129
- impl < T , A : Allocator , const COOP_PREFERRED : bool > Drop for Drain < ' _ , T , A , COOP_PREFERRED >
129
+ impl < T , A : Allocator , const COOP_PREF : bool > Drop for Drain < ' _ , T , A , COOP_PREF >
130
130
where
131
- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
131
+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREF ) ] : ,
132
132
{
133
133
fn drop ( & mut self ) {
134
- struct DropGuard < ' r , ' a , T , A : Allocator , const COOP_PREFERRED : bool > (
135
- & ' r mut Drain < ' a , T , A , COOP_PREFERRED > ,
134
+ struct DropGuard < ' r , ' a , T , A : Allocator , const COOP_PREF : bool > (
135
+ & ' r mut Drain < ' a , T , A , COOP_PREF > ,
136
136
)
137
137
where
138
- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ;
138
+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREF ) ] : ;
139
139
140
- impl < ' r , ' a , T , A : Allocator , const COOP_PREFERRED : bool > Drop
141
- for DropGuard < ' r , ' a , T , A , COOP_PREFERRED >
140
+ impl < ' r , ' a , T , A : Allocator , const COOP_PREF : bool > Drop
141
+ for DropGuard < ' r , ' a , T , A , COOP_PREF >
142
142
where
143
- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
143
+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREF ) ] : ,
144
144
{
145
145
fn drop ( & mut self ) {
146
146
if self . 0 . remaining != 0 {
@@ -222,9 +222,9 @@ where
222
222
}
223
223
224
224
#[ stable( feature = "drain" , since = "1.6.0" ) ]
225
- impl < T , A : Allocator , const COOP_PREFERRED : bool > Iterator for Drain < ' _ , T , A , COOP_PREFERRED >
225
+ impl < T , A : Allocator , const COOP_PREF : bool > Iterator for Drain < ' _ , T , A , COOP_PREF >
226
226
where
227
- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
227
+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREF ) ] : ,
228
228
{
229
229
type Item = T ;
230
230
@@ -247,10 +247,10 @@ where
247
247
}
248
248
249
249
#[ stable( feature = "drain" , since = "1.6.0" ) ]
250
- impl < T , A : Allocator , const COOP_PREFERRED : bool > DoubleEndedIterator
251
- for Drain < ' _ , T , A , COOP_PREFERRED >
250
+ impl < T , A : Allocator , const COOP_PREF : bool > DoubleEndedIterator
251
+ for Drain < ' _ , T , A , COOP_PREF >
252
252
where
253
- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
253
+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREF ) ] : ,
254
254
{
255
255
#[ inline]
256
256
fn next_back ( & mut self ) -> Option < T > {
@@ -264,15 +264,15 @@ where
264
264
}
265
265
266
266
#[ stable( feature = "drain" , since = "1.6.0" ) ]
267
- impl < T , A : Allocator , const COOP_PREFERRED : bool > ExactSizeIterator
268
- for Drain < ' _ , T , A , COOP_PREFERRED >
267
+ impl < T , A : Allocator , const COOP_PREF : bool > ExactSizeIterator
268
+ for Drain < ' _ , T , A , COOP_PREF >
269
269
where
270
- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
270
+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREF ) ] : ,
271
271
{
272
272
}
273
273
274
274
#[ stable( feature = "fused" , since = "1.26.0" ) ]
275
- impl < T , A : Allocator , const COOP_PREFERRED : bool > FusedIterator for Drain < ' _ , T , A , COOP_PREFERRED > where
276
- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] :
275
+ impl < T , A : Allocator , const COOP_PREF : bool > FusedIterator for Drain < ' _ , T , A , COOP_PREF > where
276
+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREF ) ] :
277
277
{
278
278
}
0 commit comments