Skip to content

Commit ba841f0

Browse files
Remove Debug implementations specialization
1 parent 61fbdbb commit ba841f0

File tree

7 files changed

+6
-219
lines changed

7 files changed

+6
-219
lines changed

src/libcollections/binary_heap.rs

+6-30
Original file line numberDiff line numberDiff line change
@@ -228,17 +228,12 @@ pub struct PeekMut<'a, T: 'a + Ord> {
228228
sift: bool,
229229
}
230230

231-
#[stable(feature = "collection_debug", since = "1.15.0")]
232-
impl<'a, T: Ord> fmt::Debug for PeekMut<'a, T> {
233-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
234-
f.pad("PeekMut { .. }")
235-
}
236-
}
237-
238231
#[stable(feature = "collection_debug", since = "1.15.0")]
239232
impl<'a, T: Ord + fmt::Debug> fmt::Debug for PeekMut<'a, T> {
240233
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
241-
f.pad(&format!("PeekMut({:?})", self.heap.data[0]))
234+
f.debug_tuple("PeekMut")
235+
.field(&self.heap.data[0])
236+
.finish()
242237
}
243238
}
244239

@@ -982,13 +977,6 @@ pub struct Iter<'a, T: 'a> {
982977
iter: slice::Iter<'a, T>,
983978
}
984979

985-
#[stable(feature = "collection_debug", since = "1.15.0")]
986-
impl<'a, T: 'a> fmt::Debug for Iter<'a, T> {
987-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
988-
f.pad("BinaryHeap::Iter { .. }")
989-
}
990-
}
991-
992980
#[stable(feature = "collection_debug", since = "1.15.0")]
993981
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Iter<'a, T> {
994982
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -1046,13 +1034,6 @@ pub struct IntoIter<T> {
10461034
iter: vec::IntoIter<T>,
10471035
}
10481036

1049-
#[stable(feature = "collection_debug", since = "1.15.0")]
1050-
impl<T> fmt::Debug for IntoIter<T> {
1051-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1052-
f.pad("BinaryHeap::IntoIter { .. }")
1053-
}
1054-
}
1055-
10561037
#[stable(feature = "collection_debug", since = "1.15.0")]
10571038
impl<T: fmt::Debug> fmt::Debug for IntoIter<T> {
10581039
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -1101,17 +1082,12 @@ pub struct Drain<'a, T: 'a> {
11011082
iter: vec::Drain<'a, T>,
11021083
}
11031084

1104-
#[stable(feature = "collection_debug", since = "1.15.0")]
1105-
impl<'a, T: 'a> fmt::Debug for Drain<'a, T> {
1106-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1107-
f.pad("BinaryHeap::Drain { .. }")
1108-
}
1109-
}
1110-
11111085
#[stable(feature = "collection_debug", since = "1.15.0")]
11121086
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Drain<'a, T> {
11131087
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1114-
f.pad(&format!("BinaryHeap::Drain({:?})", self.iter))
1088+
f.debug_tuple("BinaryHeap::Drain")
1089+
.field(&self.iter)
1090+
.finish()
11151091
}
11161092
}
11171093

src/libcollections/btree/map.rs

-56
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,6 @@ pub struct Iter<'a, K: 'a, V: 'a> {
270270
length: usize,
271271
}
272272

273-
#[stable(feature = "collection_debug", since = "1.15.0")]
274-
impl<'a, K: 'a, V: 'a> fmt::Debug for Iter<'a, K, V> {
275-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
276-
f.pad("BTreeMap::Iter { .. }")
277-
}
278-
}
279-
280273
#[stable(feature = "collection_debug", since = "1.15.0")]
281274
impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for Iter<'a, K, V> {
282275
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -291,13 +284,6 @@ pub struct IterMut<'a, K: 'a, V: 'a> {
291284
length: usize,
292285
}
293286

294-
#[stable(feature = "collection_debug", since = "1.15.0")]
295-
impl<'a, K: 'a, V: 'a> fmt::Debug for IterMut<'a, K, V> {
296-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
297-
f.pad("BTreeMap::IterMut { .. }")
298-
}
299-
}
300-
301287
#[stable(feature = "collection_debug", since = "1.15.0")]
302288
impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for IterMut<'a, K, V> {
303289
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -313,13 +299,6 @@ pub struct IntoIter<K, V> {
313299
length: usize,
314300
}
315301

