about summary refs log tree commit diff
path: root/library/std
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-12-05 12:53:01 +0000
committerbors <bors@rust-lang.org>2021-12-05 12:53:01 +0000
commit1597728ef5820d3ffcb9d3f0c890ef7802398751 (patch)
tree1a86c2a2cb56d502776e6cc3936ec683efb62ffb /library/std
parentcafc4582e66c478b6b297ae85b225c788106015e (diff)
parent27d39357b7052d96e1b3903518841d14534c38cf (diff)
downloadrust-1597728ef5820d3ffcb9d3f0c890ef7802398751.tar.gz
rust-1597728ef5820d3ffcb9d3f0c890ef7802398751.zip
Auto merge of #88611 - m-ou-se:array-into-iter-new-deprecate, r=joshtriplett
Deprecate array::IntoIter::new.
Diffstat (limited to 'library/std')
-rw-r--r--library/std/src/collections/hash/map.rs2
-rw-r--r--library/std/src/collections/hash/set.rs2
-rw-r--r--library/std/src/primitive_docs.rs3
3 files changed, 3 insertions, 4 deletions
diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs
index 12246b5173d..ce34e235f5d 100644
--- a/library/std/src/collections/hash/map.rs
+++ b/library/std/src/collections/hash/map.rs
@@ -1186,7 +1186,7 @@ where
     /// assert_eq!(map1, map2);
     /// ```
     fn from(arr: [(K, V); N]) -> Self {
-        crate::array::IntoIter::new(arr).collect()
+        Self::from_iter(arr)
     }
 }
 
diff --git a/library/std/src/collections/hash/set.rs b/library/std/src/collections/hash/set.rs
index 1fc1d39b181..3f264ee6732 100644
--- a/library/std/src/collections/hash/set.rs
+++ b/library/std/src/collections/hash/set.rs
@@ -1022,7 +1022,7 @@ where
     /// assert_eq!(set1, set2);
     /// ```
     fn from(arr: [T; N]) -> Self {
-        crate::array::IntoIter::new(arr).collect()
+        Self::from_iter(arr)
     }
 }
 
diff --git a/library/std/src/primitive_docs.rs b/library/std/src/primitive_docs.rs
index f47a30c9b5d..8fcd8cdeb10 100644
--- a/library/std/src/primitive_docs.rs
+++ b/library/std/src/primitive_docs.rs
@@ -606,8 +606,7 @@ mod prim_pointer {}
 ///     println!("array[{}] = {}", i, x);
 /// }
 ///
-/// // You can explicitly iterate an array by value using
-/// // `IntoIterator::into_iter` or `std::array::IntoIter::new`:
+/// // You can explicitly iterate an array by value using `IntoIterator::into_iter`
 /// for item in IntoIterator::into_iter(array).enumerate() {
 ///     let (i, x): (usize, i32) = item;
 ///     println!("array[{}] = {}", i, x);