about summary refs log tree commit diff
path: root/src/libstd/thread/mod.rs
diff options
context:
space:
mode:
authorJosh Stone <cuviper@gmail.com>2019-03-27 18:15:44 -0700
committerGitHub <noreply@github.com>2019-03-27 18:15:44 -0700
commita2c4562690db552c845804223e302d42efd48c98 (patch)
tree30dcba1cf4ff7e25de3fd495278e0458ba6c5c98 /src/libstd/thread/mod.rs
parent4a322f5fddd91433b6577ccca51249e7beaaafc9 (diff)
parentba21e0b368d891102c299afe1410dd886598cda4 (diff)
downloadrust-a2c4562690db552c845804223e302d42efd48c98.tar.gz
rust-a2c4562690db552c845804223e302d42efd48c98.zip
Rollup merge of #59460 - xfix:include-id-in-thread-debug, r=Amanieu
Include id in Thread's Debug implementation

Since Rust 1.19.0, `id` is a stable method, so there is no reason to not include it in Debug implementation.
Diffstat (limited to 'src/libstd/thread/mod.rs')
-rw-r--r--src/libstd/thread/mod.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs
index 6d305aed748..058fee4484d 100644
--- a/src/libstd/thread/mod.rs
+++ b/src/libstd/thread/mod.rs
@@ -1257,7 +1257,10 @@ impl Thread {
 #[stable(feature = "rust1", since = "1.0.0")]
 impl fmt::Debug for Thread {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        fmt::Debug::fmt(&self.name(), f)
+        f.debug_struct("Thread")
+            .field("id", &self.id())
+            .field("name", &self.name())
+            .finish()
     }
 }