316-
#[stable(feature = "collection_debug", since = "1.15.0")]
317-
impl<K, V> fmt::Debug for IntoIter<K, V> {
318-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
319-
f.pad("BTreeMap::IntoIter { .. }")
320-
}
321-
}
322-
323302
#[stable(feature = "collection_debug", since = "1.15.0")]
324303
impl<K: fmt::Debug, V: fmt::Debug> fmt::Debug for IntoIter<K, V> {
325304
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -337,13 +316,6 @@ pub struct Keys<'a, K: 'a, V: 'a> {
337316
inner: Iter<'a, K, V>,
338317
}
339318

340-
#[stable(feature = "collection_debug", since = "1.15.0")]
341-
impl<'a, K: 'a, V: 'a> fmt::Debug for Keys<'a, K, V> {
342-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
343-
f.pad("BTreeMap::Keys { .. }")
344-
}
345-
}
346-
347319
#[stable(feature = "collection_debug", since = "1.15.0")]
348320
impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for Keys<'a, K, V> {
349321
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -357,13 +329,6 @@ pub struct Values<'a, K: 'a, V: 'a> {
357329
inner: Iter<'a, K, V>,
358330
}
359331

360-
#[stable(feature = "collection_debug", since = "1.15.0")]
361-
impl<'a, K: 'a, V: 'a> fmt::Debug for Values<'a, K, V> {
362-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
363-
f.pad("BTreeMap::Values { .. }")
364-
}
365-
}
366-
367332
#[stable(feature = "collection_debug", since = "1.15.0")]
368333
impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for Values<'a, K, V> {
369334
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -377,13 +342,6 @@ pub struct ValuesMut<'a, K: 'a, V: 'a> {
377342
inner: IterMut<'a, K, V>,
378343
}
379344

380-
#[stable(feature = "collection_debug", since = "1.15.0")]
381-
impl<'a, K: 'a, V: 'a> fmt::Debug for ValuesMut<'a, K, V> {
382-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
383-
f.pad("BTreeMap::ValuesMut { .. }")
384-
}
385-
}
386-
387345
#[stable(feature = "collection_debug", since = "1.15.0")]
388346
impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for ValuesMut<'a, K, V> {
389347
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -397,13 +355,6 @@ pub struct Range<'a, K: 'a, V: 'a> {
397355
back: Handle<NodeRef<marker::Immut<'a>, K, V, marker::Leaf>, marker::Edge>,
398356
}
399357

400-
#[stable(feature = "collection_debug", since = "1.15.0")]
401-
impl<'a, K: 'a, V: 'a> fmt::Debug for Range<'a, K, V> {
402-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
403-
f.pad("BTreeMap::Range { .. }")
404-
}
405-
}
406-
407358
#[stable(feature = "collection_debug", since = "1.15.0")]
408359
impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for Range<'a, K, V> {
409360
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -420,13 +371,6 @@ pub struct RangeMut<'a, K: 'a, V: 'a> {
420371
_marker: PhantomData<&'a mut (K, V)>,
421372
}
422373

423-
#[stable(feature = "collection_debug", since = "1.15.0")]
424-
impl<'a, K: 'a, V: 'a> fmt::Debug for RangeMut<'a, K, V> {
425-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
426-
f.pad("BTreeMap::RangeMut { .. }")
427-
}
428-
}
429-
430374
#[stable(feature = "collection_debug", since = "1.15.0")]
431375
impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for RangeMut<'a, K, V> {
432376
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

src/libcollections/btree/set.rs

-49
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,6 @@ pub struct Iter<'a, T: 'a> {
8585
iter: Keys<'a, T, ()>,
8686
}
8787

88-
#[stable(feature = "collection_debug", since = "1.15.0")]
89-
impl<'a, T: 'a> fmt::Debug for Iter<'a, T> {
90-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
91-
f.pad("BTreeSet::Iter { .. }")
92-
}
93-
}
94-
9588
#[stable(feature = "collection_debug", since = "1.15.0")]
9689
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Iter<'a, T> {
9790
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -112,13 +105,6 @@ pub struct IntoIter<T> {
112105
iter: ::btree_map::IntoIter<T, ()>,
113106
}
114107

