|
16 | 16 | //! `FromIterator` implementation benefit from this too.
|
17 | 17 | //!
|
18 | 18 | //! Access to the underlying source goes through a further layer of indirection via the private
|
19 |
| -//! trait [`AsIntoIter`] to hide the implementation detail that other collections may use |
| 19 | +//! trait [`AsVecIntoIter`] to hide the implementation detail that other collections may use |
20 | 20 | //! `vec::IntoIter` internally.
|
21 | 21 | //!
|
22 | 22 | //! In-place iteration depends on the interaction of several unsafe traits, implementation
|
@@ -142,16 +142,16 @@ impl<T> InPlaceIterableMarker for T where T: InPlaceIterable {}
|
142 | 142 |
|
143 | 143 | impl<T, I> SpecFromIter<T, I> for Vec<T>
|
144 | 144 | where
|
145 |
| - I: Iterator<Item = T> + SourceIter<Source: AsIntoIter> + InPlaceIterableMarker, |
| 145 | + I: Iterator<Item = T> + SourceIter<Source: AsVecIntoIter> + InPlaceIterableMarker, |
146 | 146 | {
|
147 | 147 | default fn from_iter(mut iterator: I) -> Self {
|
148 | 148 | // See "Layout constraints" section in the module documentation. We rely on const
|
149 | 149 | // optimization here since these conditions currently cannot be expressed as trait bounds
|
150 | 150 | if mem::size_of::<T>() == 0
|
151 | 151 | || mem::size_of::<T>()
|
152 |
| - != mem::size_of::<<<I as SourceIter>::Source as AsIntoIter>::Item>() |
| 152 | + != mem::size_of::<<<I as SourceIter>::Source as AsVecIntoIter>::Item>() |
153 | 153 | || mem::align_of::<T>()
|
154 |
| - != mem::align_of::<<<I as SourceIter>::Source as AsIntoIter>::Item>() |
| 154 | + != mem::align_of::<<<I as SourceIter>::Source as AsVecIntoIter>::Item>() |
155 | 155 | {
|
156 | 156 | // fallback to more generic implementations
|
157 | 157 | return SpecFromIterNested::from_iter(iterator);
|
@@ -289,7 +289,7 @@ where
|
289 | 289 | /// In-place iteration relies on implementation details of `vec::IntoIter`, most importantly that
|
290 | 290 | /// it does not create references to the whole allocation during iteration, only raw pointers
|
291 | 291 | #[rustc_specialization_trait]
|
292 |
| -pub(crate) unsafe trait AsIntoIter { |
| 292 | +pub(crate) unsafe trait AsVecIntoIter { |
293 | 293 | type Item;
|
294 | 294 | fn as_into_iter(&mut self) -> &mut super::IntoIter<Self::Item>;
|
295 | 295 | }
|
0 commit comments