X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibcollections%2Fvec_deque.rs;h=48a6c66db97eb6fd3e905a5822ea5b83fea8f011;hb=384ee48a1a362a3886300f974739e5579ac998cd;hp=5e1adb3d808ce1bb71cd0d38d7fdf618a9d5f589;hpb=001bfb9e566b92b9336eb210b270c9404626d89f;p=rust.git diff --git a/src/libcollections/vec_deque.rs b/src/libcollections/vec_deque.rs index 5e1adb3d808..48a6c66db97 100644 --- a/src/libcollections/vec_deque.rs +++ b/src/libcollections/vec_deque.rs @@ -1766,7 +1766,7 @@ pub fn retain(&mut self, mut f: F) impl VecDeque { /// Modifies the `VecDeque` in-place so that `len()` is equal to new_len, - /// either by removing excess elements or by appending copies of a value to the back. + /// either by removing excess elements or by appending clones of `value` to the back. /// /// # Examples /// @@ -1856,6 +1856,15 @@ pub struct Iter<'a, T: 'a> { head: usize, } +#[stable(feature = "collection_debug", since = "1.17.0")] +impl<'a, T: 'a + fmt::Debug> fmt::Debug for Iter<'a, T> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_tuple("Iter") + .field(&self.clone()) + .finish() + } +} + // FIXME(#19839) Remove in favor of `#[derive(Clone)]` #[stable(feature = "rust1", since = "1.0.0")] impl<'a, T> Clone for Iter<'a, T> { @@ -1928,6 +1937,15 @@ pub struct IterMut<'a, T: 'a> { head: usize, } +#[stable(feature = "collection_debug", since = "1.17.0")] +impl<'a, T: 'a + fmt::Debug> fmt::Debug for IterMut<'a, T> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_tuple("IterMut") + .field(&self.clone()) + .finish() + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl<'a, T> Iterator for IterMut<'a, T> { type Item = &'a mut T; @@ -1994,6 +2012,15 @@ pub struct IntoIter { inner: VecDeque, } +#[stable(feature = "collection_debug", since = "1.17.0")] +impl fmt::Debug for IntoIter { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_tuple("IntoIter") + .field(&self.clone()) + .finish() + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl Iterator for IntoIter { type Item = T; @@ -2037,6 +2064,15 @@ pub struct Drain<'a, T: 'a> { deque: Shared>, } +#[stable(feature = "collection_debug", since = "1.17.0")] +impl<'a, T: 'a + fmt::Debug> fmt::Debug for Drain<'a, T> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_tuple("Drain") + .field(&self.clone()) + .finish() + } +} + #[stable(feature = "drain", since = "1.6.0")] unsafe impl<'a, T: Sync> Sync for Drain<'a, T> {} #[stable(feature = "drain", since = "1.6.0")]