115-
#[stable(feature = "collection_debug", since = "1.15.0")]
116-
impl<T> fmt::Debug for IntoIter<T> {
117-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
118-
f.pad("BTreeSet::IntoIter { .. }")
119-
}
120-
}
121-
122108
#[stable(feature = "collection_debug", since = "1.15.0")]
123109
impl<T: fmt::Debug> fmt::Debug for IntoIter<T> {
124110
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -136,13 +122,6 @@ pub struct Range<'a, T: 'a> {
136122
iter: ::btree_map::Range<'a, T, ()>,
137123
}
138124

139-
#[stable(feature = "collection_debug", since = "1.15.0")]
140-
impl<'a, T: 'a> fmt::Debug for Range<'a, T> {
141-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
142-
f.pad("BTreeSet::Range { .. }")
143-
}
144-
}
145-
146125
#[stable(feature = "collection_debug", since = "1.15.0")]
147126
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Range<'a, T> {
148127
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -162,13 +141,6 @@ pub struct Difference<'a, T: 'a> {
162141
b: Peekable<Iter<'a, T>>,
163142
}
164143

165-
#[stable(feature = "collection_debug", since = "1.15.0")]
166-
impl<'a, T: 'a> fmt::Debug for Difference<'a, T> {
167-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
168-
f.pad("BTreeSet::Difference { .. }")
169-
}
170-
}
171-
172144
#[stable(feature = "collection_debug", since = "1.15.0")]
173145
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Difference<'a, T> {
174146
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -191,13 +163,6 @@ pub struct SymmetricDifference<'a, T: 'a> {
191163
b: Peekable<Iter<'a, T>>,
192164
}
193165

194-
#[stable(feature = "collection_debug", since = "1.15.0")]
195-
impl<'a, T: 'a> fmt::Debug for SymmetricDifference<'a, T> {
196-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
197-
f.pad("BTreeSet::SymmetricDifference { .. }")
198-
}
199-
}
200-
201166
#[stable(feature = "collection_debug", since = "1.15.0")]
202167
impl<'a, T: 'a + fmt::Debug> fmt::Debug for SymmetricDifference<'a, T> {
203168
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -219,13 +184,6 @@ pub struct Intersection<'a, T: 'a> {
219184
b: Peekable<Iter<'a, T>>,
220185
}
221186

222-
#[stable(feature = "collection_debug", since = "1.15.0")]
223-
impl<'a, T: 'a> fmt::Debug for Intersection<'a, T> {
224-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
225-
f.pad("BTreeSet::Intersection { .. }")
226-
}
227-
}
228-
229187
#[stable(feature = "collection_debug", since = "1.15.0")]
230188
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Intersection<'a, T> {
231189
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -247,13 +205,6 @@ pub struct Union<'a, T: 'a> {
247205
b: Peekable<Iter<'a, T>>,
248206
}
249207

250-
#[stable(feature = "collection_debug", since = "1.15.0")]
251-
impl<'a, T: 'a> fmt::Debug for Union<'a, T> {
252-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
253-
f.pad("BTreeSet::Union { .. }")
254-
}
255-
}
256-
257208
#[stable(feature = "collection_debug", since = "1.15.0")]
258209
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Union<'a, T> {
259210
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

src/libcollections/enum_set.rs

-7
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,6 @@ pub struct Iter<E> {
220220
marker: marker::PhantomData<E>,
221221
}
222222

223-
#[stable(feature = "collection_debug", since = "1.15.0")]
224-
impl<E> fmt::Debug for Iter<E> {
225-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
226-
f.pad("EnumSet::Iter { .. }")
227-
}
228-
}
229-
230223
#[stable(feature = "collection_debug", since = "1.15.0")]
231224
impl<E: fmt::Debug> fmt::Debug for Iter<E> {
232225
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

src/libcollections/linked_list.rs

-35
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,6 @@ pub struct Iter<'a, T: 'a> {
6565
marker: PhantomData<&'a Node<T>>,
6666
}
6767

68-
#[stable(feature = "collection_debug", since = "1.15.0")]
69-
impl<'a, T: 'a> fmt::Debug for Iter<'a, T> {
70-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
71-
f.pad("LinkedList::Iter { .. }")
72-
}
73-
}
74-
7568
#[stable(feature = "collection_debug", since = "1.15.0")]
7669
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Iter<'a, T> {
7770
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -98,13 +91,6 @@ pub struct IterMut<'a, T: 'a> {
9891
len: usize,
9992
}
10093

