Skip to content

Commit 6ac492e

Browse files
committed
rename internal helper trait AsIntoIter to AsVecIntoIter
1 parent 27f0821 commit 6ac492e

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

alloc/src/collections/binary_heap.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ use core::ptr;
151151

152152
use crate::collections::TryReserveError;
153153
use crate::slice;
154-
use crate::vec::{self, AsIntoIter, Vec};
154+
use crate::vec::{self, AsVecIntoIter, Vec};
155155

156156
use super::SpecExtend;
157157

@@ -1418,7 +1418,7 @@ unsafe impl<T> SourceIter for IntoIter<T> {
14181418
#[doc(hidden)]
14191419
unsafe impl<I> InPlaceIterable for IntoIter<I> {}
14201420

1421-
unsafe impl<I> AsIntoIter for IntoIter<I> {
1421+
unsafe impl<I> AsVecIntoIter for IntoIter<I> {
14221422
type Item = I;
14231423

14241424
fn as_into_iter(&mut self) -> &mut vec::IntoIter<Self::Item> {

alloc/src/vec/in_place_collect.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//! `FromIterator` implementation benefit from this too.
1717
//!
1818
//! 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
2020
//! `vec::IntoIter` internally.
2121
//!
2222
//! In-place iteration depends on the interaction of several unsafe traits, implementation
@@ -142,16 +142,16 @@ impl<T> InPlaceIterableMarker for T where T: InPlaceIterable {}
142142

143143
impl<T, I> SpecFromIter<T, I> for Vec<T>
144144
where
145-
I: Iterator<Item = T> + SourceIter<Source: AsIntoIter> + InPlaceIterableMarker,
145+
I: Iterator<Item = T> + SourceIter<Source: AsVecIntoIter> + InPlaceIterableMarker,
146146
{
147147
default fn from_iter(mut iterator: I) -> Self {
148148
// See "Layout constraints" section in the module documentation. We rely on const
149149
// optimization here since these conditions currently cannot be expressed as trait bounds
150150
if mem::size_of::<T>() == 0
151151
|| 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>()
153153
|| 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>()
155155
{
156156
// fallback to more generic implementations
157157
return SpecFromIterNested::from_iter(iterator);
@@ -289,7 +289,7 @@ where
289289
/// In-place iteration relies on implementation details of `vec::IntoIter`, most importantly that
290290
/// it does not create references to the whole allocation during iteration, only raw pointers
291291
#[rustc_specialization_trait]
292-
pub(crate) unsafe trait AsIntoIter {
292+
pub(crate) unsafe trait AsVecIntoIter {
293293
type Item;
294294
fn as_into_iter(&mut self) -> &mut super::IntoIter<Self::Item>;
295295
}

alloc/src/vec/into_iter.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[cfg(not(no_global_oom_handling))]
2-
use super::AsIntoIter;
2+
use super::AsVecIntoIter;
33
use crate::alloc::{Allocator, Global};
44
use crate::raw_vec::RawVec;
55
use core::fmt;
@@ -346,7 +346,7 @@ unsafe impl<T, A: Allocator> SourceIter for IntoIter<T, A> {
346346
}
347347

348348
#[cfg(not(no_global_oom_handling))]
349-
unsafe impl<T> AsIntoIter for IntoIter<T> {
349+
unsafe impl<T> AsVecIntoIter for IntoIter<T> {
350350
type Item = T;
351351

352352
fn as_into_iter(&mut self) -> &mut IntoIter<Self::Item> {

alloc/src/vec/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ mod drain;
9696
mod cow;
9797

9898
#[cfg(not(no_global_oom_handling))]
99-
pub(crate) use self::in_place_collect::AsIntoIter;
99+
pub(crate) use self::in_place_collect::AsVecIntoIter;
100100
#[stable(feature = "rust1", since = "1.0.0")]
101101
pub use self::into_iter::IntoIter;
102102

0 commit comments

Comments
 (0)