@@ -172,61 +172,6 @@ where
172
172
}
173
173
}
174
174
175
- /// Marker trait for iterators/iterables which have a statically known upper
176
- /// bound of the number of items they can produce.
177
- ///
178
- /// # Safety
179
- ///
180
- /// Implementations must not yield more elements than indicated by UPPER_BOUND if it is `Some`.
181
- /// Used in specializations. Implementations must not be conditional on lifetimes or
182
- /// user-implementable traits.
183
- #[ rustc_specialization_trait]
184
- #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
185
- unsafe trait BoundedSize {
186
- const UPPER_BOUND : Option < NonZero < usize > > = NonZero :: new ( 1 ) ;
187
- }
188
-
189
- #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
190
- unsafe impl < T > BoundedSize for Option < T > { }
191
- #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
192
- unsafe impl < T > BoundedSize for option:: IntoIter < T > { }
193
- #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
194
- unsafe impl < T , U > BoundedSize for Result < T , U > { }
195
- #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
196
- unsafe impl < T > BoundedSize for result:: IntoIter < T > { }
197
- #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
198
- unsafe impl < T > BoundedSize for Once < T > { }
199
- #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
200
- unsafe impl < T > BoundedSize for OnceWith < T > { }
201
- #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
202
- unsafe impl < T , const N : usize > BoundedSize for [ T ; N ] {
203
- const UPPER_BOUND : Option < NonZero < usize > > = NonZero :: new ( N ) ;
204
- }
205
- #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
206
- unsafe impl < T , const N : usize > BoundedSize for array:: IntoIter < T , N > {
207
- const UPPER_BOUND : Option < NonZero < usize > > = NonZero :: new ( N ) ;
208
- }
209
- #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
210
- unsafe impl < I : BoundedSize , P > BoundedSize for Filter < I , P > {
211
- const UPPER_BOUND : Option < NonZero < usize > > = I :: UPPER_BOUND ;
212
- }
213
- #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
214
- unsafe impl < I : BoundedSize , P > BoundedSize for FilterMap < I , P > {
215
- const UPPER_BOUND : Option < NonZero < usize > > = I :: UPPER_BOUND ;
216
- }
217
- #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
218
- unsafe impl < I : BoundedSize , F > BoundedSize for Map < I , F > {
219
- const UPPER_BOUND : Option < NonZero < usize > > = I :: UPPER_BOUND ;
220
- }
221
- #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
222
- unsafe impl < I : BoundedSize > BoundedSize for Copied < I > {
223
- const UPPER_BOUND : Option < NonZero < usize > > = I :: UPPER_BOUND ;
224
- }
225
- #[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
226
- unsafe impl < I : BoundedSize > BoundedSize for Cloned < I > {
227
- const UPPER_BOUND : Option < NonZero < usize > > = I :: UPPER_BOUND ;
228
- }
229
-
230
175
/// An iterator that flattens one level of nesting in an iterator of things
231
176
/// that can be turned into iterators.
232
177
///
0 commit comments