101-
#[stable(feature = "collection_debug", since = "1.15.0")]
102-
impl<'a, T: 'a> fmt::Debug for IterMut<'a, T> {
103-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
104-
f.pad("LinkedList::IterMut { .. }")
105-
}
106-
}
107-
10894
#[stable(feature = "collection_debug", since = "1.15.0")]
10995
impl<'a, T: 'a + fmt::Debug> fmt::Debug for IterMut<'a, T> {
11096
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -121,13 +107,6 @@ pub struct IntoIter<T> {
121107
list: LinkedList<T>,
122108
}
123109

124-
#[stable(feature = "collection_debug", since = "1.15.0")]
125-
impl<T> fmt::Debug for IntoIter<T> {
126-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
127-
f.pad("LinkedList::IntoIter { .. }")
128-
}
129-
}
130-
131110
#[stable(feature = "collection_debug", since = "1.15.0")]
132111
impl<T: fmt::Debug> fmt::Debug for IntoIter<T> {
133112
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -1125,13 +1104,6 @@ pub struct FrontPlace<'a, T: 'a> {
11251104
node: IntermediateBox<Node<T>>,
11261105
}
11271106

1128-
#[stable(feature = "collection_debug", since = "1.15.0")]
1129-
impl<'a, T: 'a> fmt::Debug for FrontPlace<'a, T> {
1130-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1131-
f.pad("LinkedList::FrontPlace { .. }")
1132-
}
1133-
}
1134-
11351107
#[stable(feature = "collection_debug", since = "1.15.0")]
11361108
impl<'a, T: 'a + fmt::Debug> fmt::Debug for FrontPlace<'a, T> {
11371109
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -1185,13 +1157,6 @@ pub struct BackPlace<'a, T: 'a> {
11851157
node: IntermediateBox<Node<T>>,
11861158
}
11871159

1188-
#[stable(feature = "collection_debug", since = "1.15.0")]
1189-
impl<'a, T: 'a> fmt::Debug for BackPlace<'a, T> {
1190-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1191-
f.pad("LinkedList::BackPlace { .. }")
1192-
}
1193-
}
1194-
11951160
#[stable(feature = "collection_debug", since = "1.15.0")]
11961161
impl<'a, T: 'a + fmt::Debug> fmt::Debug for BackPlace<'a, T> {
11971162
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

src/libcollections/vec.rs

-14
Original file line numberDiff line numberDiff line change
@@ -2092,13 +2092,6 @@ pub struct Drain<'a, T: 'a> {
20922092
vec: Shared<Vec<T>>,
20932093
}
20942094

2095-
#[stable(feature = "collection_debug", since = "1.15.0")]
2096-
impl<'a, T: 'a> fmt::Debug for Drain<'a, T> {
2097-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2098-
f.pad("Vec::Drain { .. }")
2099-
}
2100-
}
2101-
21022095
#[stable(feature = "collection_debug", since = "1.15.0")]
21032096
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Drain<'a, T> {
21042097
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -2178,13 +2171,6 @@ pub struct PlaceBack<'a, T: 'a> {
21782171
vec: &'a mut Vec<T>,
21792172
}
21802173

2181-
#[stable(feature = "collection_debug", since = "1.15.0")]
2182-
impl<'a, T: 'a> fmt::Debug for PlaceBack<'a, T> {
2183-
default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2184-
f.pad("Vec::PlaceBack { .. }")
2185-
}
2186-
}
2187-
21882174
#[stable(feature = "collection_debug", since = "1.15.0")]
21892175
impl<'a, T: 'a + fmt::Debug> fmt::Debug for PlaceBack<'a, T> {
21902176
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

0 commit comments

Comments
 (0)