diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2017-01-20 13:05:02 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2017-01-20 21:48:35 +0100 |
| commit | ba841f056e888549ef0bec0f79262ae65444d0fd (patch) | |
| tree | 3d1d0f1a3be0e92b3afe8c3fc048d34ecdbc3f6e | |
| parent | 61fbdbba41163b6fd327b166338a8feb89133444 (diff) | |
| download | rust-ba841f056e888549ef0bec0f79262ae65444d0fd.tar.gz rust-ba841f056e888549ef0bec0f79262ae65444d0fd.zip | |
Remove Debug implementations specialization
| -rw-r--r-- | src/libcollections/binary_heap.rs | 36 | ||||
| -rw-r--r-- | src/libcollections/btree/map.rs | 56 | ||||
| -rw-r--r-- | src/libcollections/btree/set.rs | 49 | ||||
| -rw-r--r-- | src/libcollections/enum_set.rs | 7 | ||||
| -rw-r--r-- | src/libcollections/linked_list.rs | 35 | ||||
| -rw-r--r-- | src/libcollections/vec.rs | 14 | ||||
| -rw-r--r-- | src/libcollections/vec_deque.rs | 28 |
7 files changed, 6 insertions, 219 deletions
diff --git a/src/libcollections/binary_heap.rs b/src/libcollections/binary_heap.rs index fca3b7b07dd..93b864a007f 100644 --- a/src/libcollections/binary_heap.rs +++ b/src/libcollections/binary_heap.rs @@ -229,16 +229,11 @@ pub struct PeekMut<'a, T: 'a + Ord> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: Ord> fmt::Debug for PeekMut<'a, T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("PeekMut { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.0")] impl<'a, T: Ord + fmt::Debug> fmt::Debug for PeekMut<'a, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad(&format!("PeekMut({:?})", self.heap.data[0])) + f.debug_tuple("PeekMut") + .field(&self.heap.data[0]) + .finish() } } @@ -983,13 +978,6 @@ pub struct Iter<'a, T: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: 'a> fmt::Debug for Iter<'a, T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("BinaryHeap::Iter { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.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") @@ -1047,13 +1035,6 @@ pub struct IntoIter<T> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<T> fmt::Debug for IntoIter<T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("BinaryHeap::IntoIter { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.0")] impl<T: fmt::Debug> fmt::Debug for IntoIter<T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_tuple("BinaryHeap::IntoIter") @@ -1102,16 +1083,11 @@ pub struct Drain<'a, T: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: 'a> fmt::Debug for Drain<'a, T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("BinaryHeap::Drain { .. }") - } -} - -#[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.pad(&format!("BinaryHeap::Drain({:?})", self.iter)) + f.debug_tuple("BinaryHeap::Drain") + .field(&self.iter) + .finish() } } diff --git a/src/libcollections/btree/map.rs b/src/libcollections/btree/map.rs index 0d8b9d4677b..eb6a8ea26a3 100644 --- a/src/libcollections/btree/map.rs +++ b/src/libcollections/btree/map.rs @@ -271,13 +271,6 @@ pub struct Iter<'a, K: 'a, V: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, K: 'a, V: 'a> fmt::Debug for Iter<'a, K, V> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("BTreeMap::Iter { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.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() @@ -292,13 +285,6 @@ pub struct IterMut<'a, K: 'a, V: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, K: 'a, V: 'a> fmt::Debug for IterMut<'a, K, V> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("BTreeMap::IterMut { .. }") - } -} - -#[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)) @@ -314,13 +300,6 @@ pub struct IntoIter<K, V> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<K, V> fmt::Debug for IntoIter<K, V> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("BTreeMap::IntoIter { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.0")] impl<K: fmt::Debug, V: fmt::Debug> fmt::Debug for IntoIter<K, V> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let range = Range { @@ -338,13 +317,6 @@ pub struct Keys<'a, K: 'a, V: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, K: 'a, V: 'a> fmt::Debug for Keys<'a, K, V> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("BTreeMap::Keys { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.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() @@ -358,13 +330,6 @@ pub struct Values<'a, K: 'a, V: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, K: 'a, V: 'a> fmt::Debug for Values<'a, K, V> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("BTreeMap::Values { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.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() @@ -378,13 +343,6 @@ pub struct ValuesMut<'a, K: 'a, V: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, K: 'a, V: 'a> fmt::Debug for ValuesMut<'a, K, V> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("BTreeMap::ValuesMut { .. }") - } -} - -#[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)) @@ -398,13 +356,6 @@ pub struct Range<'a, K: 'a, V: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, K: 'a, V: 'a> fmt::Debug for Range<'a, K, V> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("BTreeMap::Range { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.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() @@ -421,13 +372,6 @@ pub struct RangeMut<'a, K: 'a, V: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, K: 'a, V: 'a> fmt::Debug for RangeMut<'a, K, V> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("BTreeMap::RangeMut { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.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 d9effde7204..f90d0df768b 100644 --- a/src/libcollections/btree/set.rs +++ b/src/libcollections/btree/set.rs @@ -86,13 +86,6 @@ pub struct Iter<'a, T: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: 'a> fmt::Debug for Iter<'a, T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("BTreeSet::Iter { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.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") @@ -113,13 +106,6 @@ pub struct IntoIter<T> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<T> fmt::Debug for IntoIter<T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("BTreeSet::IntoIter { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.0")] impl<T: fmt::Debug> fmt::Debug for IntoIter<T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.pad(&format!("BTreeSet::IntoIter({:?})", self.iter)) @@ -137,13 +123,6 @@ pub struct Range<'a, T: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: 'a> fmt::Debug for Range<'a, T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("BTreeSet::Range { .. }") - } -} - -#[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)) @@ -163,13 +142,6 @@ pub struct Difference<'a, T: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: 'a> fmt::Debug for Difference<'a, T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("BTreeSet::Difference { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.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") @@ -192,13 +164,6 @@ pub struct SymmetricDifference<'a, T: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: 'a> fmt::Debug for SymmetricDifference<'a, T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("BTreeSet::SymmetricDifference { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.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") @@ -220,13 +185,6 @@ pub struct Intersection<'a, T: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: 'a> fmt::Debug for Intersection<'a, T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("BTreeSet::Intersection { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.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") @@ -248,13 +206,6 @@ pub struct Union<'a, T: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: 'a> fmt::Debug for Union<'a, T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("BTreeSet::Union { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.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") diff --git a/src/libcollections/enum_set.rs b/src/libcollections/enum_set.rs index 3e739fa4f95..e4498c17617 100644 --- a/src/libcollections/enum_set.rs +++ b/src/libcollections/enum_set.rs @@ -221,13 +221,6 @@ pub struct Iter<E> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<E> fmt::Debug for Iter<E> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("EnumSet::Iter { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.0")] impl<E: fmt::Debug> fmt::Debug for Iter<E> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_tuple("EnumSet::Iter") diff --git a/src/libcollections/linked_list.rs b/src/libcollections/linked_list.rs index 112749d5b05..21be9ac1aab 100644 --- a/src/libcollections/linked_list.rs +++ b/src/libcollections/linked_list.rs @@ -66,13 +66,6 @@ pub struct Iter<'a, T: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: 'a> fmt::Debug for Iter<'a, T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("LinkedList::Iter { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.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") @@ -99,13 +92,6 @@ pub struct IterMut<'a, T: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: 'a> fmt::Debug for IterMut<'a, T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("LinkedList::IterMut { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.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") @@ -122,13 +108,6 @@ pub struct IntoIter<T> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<T> fmt::Debug for IntoIter<T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("LinkedList::IntoIter { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.0")] impl<T: fmt::Debug> fmt::Debug for IntoIter<T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_tuple("LinkedList::IntoIter") @@ -1126,13 +1105,6 @@ pub struct FrontPlace<'a, T: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: 'a> fmt::Debug for FrontPlace<'a, T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("LinkedList::FrontPlace { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.0")] 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") @@ -1186,13 +1158,6 @@ pub struct BackPlace<'a, T: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: 'a> fmt::Debug for BackPlace<'a, T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("LinkedList::BackPlace { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.0")] 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") diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 4f6212a1709..2b6343782b1 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -2093,13 +2093,6 @@ pub struct Drain<'a, T: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: 'a> fmt::Debug for Drain<'a, T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("Vec::Drain { .. }") - } -} - -#[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("Vec::Drain") @@ -2179,13 +2172,6 @@ pub struct PlaceBack<'a, T: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: 'a> fmt::Debug for PlaceBack<'a, T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("Vec::PlaceBack { .. }") - } -} - -#[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") diff --git a/src/libcollections/vec_deque.rs b/src/libcollections/vec_deque.rs index dfbfb240f46..11aacb0ff43 100644 --- a/src/libcollections/vec_deque.rs +++ b/src/libcollections/vec_deque.rs @@ -1867,13 +1867,6 @@ pub struct Iter<'a, T: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: 'a> fmt::Debug for Iter<'a, T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("VecDeque::Iter { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.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") @@ -1955,13 +1948,6 @@ pub struct IterMut<'a, T: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: 'a> fmt::Debug for IterMut<'a, T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("VecDeque::IterMut { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.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") @@ -2037,13 +2023,6 @@ pub struct IntoIter<T> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<T> fmt::Debug for IntoIter<T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("VecDeque::IntoIter { .. }") - } -} - -#[stable(feature = "collection_debug", since = "1.15.0")] impl<T: fmt::Debug> fmt::Debug for IntoIter<T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_tuple("VecDeque::IntoIter") @@ -2096,13 +2075,6 @@ pub struct Drain<'a, T: 'a> { } #[stable(feature = "collection_debug", since = "1.15.0")] -impl<'a, T: 'a> fmt::Debug for Drain<'a, T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("VecDeque::Drain { .. }") - } -} - -#[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("VecDeque::Drain") |
