@@ -19,6 +19,7 @@ impl<T> PartialDrop for [MaybeUninit<T>] {
19
19
}
20
20
}
21
21
impl < T , const N : usize > PartialDrop for [ MaybeUninit < T > ; N ] {
22
+ #[ inline]
22
23
unsafe fn partial_drop ( & mut self , alive : IndexRange ) {
23
24
let slice: & mut [ MaybeUninit < T > ] = self ;
24
25
// SAFETY: Initialized elements in the array are also initialized in the slice.
@@ -124,7 +125,6 @@ impl<T: Clone, const N: usize> Clone for PolymorphicIter<[MaybeUninit<T>; N]> {
124
125
}
125
126
126
127
impl < T > PolymorphicIter < [ MaybeUninit < T > ] > {
127
- #[ inline]
128
128
pub ( super ) fn as_slice ( & self ) -> & [ T ] {
129
129
// SAFETY: We know that all elements within `alive` are properly initialized.
130
130
unsafe {
@@ -133,7 +133,6 @@ impl<T> PolymorphicIter<[MaybeUninit<T>]> {
133
133
}
134
134
}
135
135
136
- #[ inline]
137
136
pub ( super ) fn as_mut_slice ( & mut self ) -> & mut [ T ] {
138
137
// SAFETY: We know that all elements within `alive` are properly initialized.
139
138
unsafe {
@@ -157,7 +156,6 @@ impl<T: fmt::Debug> fmt::Debug for PolymorphicIter<[MaybeUninit<T>]> {
157
156
/// We don't implement the actual iterator traits because we want to implement
158
157
/// things like `try_fold` that require `Self: Sized` (which we're not).
159
158
impl < T > PolymorphicIter < [ MaybeUninit < T > ] > {
160
- #[ inline]
161
159
pub ( super ) fn next ( & mut self ) -> Option < T > {
162
160
// Get the next index from the front.
163
161
//
@@ -175,13 +173,11 @@ impl<T> PolymorphicIter<[MaybeUninit<T>]> {
175
173
} )
176
174
}
177
175
178
- #[ inline]
179
176
pub ( super ) fn size_hint ( & self ) -> ( usize , Option < usize > ) {
180
177
let len = self . len ( ) ;
181
178
( len, Some ( len) )
182
179
}
183
180
184
- #[ inline]
185
181
pub ( super ) fn advance_by ( & mut self , n : usize ) -> Result < ( ) , NonZero < usize > > {
186
182
// This also moves the start, which marks them as conceptually "dropped",
187
183
// so if anything goes bad then our drop impl won't double-free them.
@@ -197,12 +193,10 @@ impl<T> PolymorphicIter<[MaybeUninit<T>]> {
197
193
NonZero :: new ( remaining) . map_or ( Ok ( ( ) ) , Err )
198
194
}
199
195
200
- #[ inline]
201
196
pub ( super ) fn fold < B > ( & mut self , init : B , f : impl FnMut ( B , T ) -> B ) -> B {
202
197
self . try_fold ( init, NeverShortCircuit :: wrap_mut_2 ( f) ) . 0
203
198
}
204
199
205
- #[ inline]
206
200
pub ( super ) fn try_fold < B , F , R > ( & mut self , init : B , mut f : F ) -> R
207
201
where
208
202
F : FnMut ( B , T ) -> R ,
@@ -221,7 +215,6 @@ impl<T> PolymorphicIter<[MaybeUninit<T>]> {
221
215
} )
222
216
}
223
217
224
- #[ inline]
225
218
pub ( super ) fn next_back ( & mut self ) -> Option < T > {
226
219
// Get the next index from the back.
227
220
//
@@ -239,7 +232,6 @@ impl<T> PolymorphicIter<[MaybeUninit<T>]> {
239
232
} )
240
233
}
241
234
242
- #[ inline]
243
235
pub ( super ) fn advance_back_by ( & mut self , n : usize ) -> Result < ( ) , NonZero < usize > > {
244
236
// This also moves the end, which marks them as conceptually "dropped",
245
237
// so if anything goes bad then our drop impl won't double-free them.
@@ -255,12 +247,10 @@ impl<T> PolymorphicIter<[MaybeUninit<T>]> {
255
247
NonZero :: new ( remaining) . map_or ( Ok ( ( ) ) , Err )
256
248
}
257
249
258
- #[ inline]
259
250
pub ( super ) fn rfold < B > ( & mut self , init : B , f : impl FnMut ( B , T ) -> B ) -> B {
260
251
self . try_rfold ( init, NeverShortCircuit :: wrap_mut_2 ( f) ) . 0
261
252
}
262
253
263
- #[ inline]
264
254
pub ( super ) fn try_rfold < B , F , R > ( & mut self , init : B , mut f : F ) -> R
265
255
where
266
256
F : FnMut ( B , T ) -> R ,
0 commit comments