diff --git a/src/libcollections/binary_heap.rs b/src/libcollections/binary_heap.rs index b9d90c358fe..fa1c2b7d2aa 100644 --- a/src/libcollections/binary_heap.rs +++ b/src/libcollections/binary_heap.rs @@ -228,7 +228,7 @@ pub struct PeekMut<'a, T: 'a + Ord> { sift: bool, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[stable(feature = "collection_debug", since = "1.17.0")] impl<'a, T: Ord + fmt::Debug> fmt::Debug for PeekMut<'a, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_tuple("PeekMut") @@ -977,10 +977,10 @@ pub struct Iter<'a, T: 'a> { iter: slice::Iter<'a, T>, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[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("BinaryHeap::Iter") + f.debug_tuple("Iter") .field(&self.iter.as_slice()) .finish() } @@ -1034,10 +1034,10 @@ pub struct IntoIter { iter: vec::IntoIter, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[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("BinaryHeap::IntoIter") + f.debug_tuple("IntoIter") .field(&self.iter.as_slice()) .finish() } @@ -1078,19 +1078,11 @@ impl FusedIterator for IntoIter {} /// An iterator that drains a `BinaryHeap`. #[stable(feature = "drain", since = "1.6.0")] +#[derive(Debug)] pub struct Drain<'a, T: 'a> { iter: vec::Drain<'a, T>, } -#[stable(feature = "collection_debug", since = "1.15.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("BinaryHeap::Drain") - .field(&self.iter) - .finish() - } -} - #[stable(feature = "drain", since = "1.6.0")] impl<'a, T: 'a> Iterator for Drain<'a, T> { type Item = T; @@ -1236,11 +1228,13 @@ where T: Clone + Ord { place: vec::PlaceBack<'a, T>, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[unstable(feature = "collection_placement", + reason = "placement protocol is subject to change", + issue = "30172")] impl<'a, T: Clone + Ord + fmt::Debug> fmt::Debug for BinaryHeapPlace<'a, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_tuple("BinaryHeapPlace") - .field(&self) + .field(&self.place) .finish() } } diff --git a/src/libcollections/btree/map.rs b/src/libcollections/btree/map.rs index eb6a8ea26a3..e1fabe2cc49 100644 --- a/src/libcollections/btree/map.rs +++ b/src/libcollections/btree/map.rs @@ -270,7 +270,7 @@ pub struct Iter<'a, K: 'a, V: 'a> { length: usize, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[stable(feature = "collection_debug", since = "1.17.0")] impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for Iter<'a, K, V> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_list().entries(self.clone()).finish() @@ -279,18 +279,12 @@ impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for Iter<'a, K, V> { /// A mutable iterator over a BTreeMap's entries. #[stable(feature = "rust1", since = "1.0.0")] +#[derive(Debug)] pub struct IterMut<'a, K: 'a, V: 'a> { range: RangeMut<'a, K, V>, length: usize, } -#[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for IterMut<'a, K, V> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad(&format!("BTreeMap::IterMut({:?})", self.range)) - } -} - /// An owning iterator over a BTreeMap's entries. #[stable(feature = "rust1", since = "1.0.0")] pub struct IntoIter { @@ -299,7 +293,7 @@ pub struct IntoIter { length: usize, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[stable(feature = "collection_debug", since = "1.17.0")] impl fmt::Debug for IntoIter { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let range = Range { @@ -316,7 +310,7 @@ pub struct Keys<'a, K: 'a, V: 'a> { inner: Iter<'a, K, V>, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[stable(feature = "collection_debug", since = "1.17.0")] impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for Keys<'a, K, V> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_list().entries(self.inner.clone()).finish() @@ -329,7 +323,7 @@ pub struct Values<'a, K: 'a, V: 'a> { inner: Iter<'a, K, V>, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[stable(feature = "collection_debug", since = "1.17.0")] impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for Values<'a, K, V> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_list().entries(self.inner.clone()).finish() @@ -338,24 +332,18 @@ impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for Values<'a, K, V> /// A mutable iterator over a BTreeMap's values. #[stable(feature = "map_values_mut", since = "1.10.0")] +#[derive(Debug)] pub struct ValuesMut<'a, K: 'a, V: 'a> { inner: IterMut<'a, K, V>, } -#[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for ValuesMut<'a, K, V> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad(&format!("BTreeMap::ValuesMut({:?})", self.inner)) - } -} - /// An iterator over a sub-range of BTreeMap's entries. pub struct Range<'a, K: 'a, V: 'a> { front: Handle, K, V, marker::Leaf>, marker::Edge>, back: Handle, K, V, marker::Leaf>, marker::Edge>, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[stable(feature = "collection_debug", since = "1.17.0")] impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for Range<'a, K, V> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_list().entries(self.clone()).finish() @@ -371,7 +359,7 @@ pub struct RangeMut<'a, K: 'a, V: 'a> { _marker: PhantomData<&'a mut (K, V)>, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[stable(feature = "collection_debug", since = "1.17.0")] impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for RangeMut<'a, K, V> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let range = Range { diff --git a/src/libcollections/btree/set.rs b/src/libcollections/btree/set.rs index f90d0df768b..bfffa0b8efa 100644 --- a/src/libcollections/btree/set.rs +++ b/src/libcollections/btree/set.rs @@ -85,10 +85,10 @@ pub struct Iter<'a, T: 'a> { iter: Keys<'a, T, ()>, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[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("BTreeSet::Iter") + f.debug_tuple("Iter") .field(&self.iter.clone()) .finish() } @@ -101,34 +101,22 @@ impl<'a, T: 'a + fmt::Debug> fmt::Debug for Iter<'a, T> { /// /// [`BTreeSet`]: struct.BTreeSet.html #[stable(feature = "rust1", since = "1.0.0")] +#[derive(Debug)] pub struct IntoIter { iter: ::btree_map::IntoIter, } -#[stable(feature = "collection_debug", since = "1.15.0")] -impl fmt::Debug for IntoIter { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad(&format!("BTreeSet::IntoIter({:?})", self.iter)) - } -} - /// An iterator over a sub-range of `BTreeSet`'s items. /// /// This structure is created by the [`range`] method on [`BTreeSet`]. /// /// [`BTreeSet`]: struct.BTreeSet.html /// [`range`]: struct.BTreeSet.html#method.range +#[derive(Debug)] pub struct Range<'a, T: 'a> { iter: ::btree_map::Range<'a, T, ()>, } -#[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: 'a + fmt::Debug> fmt::Debug for Range<'a, T> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad(&format!("BTreeSet::Range({:?})", self.iter)) - } -} - /// A lazy iterator producing elements in the set difference (in-order). /// /// This structure is created by the [`difference`] method on [`BTreeSet`]. @@ -141,10 +129,10 @@ pub struct Difference<'a, T: 'a> { b: Peekable>, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[stable(feature = "collection_debug", since = "1.17.0")] impl<'a, T: 'a + fmt::Debug> fmt::Debug for Difference<'a, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_tuple("BTreeSet::Difference") + f.debug_tuple("Difference") .field(&self.clone()) .finish() } @@ -163,10 +151,10 @@ pub struct SymmetricDifference<'a, T: 'a> { b: Peekable>, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[stable(feature = "collection_debug", since = "1.17.0")] impl<'a, T: 'a + fmt::Debug> fmt::Debug for SymmetricDifference<'a, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_tuple("BTreeSet::SymmetricDifference") + f.debug_tuple("SymmetricDifference") .field(&self.clone()) .finish() } @@ -184,10 +172,10 @@ pub struct Intersection<'a, T: 'a> { b: Peekable>, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[stable(feature = "collection_debug", since = "1.17.0")] impl<'a, T: 'a + fmt::Debug> fmt::Debug for Intersection<'a, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_tuple("BTreeSet::Intersection") + f.debug_tuple("Intersection") .field(&self.clone()) .finish() } @@ -205,10 +193,10 @@ pub struct Union<'a, T: 'a> { b: Peekable>, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[stable(feature = "collection_debug", since = "1.17.0")] impl<'a, T: 'a + fmt::Debug> fmt::Debug for Union<'a, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_tuple("BTreeSet::Union") + f.debug_tuple("Union") .field(&self.clone()) .finish() } diff --git a/src/libcollections/enum_set.rs b/src/libcollections/enum_set.rs index e4498c17617..9bbb1013643 100644 --- a/src/libcollections/enum_set.rs +++ b/src/libcollections/enum_set.rs @@ -220,10 +220,9 @@ pub struct Iter { marker: marker::PhantomData, } -#[stable(feature = "collection_debug", since = "1.15.0")] impl fmt::Debug for Iter { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_tuple("EnumSet::Iter") + f.debug_tuple("Iter") .field(&self.clone()) .finish() } diff --git a/src/libcollections/linked_list.rs b/src/libcollections/linked_list.rs index 21be9ac1aab..d4f77d625b3 100644 --- a/src/libcollections/linked_list.rs +++ b/src/libcollections/linked_list.rs @@ -65,10 +65,10 @@ pub struct Iter<'a, T: 'a> { marker: PhantomData<&'a Node>, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[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("LinkedList::Iter") + f.debug_tuple("Iter") .field(&self.clone()) .finish() } @@ -91,10 +91,10 @@ pub struct IterMut<'a, T: 'a> { len: usize, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[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("LinkedList::IterMut") + f.debug_tuple("IterMut") .field(self.clone()) .finish() } @@ -107,10 +107,10 @@ pub struct IntoIter { list: LinkedList, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[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("LinkedList::IntoIter") + f.debug_tuple("IntoIter") .field(self.clone()) .finish() } @@ -1104,10 +1104,12 @@ pub struct FrontPlace<'a, T: 'a> { node: IntermediateBox>, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[unstable(feature = "collection_placement", + reason = "struct name and placement protocol are subject to change", + issue = "30172")] impl<'a, T: 'a + fmt::Debug> fmt::Debug for FrontPlace<'a, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_tuple("LinkedList::FrontPlace") + f.debug_tuple("FrontPlace") .field(self.clone()) .finish() } @@ -1157,10 +1159,12 @@ pub struct BackPlace<'a, T: 'a> { node: IntermediateBox>, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[unstable(feature = "collection_placement", + reason = "struct name and placement protocol are subject to change", + issue = "30172")] impl<'a, T: 'a + fmt::Debug> fmt::Debug for BackPlace<'a, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_tuple("LinkedList::BackPlace") + f.debug_tuple("BackPlace") .field(self.clone()) .finish() } diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 8dbddbb41d7..da5e8d03ea8 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -123,7 +123,7 @@ pub struct EncodeUtf16<'a> { encoder: Utf16Encoder>, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[stable(feature = "collection_debug", since = "1.17.0")] impl<'a> fmt::Debug for EncodeUtf16<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.pad("EncodeUtf16 { .. }") diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 1a9849f2352..15a533d6d87 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -1979,10 +1979,10 @@ pub struct Drain<'a> { iter: Chars<'a>, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[stable(feature = "collection_debug", since = "1.17.0")] impl<'a> fmt::Debug for Drain<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("String::Drain { .. }") + f.pad("Drain { .. }") } } diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 2b6343782b1..97ce404a11f 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -2092,10 +2092,10 @@ pub struct Drain<'a, T: 'a> { vec: Shared>, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[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("Vec::Drain") + f.debug_tuple("Drain") .field(&self.iter.as_slice()) .finish() } @@ -2167,19 +2167,11 @@ impl<'a, T> FusedIterator for Drain<'a, T> {} #[unstable(feature = "collection_placement", reason = "struct name and placement protocol are subject to change", issue = "30172")] +#[derive(Debug)] pub struct PlaceBack<'a, T: 'a> { vec: &'a mut Vec, } -#[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: 'a + fmt::Debug> fmt::Debug for PlaceBack<'a, T> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_tuple("Vec::PlaceBack") - .field(&self.vec.as_slice()) - .finish() - } -} - #[unstable(feature = "collection_placement", reason = "placement protocol is subject to change", issue = "30172")] diff --git a/src/libcollections/vec_deque.rs b/src/libcollections/vec_deque.rs index 11aacb0ff43..a88a70888c5 100644 --- a/src/libcollections/vec_deque.rs +++ b/src/libcollections/vec_deque.rs @@ -1866,10 +1866,10 @@ pub struct Iter<'a, T: 'a> { head: usize, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[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("VecDeque::Iter") + f.debug_tuple("Iter") .field(&self.clone()) .finish() } @@ -1947,10 +1947,10 @@ pub struct IterMut<'a, T: 'a> { head: usize, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[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("VecDeque::IterMut") + f.debug_tuple("IterMut") .field(&self.clone()) .finish() } @@ -2022,10 +2022,10 @@ pub struct IntoIter { inner: VecDeque, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[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("VecDeque::IntoIter") + f.debug_tuple("IntoIter") .field(&self.clone()) .finish() } @@ -2074,10 +2074,10 @@ pub struct Drain<'a, T: 'a> { deque: Shared>, } -#[stable(feature = "collection_debug", since = "1.15.0")] +#[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("VecDeque::Drain") + f.debug_tuple("Drain") .field(&self.clone()) .finish() }