]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_index/src/vec.rs
Rollup merge of #100630 - Enselic:export_extern_crate_as_self, r=GuillaumeGomez
[rust.git] / compiler / rustc_index / src / vec.rs
index 1a55519d7b120f21ba24c9b6b4d801df74de1499..4172ce3bb306a22add12777d422cf05834e58ef4 100644 (file)
@@ -172,7 +172,9 @@ pub fn iter_enumerated(
     }
 
     #[inline]
-    pub fn indices(&self) -> impl DoubleEndedIterator<Item = I> + ExactSizeIterator + 'static {
+    pub fn indices(
+        &self,
+    ) -> impl DoubleEndedIterator<Item = I> + ExactSizeIterator + Clone + 'static {
         (0..self.len()).map(|n| I::new(n))
     }
 
@@ -234,7 +236,9 @@ pub fn get_mut(&mut self, index: I) -> Option<&mut T> {
         self.raw.get_mut(index.index())
     }
 
-    /// Returns mutable references to two distinct elements, a and b. Panics if a == b.
+    /// Returns mutable references to two distinct elements, `a` and `b`.
+    ///
+    /// Panics if `a == b`.
     #[inline]
     pub fn pick2_mut(&mut self, a: I, b: I) -> (&mut T, &mut T) {
         let (ai, bi) = (a.index(), b.index());
@@ -249,7 +253,9 @@ pub fn pick2_mut(&mut self, a: I, b: I) -> (&mut T, &mut T) {
         }
     }
 
-    /// Returns mutable references to three distinct elements or panics otherwise.
+    /// Returns mutable references to three distinct elements.
+    ///
+    /// Panics if the elements are not distinct.
     #[inline]
     pub fn pick3_mut(&mut self, a: I, b: I, c: I) -> (&mut T, &mut T, &mut T) {
         let (ai, bi, ci) = (a.index(), b.index(), c.index());