about summary refs log tree commit diff
path: root/src/libcollections/enum_set.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2017-01-11 23:12:49 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2017-01-20 21:48:35 +0100
commit61fbdbba41163b6fd327b166338a8feb89133444 (patch)
tree3557f5884dfd2ebd9d05502ee6689a97ec4c7455 /src/libcollections/enum_set.rs
parenta52da95ced667fe8ff490f73c0b041a4f926c041 (diff)
downloadrust-61fbdbba41163b6fd327b166338a8feb89133444.tar.gz
rust-61fbdbba41163b6fd327b166338a8feb89133444.zip
Add Debug implementations for libcollection structs
Diffstat (limited to 'src/libcollections/enum_set.rs')
-rw-r--r--src/libcollections/enum_set.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libcollections/enum_set.rs b/src/libcollections/enum_set.rs
index 87bc5e59ef7..3e739fa4f95 100644
--- a/src/libcollections/enum_set.rs
+++ b/src/libcollections/enum_set.rs
@@ -220,6 +220,22 @@ pub struct Iter<E> {
     marker: marker::PhantomData<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")
+         .field(&self.clone())
+         .finish()
+    }
+}
+
 // FIXME(#19839) Remove in favor of `#[derive(Clone)]`
 impl<E> Clone for Iter<E> {
     fn clone(&self) -> Iter<E> {