Skip to content

Commit a850cdc

Browse files
Fix debug infinite loop
1 parent 5997806 commit a850cdc

File tree

4 files changed

+26
-14
lines changed

4 files changed

+26
-14
lines changed

src/libcollections/btree/set.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ pub struct Difference<'a, T: 'a> {
138138
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Difference<'a, T> {
139139
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
140140
f.debug_tuple("Difference")
141-
.field(&self.clone())
141+
.field(&self.a)
142+
.field(&self.b)
142143
.finish()
143144
}
144145
}
@@ -160,7 +161,8 @@ pub struct SymmetricDifference<'a, T: 'a> {
160161
impl<'a, T: 'a + fmt::Debug> fmt::Debug for SymmetricDifference<'a, T> {
161162
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
162163
f.debug_tuple("SymmetricDifference")
163-
.field(&self.clone())
164+
.field(&self.a)
165+
.field(&self.b)
164166
.finish()
165167
}
166168
}
@@ -182,7 +184,8 @@ pub struct Intersection<'a, T: 'a> {
182184
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Intersection<'a, T> {
183185
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
184186
f.debug_tuple("Intersection")
185-
.field(&self.clone())
187+
.field(&self.a)
188+
.field(&self.b)
186189
.finish()
187190
}
188191
}
@@ -204,7 +207,8 @@ pub struct Union<'a, T: 'a> {
204207
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Union<'a, T> {
205208
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
206209
f.debug_tuple("Union")
207-
.field(&self.clone())
210+
.field(&self.a)
211+
.field(&self.b)
208212
.finish()
209213
}
210214
}

src/libcollections/enum_set.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ pub struct Iter<E> {
225225
impl<E: fmt::Debug> fmt::Debug for Iter<E> {
226226
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
227227
f.debug_tuple("Iter")
228-
.field(&self.clone())
228+
.field(&self.index)
229+
.field(&self.bits)
229230
.finish()
230231
}
231232
}

src/libcollections/linked_list.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub struct Iter<'a, T: 'a> {
7575
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Iter<'a, T> {
7676
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7777
f.debug_tuple("Iter")
78-
.field(&self.clone())
78+
.field(&self.len)
7979
.finish()
8080
}
8181
}
@@ -107,7 +107,8 @@ pub struct IterMut<'a, T: 'a> {
107107
impl<'a, T: 'a + fmt::Debug> fmt::Debug for IterMut<'a, T> {
108108
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
109109
f.debug_tuple("IterMut")
110-
.field(self.clone())
110+
.field(&self.list)
111+
.field(&self.len)
111112
.finish()
112113
}
113114
}
@@ -129,7 +130,7 @@ pub struct IntoIter<T> {
129130
impl<T: fmt::Debug> fmt::Debug for IntoIter<T> {
130131
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
131132
f.debug_tuple("IntoIter")
132-
.field(self.clone())
133+
.field(&self.list)
133134
.finish()
134135
}
135136
}
@@ -1128,7 +1129,7 @@ pub struct FrontPlace<'a, T: 'a> {
11281129
impl<'a, T: 'a + fmt::Debug> fmt::Debug for FrontPlace<'a, T> {
11291130
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
11301131
f.debug_tuple("FrontPlace")
1131-
.field(self.clone())
1132+
.field(&self.list)
11321133
.finish()
11331134
}
11341135
}
@@ -1183,7 +1184,7 @@ pub struct BackPlace<'a, T: 'a> {
11831184
impl<'a, T: 'a + fmt::Debug> fmt::Debug for BackPlace<'a, T> {
11841185
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
11851186
f.debug_tuple("BackPlace")
1186-
.field(self.clone())
1187+
.field(&self.list)
11871188
.finish()
11881189
}
11891190
}

src/libcollections/vec_deque.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -1913,7 +1913,9 @@ pub struct Iter<'a, T: 'a> {
19131913
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Iter<'a, T> {
19141914
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
19151915
f.debug_tuple("Iter")
1916-
.field(&self.clone())
1916+
.field(&self.ring)
1917+
.field(&self.tail)
1918+
.field(&self.head)
19171919
.finish()
19181920
}
19191921
}
@@ -2000,7 +2002,9 @@ pub struct IterMut<'a, T: 'a> {
20002002
impl<'a, T: 'a + fmt::Debug> fmt::Debug for IterMut<'a, T> {
20012003
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
20022004
f.debug_tuple("IterMut")
2003-
.field(&self.clone())
2005+
.field(&self.ring)
2006+
.field(&self.tail)
2007+
.field(&self.head)
20042008
.finish()
20052009
}
20062010
}
@@ -2081,7 +2085,7 @@ pub struct IntoIter<T> {
20812085
impl<T: fmt::Debug> fmt::Debug for IntoIter<T> {
20822086
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
20832087
f.debug_tuple("IntoIter")
2084-
.field(&self.clone())
2088+
.field(&self.inner)
20852089
.finish()
20862090
}
20872091
}
@@ -2139,7 +2143,9 @@ pub struct Drain<'a, T: 'a> {
21392143
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Drain<'a, T> {
21402144
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
21412145
f.debug_tuple("Drain")
2142-
.field(&self.clone())
2146+
.field(&self.after_tail)
2147+
.field(&self.after_head)
2148+
.field(&self.iter)
21432149
.finish()
21442150
}
21452151
}

0 commit comments

Comments
 (0)