about summary refs log tree commit diff
path: root/src/libstd/thread
diff options
context:
space:
mode:
authorKonrad Borowski <konrad@borowski.pw>2019-03-27 12:28:17 +0100
committerKonrad Borowski <konrad@borowski.pw>2019-03-27 12:28:17 +0100
commitba21e0b368d891102c299afe1410dd886598cda4 (patch)
treededbe3e3dc75817c707a4fd4c75c807141af1a3c /src/libstd/thread
parentef4d1c419525e1510aa650e2bec0d8f7449a2130 (diff)
downloadrust-ba21e0b368d891102c299afe1410dd886598cda4.tar.gz
rust-ba21e0b368d891102c299afe1410dd886598cda4.zip
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')
-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 08f0aa2f0d2..63fa46e2edd 100644
--- a/src/libstd/thread/mod.rs
+++ b/src/libstd/thread/mod.rs
@@ -1256,7 +1256,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()
     }
 }