about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThe 8472 <git@infinite-source.de>2022-03-22 00:02:54 +0100
committerThe 8472 <git@infinite-source.de>2022-03-22 00:02:54 +0100
commit7549cfa599004715a57fa17f8a988c216e0f6f4e (patch)
treeb5048e0ed0edac991b94bcf0e146e275dc533728
parenta1a602adde806fb63853f705d8c98884e991545b (diff)
downloadrust-7549cfa599004715a57fa17f8a988c216e0f6f4e.tar.gz
rust-7549cfa599004715a57fa17f8a988c216e0f6f4e.zip
rename internal helper trait AsIntoIter to AsVecIntoIter
-rw-r--r--library/alloc/src/collections/binary_heap.rs4
-rw-r--r--library/alloc/src/vec/in_place_collect.rs10
-rw-r--r--library/alloc/src/vec/into_iter.rs4
-rw-r--r--library/alloc/src/vec/mod.rs2
4 files changed, 10 insertions, 10 deletions
diff --git a/library/alloc/src/collections/binary_heap.rs b/library/alloc/src/collections/binary_heap.rs
index 2ab52a4d584..ef5bef0253a 100644
--- a/library/alloc/src/collections/binary_heap.rs
+++ b/library/alloc/src/collections/binary_heap.rs
@@ -151,7 +151,7 @@ use core::ptr;
 
 use crate::collections::TryReserveError;
 use crate::slice;
-use crate::vec::{self, AsIntoIter, Vec};
+use crate::vec::{self, AsVecIntoIter, Vec};
 
 use super::SpecExtend;
 
@@ -1418,7 +1418,7 @@ unsafe impl<T> SourceIter for IntoIter<T> {
 #[doc(hidden)]
 unsafe impl<I> InPlaceIterable for IntoIter<I> {}
 
-unsafe impl<I> AsIntoIter for IntoIter<I> {
+unsafe impl<I> AsVecIntoIter for IntoIter<I> {
     type Item = I;
 
     fn as_into_iter(&mut self) -> &mut vec::IntoIter<Self::Item> {
diff --git a/library/alloc/src/vec/in_place_collect.rs b/library/alloc/src/vec/in_place_collect.rs
index 59f7cc6b004..6dc548fc8e9 100644
--- a/library/alloc/src/vec/in_place_collect.rs
+++ b/library/alloc/src/vec/in_place_collect.rs
@@ -16,7 +16,7 @@
 //! `FromIterator` implementation benefit from this too.
 //!
 //! Access to the underlying source goes through a further layer of indirection via the private
-//! trait [`AsIntoIter`] to hide the implementation detail that other collections may use
+//! trait [`AsVecIntoIter`] to hide the implementation detail that other collections may use
 //! `vec::IntoIter` internally.
 //!
 //! In-place iteration depends on the interaction of several unsafe traits, implementation
@@ -142,16 +142,16 @@ impl<T> InPlaceIterableMarker for T where T: InPlaceIterable {}
 
 impl<T, I> SpecFromIter<T, I> for Vec<T>
 where
-    I: Iterator<Item = T> + SourceIter<Source: AsIntoIter> + InPlaceIterableMarker,
+    I: Iterator<Item = T> + SourceIter<Source: AsVecIntoIter> + InPlaceIterableMarker,
 {
     default fn from_iter(mut iterator: I) -> Self {
         // See "Layout constraints" section in the module documentation. We rely on const
         // optimization here since these conditions currently cannot be expressed as trait bounds
         if mem::size_of::<T>() == 0
             || mem::size_of::<T>()
-                != mem::size_of::<<<I as SourceIter>::Source as AsIntoIter>::Item>()
+                != mem::size_of::<<<I as SourceIter>::Source as AsVecIntoIter>::Item>()
             || mem::align_of::<T>()
-                != mem::align_of::<<<I as SourceIter>::Source as AsIntoIter>::Item>()
+                != mem::align_of::<<<I as SourceIter>::Source as AsVecIntoIter>::Item>()
         {
             // fallback to more generic implementations
             return SpecFromIterNested::from_iter(iterator);
@@ -289,7 +289,7 @@ where
 /// In-place iteration relies on implementation details of `vec::IntoIter`, most importantly that
 /// it does not create references to the whole allocation during iteration, only raw pointers
 #[rustc_specialization_trait]
-pub(crate) unsafe trait AsIntoIter {
+pub(crate) unsafe trait AsVecIntoIter {
     type Item;
     fn as_into_iter(&mut self) -> &mut super::IntoIter<Self::Item>;
 }
diff --git a/library/alloc/src/vec/into_iter.rs b/library/alloc/src/vec/into_iter.rs
index f80d22d6bdb..f17b8d71b3a 100644
--- a/library/alloc/src/vec/into_iter.rs
+++ b/library/alloc/src/vec/into_iter.rs
@@ -1,5 +1,5 @@
 #[cfg(not(no_global_oom_handling))]
-use super::AsIntoIter;
+use super::AsVecIntoIter;
 use crate::alloc::{Allocator, Global};
 use crate::raw_vec::RawVec;
 use core::fmt;
@@ -346,7 +346,7 @@ unsafe impl<T, A: Allocator> SourceIter for IntoIter<T, A> {
 }
 
 #[cfg(not(no_global_oom_handling))]
-unsafe impl<T> AsIntoIter for IntoIter<T> {
+unsafe impl<T> AsVecIntoIter for IntoIter<T> {
     type Item = T;
 
     fn as_into_iter(&mut self) -> &mut IntoIter<Self::Item> {
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index 0b305b49d51..9a66e69bdc0 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -96,7 +96,7 @@ mod drain;
 mod cow;
 
 #[cfg(not(no_global_oom_handling))]
-pub(crate) use self::in_place_collect::AsIntoIter;
+pub(crate) use self::in_place_collect::AsVecIntoIter;
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use self::into_iter::IntoIter;